aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/af_unix.h
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>2021-11-24 11:14:29 +0900
committerJakub Kicinski <kuba@kernel.org>2021-11-26 18:01:57 -0800
commite6b4b873896f0e9298f70d25726f4bb1e1b265ba (patch)
tree28cc19f5e0cb930e261ec0ab463c2232370f4dd2 /include/net/af_unix.h
parentaf_unix: Add helpers to calculate hashes. (diff)
downloadlinux-dev-e6b4b873896f0e9298f70d25726f4bb1e1b265ba.tar.xz
linux-dev-e6b4b873896f0e9298f70d25726f4bb1e1b265ba.zip
af_unix: Save hash in sk_hash.
To replace unix_table_lock with per-hash locks in the next patch, we need to save a hash in each socket because /proc/net/unix or BPF prog iterate sockets while holding a hash table lock and release it later in a different function. Currently, we store a real/pseudo hash in struct unix_address. However, we do not allocate it to unbound sockets, nor should we do just for that. For this purpose, we can use sk_hash. Then, we no longer use the hash field in struct unix_address and can remove it. Also, this patch does - rename unix_insert_socket() to unix_insert_unbound_socket() - remove the redundant list argument from __unix_insert_socket() and unix_insert_unbound_socket() - use 'unsigned int' instead of 'unsigned' in __unix_set_addr_hash() - remove 'inline' from unix_remove_socket() and unix_insert_unbound_socket(). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/af_unix.h')
-rw-r--r--include/net/af_unix.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 7d142e8a0550..89049cc6c066 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -26,7 +26,6 @@ extern struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE];
struct unix_address {
refcount_t refcnt;
int len;
- unsigned int hash;
struct sockaddr_un name[];
};