inet: simplify timewait refcounting
timewait sockets have a complex refcounting logic.
Once we realize it should be similar to established and
syn_recv sockets, we can use sk_nulls_del_node_init_rcu()
and remove inet_twsk_unhash()
In particular, deferred inet_twsk_put() added in commit
13475a30b6
("tcp: connect() race with timewait reuse")
looks unecessary : When removing a timewait socket from
ehash or bhash, caller must own a reference on the socket
anyway.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
3fd2f1b9d9
commit
fc01538f9f
@@ -100,10 +100,8 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk)
|
||||
void inet_twsk_free(struct inet_timewait_sock *tw);
|
||||
void inet_twsk_put(struct inet_timewait_sock *tw);
|
||||
|
||||
int inet_twsk_unhash(struct inet_timewait_sock *tw);
|
||||
|
||||
int inet_twsk_bind_unhash(struct inet_timewait_sock *tw,
|
||||
struct inet_hashinfo *hashinfo);
|
||||
void inet_twsk_bind_unhash(struct inet_timewait_sock *tw,
|
||||
struct inet_hashinfo *hashinfo);
|
||||
|
||||
struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk,
|
||||
struct inet_timewait_death_row *dr,
|
||||
|
Reference in New Issue
Block a user