Skip to content

Commit b2cb9f9

Browse files
q2vendavem330
authored andcommitted
tcp: Unlink sk from bhash.
Now we do not use tb->owners and can unlink sockets from bhash. sk_bind_node/tw_bind_node are available for bhash2 and will be used in the following patch. Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8002d44 commit b2cb9f9

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

include/net/inet_hashtables.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ struct inet_bind_bucket {
8888
unsigned short fast_sk_family;
8989
bool fast_ipv6_only;
9090
struct hlist_node node;
91-
struct hlist_head owners;
9291
struct hlist_head bhash2;
9392
};
9493

net/ipv4/inet_hashtables.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep,
7676
tb->port = snum;
7777
tb->fastreuse = 0;
7878
tb->fastreuseport = 0;
79-
INIT_HLIST_HEAD(&tb->owners);
8079
INIT_HLIST_HEAD(&tb->bhash2);
8180
hlist_add_head(&tb->node, &head->chain);
8281
}
@@ -169,7 +168,6 @@ void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
169168
struct inet_bind2_bucket *tb2, unsigned short port)
170169
{
171170
inet_sk(sk)->inet_num = port;
172-
sk_add_bind_node(sk, &tb->owners);
173171
inet_csk(sk)->icsk_bind_hash = tb;
174172
sk_add_bind2_node(sk, &tb2->owners);
175173
inet_csk(sk)->icsk_bind2_hash = tb2;
@@ -192,7 +190,6 @@ static void __inet_put_port(struct sock *sk)
192190

193191
spin_lock(&head->lock);
194192
tb = inet_csk(sk)->icsk_bind_hash;
195-
__sk_del_bind_node(sk);
196193
inet_csk(sk)->icsk_bind_hash = NULL;
197194
inet_sk(sk)->inet_num = 0;
198195

net/ipv4/inet_timewait_sock.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ void inet_twsk_bind_unhash(struct inet_timewait_sock *tw,
3535
if (!tb)
3636
return;
3737

38-
__hlist_del(&tw->tw_bind_node);
3938
tw->tw_tb = NULL;
4039

4140
__hlist_del(&tw->tw_bind2_node);
@@ -94,12 +93,6 @@ static void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw,
9493
hlist_nulls_add_head_rcu(&tw->tw_node, list);
9594
}
9695

97-
static void inet_twsk_add_bind_node(struct inet_timewait_sock *tw,
98-
struct hlist_head *list)
99-
{
100-
hlist_add_head(&tw->tw_bind_node, list);
101-
}
102-
10396
static void inet_twsk_add_bind2_node(struct inet_timewait_sock *tw,
10497
struct hlist_head *list)
10598
{
@@ -133,7 +126,6 @@ void inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
133126

134127
tw->tw_tb = icsk->icsk_bind_hash;
135128
WARN_ON(!icsk->icsk_bind_hash);
136-
inet_twsk_add_bind_node(tw, &tw->tw_tb->owners);
137129

138130
tw->tw_tb2 = icsk->icsk_bind2_hash;
139131
WARN_ON(!icsk->icsk_bind2_hash);

0 commit comments

Comments
 (0)