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>
This commit is contained in:

committed by
David S. Miller

parent
be064defab
commit
1927f41a22
@@ -127,6 +127,20 @@ enum genl_validate_flags {
|
||||
GENL_DONT_VALIDATE_DUMP_STRICT = BIT(2),
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
Reference in New Issue
Block a user