Commit 8ea1eebb authored by Martin KaFai Lau's avatar Martin KaFai Lau Committed by Jakub Kicinski

net: inet: Remove count from inet_listen_hashbucket

After commit 0ee58dad ("net: tcp6: prefer listeners bound to an address")
and commit d9fbc7f6 ("net: tcp: prefer listeners bound to an address"),
the count is no longer used.  This patch removes it.
Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0c1822d9
...@@ -111,7 +111,6 @@ struct inet_bind_hashbucket { ...@@ -111,7 +111,6 @@ struct inet_bind_hashbucket {
#define LISTENING_NULLS_BASE (1U << 29) #define LISTENING_NULLS_BASE (1U << 29)
struct inet_listen_hashbucket { struct inet_listen_hashbucket {
spinlock_t lock; spinlock_t lock;
unsigned int count;
union { union {
struct hlist_head head; struct hlist_head head;
struct hlist_nulls_head nulls_head; struct hlist_nulls_head nulls_head;
......
...@@ -209,7 +209,6 @@ static void inet_hash2(struct inet_hashinfo *h, struct sock *sk) ...@@ -209,7 +209,6 @@ static void inet_hash2(struct inet_hashinfo *h, struct sock *sk)
else else
hlist_add_head_rcu(&inet_csk(sk)->icsk_listen_portaddr_node, hlist_add_head_rcu(&inet_csk(sk)->icsk_listen_portaddr_node,
&ilb2->head); &ilb2->head);
ilb2->count++;
spin_unlock(&ilb2->lock); spin_unlock(&ilb2->lock);
} }
...@@ -225,7 +224,6 @@ static void inet_unhash2(struct inet_hashinfo *h, struct sock *sk) ...@@ -225,7 +224,6 @@ static void inet_unhash2(struct inet_hashinfo *h, struct sock *sk)
spin_lock(&ilb2->lock); spin_lock(&ilb2->lock);
hlist_del_init_rcu(&inet_csk(sk)->icsk_listen_portaddr_node); hlist_del_init_rcu(&inet_csk(sk)->icsk_listen_portaddr_node);
ilb2->count--;
spin_unlock(&ilb2->lock); spin_unlock(&ilb2->lock);
} }
...@@ -657,7 +655,6 @@ int __inet_hash(struct sock *sk, struct sock *osk) ...@@ -657,7 +655,6 @@ int __inet_hash(struct sock *sk, struct sock *osk)
else else
__sk_nulls_add_node_rcu(sk, &ilb->nulls_head); __sk_nulls_add_node_rcu(sk, &ilb->nulls_head);
inet_hash2(hashinfo, sk); inet_hash2(hashinfo, sk);
ilb->count++;
sock_set_flag(sk, SOCK_RCU_FREE); sock_set_flag(sk, SOCK_RCU_FREE);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
unlock: unlock:
...@@ -689,7 +686,6 @@ static void __inet_unhash(struct sock *sk, struct inet_listen_hashbucket *ilb) ...@@ -689,7 +686,6 @@ static void __inet_unhash(struct sock *sk, struct inet_listen_hashbucket *ilb)
struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
inet_unhash2(hashinfo, sk); inet_unhash2(hashinfo, sk);
ilb->count--;
} }
__sk_nulls_del_node_init_rcu(sk); __sk_nulls_del_node_init_rcu(sk);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
...@@ -882,7 +878,6 @@ void inet_hashinfo_init(struct inet_hashinfo *h) ...@@ -882,7 +878,6 @@ void inet_hashinfo_init(struct inet_hashinfo *h)
spin_lock_init(&h->listening_hash[i].lock); spin_lock_init(&h->listening_hash[i].lock);
INIT_HLIST_NULLS_HEAD(&h->listening_hash[i].nulls_head, INIT_HLIST_NULLS_HEAD(&h->listening_hash[i].nulls_head,
i + LISTENING_NULLS_BASE); i + LISTENING_NULLS_BASE);
h->listening_hash[i].count = 0;
} }
h->lhash2 = NULL; h->lhash2 = NULL;
...@@ -896,7 +891,6 @@ static void init_hashinfo_lhash2(struct inet_hashinfo *h) ...@@ -896,7 +891,6 @@ static void init_hashinfo_lhash2(struct inet_hashinfo *h)
for (i = 0; i <= h->lhash2_mask; i++) { for (i = 0; i <= h->lhash2_mask; i++) {
spin_lock_init(&h->lhash2[i].lock); spin_lock_init(&h->lhash2[i].lock);
INIT_HLIST_HEAD(&h->lhash2[i].head); INIT_HLIST_HEAD(&h->lhash2[i].head);
h->lhash2[i].count = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment