af_unix: Put a socket into a per-netns hash table.

This commit replaces the global hash table with a per-netns one and removes
the global one.

We now link a socket in each netns's hash table so we can save some netns
comparisons when iterating through a hash bucket.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kuniyuki Iwashima
2022-06-21 10:19:12 -07:00
committed by David S. Miller
parent 79b05beaa5
commit cf2f225e26
3 changed files with 23 additions and 37 deletions

View File

@@ -22,7 +22,6 @@ struct sock *unix_peer_get(struct sock *sk);
extern unsigned int unix_tot_inflight;
extern spinlock_t unix_table_locks[UNIX_HASH_SIZE];
extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE];
struct unix_address {
refcount_t refcnt;