inet: Add a count to struct inet_listen_hashbucket

This patch adds a count to the 'struct inet_listen_hashbucket'.
It counts how many sk is hashed to a bucket.  It will be
used to decide if the (to-be-added) portaddr listener's hashtable
should be used during inet[6]_lookup_listener().

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Martin KaFai Lau
2017-12-01 12:52:29 -08:00
committed by David S. Miller
parent fb7516d424
commit 76d013b20b
2 changed files with 10 additions and 2 deletions

View File

@@ -111,6 +111,7 @@ struct inet_bind_hashbucket {
*/
struct inet_listen_hashbucket {
spinlock_t lock;
unsigned int count;
struct hlist_head head;
};