aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f80c56ac4d82..6d3af05c107c 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -245,6 +245,8 @@ struct netlink_callback {
245 struct netlink_callback *cb); 245 struct netlink_callback *cb);
246 int (*done)(struct netlink_callback *cb); 246 int (*done)(struct netlink_callback *cb);
247 void *data; 247 void *data;
248 /* the module that dump function belong to */
249 struct module *module;
248 u16 family; 250 u16 family;
249 u16 min_dump_alloc; 251 u16 min_dump_alloc;
250 unsigned int prev_seq, seq; 252 unsigned int prev_seq, seq;
@@ -262,14 +264,24 @@ __nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int fla
262 264
263struct netlink_dump_control { 265struct netlink_dump_control {
264 int (*dump)(struct sk_buff *skb, struct netlink_callback *); 266 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
265 int (*done)(struct netlink_callback*); 267 int (*done)(struct netlink_callback *);
266 void *data; 268 void *data;
269 struct module *module;
267 u16 min_dump_alloc; 270 u16 min_dump_alloc;
268}; 271};
269 272
270extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 273extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
271 const struct nlmsghdr *nlh, 274 const struct nlmsghdr *nlh,
272 struct netlink_dump_control *control); 275 struct netlink_dump_control *control);
276static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
277 const struct nlmsghdr *nlh,
278 struct netlink_dump_control *control)
279{
280 if (!control->module)
281 control->module = THIS_MODULE;
282
283 return __netlink_dump_start(ssk, skb, nlh, control);
284}
273 285
274#endif /* __KERNEL__ */ 286#endif /* __KERNEL__ */
275 287