summaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-02-22 10:50:14 +0000
committerDavid S. Miller <davem@davemloft.net>2024-02-26 11:46:12 +0000
commite39951d965bf58b5aba7f61dc1140dcb8271af22 (patch)
tree77f0a45677f3c94b291ec43aefd8a1540407d736 /net/netlink/af_netlink.h
parentb5590270068c4324dac4a2b5a4a156e02e21339f (diff)
downloadlinux-e39951d965bf58b5aba7f61dc1140dcb8271af22.tar.gz
linux-e39951d965bf58b5aba7f61dc1140dcb8271af22.tar.bz2
linux-e39951d965bf58b5aba7f61dc1140dcb8271af22.zip
rtnetlink: change nlk->cb_mutex role
In commit af65bdfce98d ("[NETLINK]: Switch cb_lock spinlock to mutex and allow to override it"), Patrick McHardy used a common mutex to protect both nlk->cb and the dump() operations. The override is used for rtnl dumps, registered with rntl_register() and rntl_register_module(). We want to be able to opt-out some dump() operations to not acquire RTNL, so we need to protect nlk->cb with a per socket mutex. This patch renames nlk->cb_def_mutex to nlk->nl_cb_mutex The optional pointer to the mutex used to protect dump() call is stored in nlk->dump_cb_mutex Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.h')
-rw-r--r--net/netlink/af_netlink.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
index 2145979b9986..9751e29d4bbb 100644
--- a/net/netlink/af_netlink.h
+++ b/net/netlink/af_netlink.h
@@ -39,8 +39,9 @@ struct netlink_sock {
bool cb_running;
int dump_done_errno;
struct netlink_callback cb;
- struct mutex *cb_mutex;
- struct mutex cb_def_mutex;
+ struct mutex nl_cb_mutex;
+
+ struct mutex *dump_cb_mutex;
void (*netlink_rcv)(struct sk_buff *skb);
int (*netlink_bind)(struct net *net, int group);
void (*netlink_unbind)(struct net *net, int group);