diff options
author | Eric Dumazet <edumazet@google.com> | 2022-06-20 03:05:09 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-06-21 11:38:29 +0200 |
commit | af185d8c76333daa877678e0166a7b45e63bf3c4 (patch) | |
tree | 0c3f2c0168c01595f1b17e34d9b4cd290a0e82c6 /include/net | |
parent | f9aefd6b2aa38b9787d2705f0f1161dfd23cdb8f (diff) | |
download | linux-next-af185d8c76333daa877678e0166a7b45e63bf3c4.tar.gz |
raw: complete rcu conversion
raw_diag_dump() can use rcu_read_lock() instead of read_lock()
Now the hashinfo lock is only used from process context,
in write mode only, we can convert it to a spinlock,
and we do not need to block BH anymore.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220620100509.3493504-1-eric.dumazet@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/raw.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/raw.h b/include/net/raw.h index d81eeeb8f1e6..d224376360e1 100644 --- a/include/net/raw.h +++ b/include/net/raw.h @@ -32,7 +32,7 @@ int raw_rcv(struct sock *, struct sk_buff *); #define RAW_HTABLE_SIZE MAX_INET_PROTOS struct raw_hashinfo { - rwlock_t lock; + spinlock_t lock; struct hlist_nulls_head ht[RAW_HTABLE_SIZE]; }; @@ -40,7 +40,7 @@ static inline void raw_hashinfo_init(struct raw_hashinfo *hashinfo) { int i; - rwlock_init(&hashinfo->lock); + spin_lock_init(&hashinfo->lock); for (i = 0; i < RAW_HTABLE_SIZE; i++) INIT_HLIST_NULLS_HEAD(&hashinfo->ht[i], i); } |