summaryrefslogtreecommitdiff
path: root/net/ipv4/raw_diag.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-06-20 13:05:09 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-06-21 12:38:29 +0300
commitaf185d8c76333daa877678e0166a7b45e63bf3c4 (patch)
tree0c3f2c0168c01595f1b17e34d9b4cd290a0e82c6 /net/ipv4/raw_diag.c
parentf9aefd6b2aa38b9787d2705f0f1161dfd23cdb8f (diff)
downloadlinux-af185d8c76333daa877678e0166a7b45e63bf3c4.tar.xz
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 'net/ipv4/raw_diag.c')
-rw-r--r--net/ipv4/raw_diag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c
index ac4b6525d3c6..999321834b94 100644
--- a/net/ipv4/raw_diag.c
+++ b/net/ipv4/raw_diag.c
@@ -156,7 +156,7 @@ static void raw_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
s_slot = cb->args[0];
num = s_num = cb->args[1];
- read_lock(&hashinfo->lock);
+ rcu_read_lock();
for (slot = s_slot; slot < RAW_HTABLE_SIZE; s_num = 0, slot++) {
num = 0;
@@ -184,7 +184,7 @@ next:
}
out_unlock:
- read_unlock(&hashinfo->lock);
+ rcu_read_unlock();
cb->args[0] = slot;
cb->args[1] = num;