diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-11-14 11:14:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-14 17:10:41 -0500 |
commit | d91824c08fbcb265ec930d863fa905e8daa836a4 (patch) | |
tree | 2f3c2f27b68f46e1dc5e1fc3139cd52942f818b2 /include/net/genetlink.h | |
parent | 3686ec5e84977eddc796903177e7e0a122585c11 (diff) |
genetlink: register family ops as array
Instead of using a linked list, use an array. This reduces
the data size needed by the users of genetlink, for example
in wireless (net/wireless/nl80211.c) on 64-bit it frees up
over 1K of data space.
Remove the attempted sending of CTRL_CMD_NEWOPS ctrl event
since genl_ctrl_event(CTRL_CMD_NEWOPS, ...) only returns
-EINVAL anyway, therefore no such event could ever be sent.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/genetlink.h')
-rw-r--r-- | include/net/genetlink.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 617d718524b0..d4802af1a8b3 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -39,9 +39,10 @@ struct genl_info; | |||
39 | * @post_doit: called after an operation's doit callback, it may | 39 | * @post_doit: called after an operation's doit callback, it may |
40 | * undo operations done by pre_doit, for example release locks | 40 | * undo operations done by pre_doit, for example release locks |
41 | * @attrbuf: buffer to store parsed attributes | 41 | * @attrbuf: buffer to store parsed attributes |
42 | * @ops_list: list of all assigned operations | ||
43 | * @family_list: family list | 42 | * @family_list: family list |
44 | * @mcast_groups: multicast groups list | 43 | * @mcast_groups: multicast groups list |
44 | * @ops: the operations supported by this family (private) | ||
45 | * @n_ops: number of operations supported by this family (private) | ||
45 | */ | 46 | */ |
46 | struct genl_family { | 47 | struct genl_family { |
47 | unsigned int id; | 48 | unsigned int id; |
@@ -58,7 +59,8 @@ struct genl_family { | |||
58 | struct sk_buff *skb, | 59 | struct sk_buff *skb, |
59 | struct genl_info *info); | 60 | struct genl_info *info); |
60 | struct nlattr ** attrbuf; /* private */ | 61 | struct nlattr ** attrbuf; /* private */ |
61 | struct list_head ops_list; /* private */ | 62 | struct genl_ops * ops; /* private */ |
63 | unsigned int n_ops; /* private */ | ||
62 | struct list_head family_list; /* private */ | 64 | struct list_head family_list; /* private */ |
63 | struct list_head mcast_groups; /* private */ | 65 | struct list_head mcast_groups; /* private */ |
64 | struct module *module; | 66 | struct module *module; |
@@ -119,7 +121,6 @@ struct genl_ops { | |||
119 | int (*dumpit)(struct sk_buff *skb, | 121 | int (*dumpit)(struct sk_buff *skb, |
120 | struct netlink_callback *cb); | 122 | struct netlink_callback *cb); |
121 | int (*done)(struct netlink_callback *cb); | 123 | int (*done)(struct netlink_callback *cb); |
122 | struct list_head ops_list; | ||
123 | }; | 124 | }; |
124 | 125 | ||
125 | int __genl_register_family(struct genl_family *family); | 126 | int __genl_register_family(struct genl_family *family); |