summaryrefslogtreecommitdiff
path: root/include/net/phonet
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2024-10-17 11:31:34 -0700
committerPaolo Abeni <pabeni@redhat.com>2024-10-24 16:03:40 +0200
commit42f5fe1dc4babad1c49bcc4121983fffccee3cd9 (patch)
tree6c8061f7470d16d3d140984ca3276abc98de78e4 /include/net/phonet
parent68ed5c38b512b734caf3da1f87db4a99fcfe3002 (diff)
downloadlwn-42f5fe1dc4babad1c49bcc4121983fffccee3cd9.tar.gz
lwn-42f5fe1dc4babad1c49bcc4121983fffccee3cd9.zip
phonet: Convert phonet_device_list.lock to spinlock_t.
addr_doit() calls phonet_address_add() or phonet_address_del() for RTM_NEWADDR or RTM_DELADDR, respectively. Both functions only touch phonet_device_list(dev_net(dev)), which is currently protected by RTNL and its dedicated mutex, phonet_device_list.lock. We will convert addr_doit() to RCU and cannot use mutex inside RCU. Let's convert the mutex to spinlock_t. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net/phonet')
-rw-r--r--include/net/phonet/pn_dev.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 6b2102b4ece3..ac0331d83a81 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -12,12 +12,13 @@
#include <linux/list.h>
#include <linux/mutex.h>
+#include <linux/spinlock.h>
struct net;
struct phonet_device_list {
struct list_head list;
- struct mutex lock;
+ spinlock_t lock;
};
struct phonet_device_list *phonet_device_list(struct net *net);