summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2023-11-15 13:17:12 +0100
committerSasha Levin <sashal@kernel.org>2024-03-26 18:18:54 -0400
commitd3f90a20aec912ea8b91362feeae1541cdba65c8 (patch)
tree4a50b1ecec673dd8b00e427b07a1e3d98394801e /net
parent90904272779a20d19853686f13894ca642e19032 (diff)
downloadlinux-stable-d3f90a20aec912ea8b91362feeae1541cdba65c8.tar.gz
linux-stable-d3f90a20aec912ea8b91362feeae1541cdba65c8.tar.bz2
linux-stable-d3f90a20aec912ea8b91362feeae1541cdba65c8.zip
devlink: Enable the use of private flags in post_doit operations
[ Upstream commit c8d0a7d6152bec970552786b77626f4b4c562f4d ] Currently, private flags (e.g., 'DEVLINK_NL_FLAG_NEED_PORT') are only used in pre_doit operations, but a subsequent patch will need to conditionally lock and unlock the device lock in pre and post doit operations, respectively. As a preparation, enable the use of private flags in post_doit operations in a similar fashion to how it is done for pre_doit operations. No functional changes intended. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: d7d75124965a ("devlink: Fix devlink parallel commands processing") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/devlink/netlink.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/devlink/netlink.c b/net/devlink/netlink.c
index 7350138c8bb4..5bb6624f3288 100644
--- a/net/devlink/netlink.c
+++ b/net/devlink/netlink.c
@@ -141,8 +141,8 @@ int devlink_nl_pre_doit_port_optional(const struct genl_split_ops *ops,
return __devlink_nl_pre_doit(skb, info, DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT);
}
-void devlink_nl_post_doit(const struct genl_split_ops *ops,
- struct sk_buff *skb, struct genl_info *info)
+static void __devlink_nl_post_doit(struct sk_buff *skb, struct genl_info *info,
+ u8 flags)
{
struct devlink *devlink;
@@ -151,6 +151,12 @@ void devlink_nl_post_doit(const struct genl_split_ops *ops,
devlink_put(devlink);
}
+void devlink_nl_post_doit(const struct genl_split_ops *ops,
+ struct sk_buff *skb, struct genl_info *info)
+{
+ __devlink_nl_post_doit(skb, info, 0);
+}
+
static int devlink_nl_inst_single_dumpit(struct sk_buff *msg,
struct netlink_callback *cb, int flags,
devlink_nl_dump_one_func_t *dump_one,