diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-08-14 14:47:17 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-15 14:54:44 -0700 |
commit | 9272af109fe65d1a13f28c5c13777b62d3e97e8c (patch) | |
tree | edb1bbfc92c4f5314ca2fff9faa4e7a24ee3390d /include/net | |
parent | bffcc6882a1bb2be8c9420184966f4c2c822078e (diff) |
genetlink: add struct genl_info to struct genl_dumpit_info
Netlink GET implementations must currently juggle struct genl_info
and struct netlink_callback, depending on whether they were called
from doit or dumpit.
Add genl_info to the dump state and populate the fields.
This way implementations can simply pass struct genl_info around.
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230814214723.2924989-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/genetlink.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 9dc21ec15734..86c8eaaa3a43 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -250,11 +250,13 @@ struct genl_split_ops { * @family: generic netlink family - for internal genl code usage * @op: generic netlink ops - for internal genl code usage * @attrs: netlink attributes + * @info: struct genl_info describing the request */ struct genl_dumpit_info { const struct genl_family *family; struct genl_split_ops op; struct nlattr **attrs; + struct genl_info info; }; static inline const struct genl_dumpit_info * @@ -263,6 +265,12 @@ genl_dumpit_info(struct netlink_callback *cb) return cb->data; } +static inline const struct genl_info * +genl_info_dump(struct netlink_callback *cb) +{ + return &genl_dumpit_info(cb)->info; +} + int genl_register_family(struct genl_family *family); int genl_unregister_family(const struct genl_family *family); void genl_notify(const struct genl_family *family, struct sk_buff *skb, |