diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-10-05 20:04:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-06 15:44:46 +0200 |
commit | 1927f41a22a05e3bc178fa47f7ce7be271fbc541 (patch) | |
tree | 11fac2365b343bca6cbb18ea79111246998a90aa /include/net/genetlink.h | |
parent | net: genetlink: push doit/dumpit code from genl_family_rcv_msg (diff) | |
download | linux-1927f41a22a05e3bc178fa47f7ce7be271fbc541.tar.xz linux-1927f41a22a05e3bc178fa47f7ce7be271fbc541.zip |
net: genetlink: introduce dump info struct to be available during dumpit op
Currently the cb->data is taken by ops during non-parallel dumping.
Introduce a new structure genl_dumpit_info and store the ops there.
Distribute the info to both non-parallel and parallel dumping. Also add
a helper genl_dumpit_info() to easily get the info structure in the
dumpit callback from cb.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/genetlink.h')
-rw-r--r-- | include/net/genetlink.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 9292f1c588b7..fb838f4b0089 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -128,6 +128,20 @@ enum genl_validate_flags { }; /** + * struct genl_info - info that is available during dumpit op call + * @ops: generic netlink ops - for internal genl code usage + */ +struct genl_dumpit_info { + const struct genl_ops *ops; +}; + +static inline const struct genl_dumpit_info * +genl_dumpit_info(struct netlink_callback *cb) +{ + return cb->data; +} + +/** * struct genl_ops - generic netlink operations * @cmd: command identifier * @internal_flags: flags used by the family |