diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-30 15:22:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-30 15:22:06 -0500 |
commit | a46621a3a8f24557201a7ef62de151c812f8985c (patch) | |
tree | 9701dd51e082d600ce4b69ee4773805630ab0ada /net/netlink/genetlink.c | |
parent | 5de658f878d49e952d7b3f3f26a396132829f513 (diff) |
net: Deinline __nlmsg_put and genlmsg_put. -7k code on i386 defconfig.
text data bss dec hex filename
8455963 532732 1810804 10799499 a4c98b vmlinux.o.before
8448899 532732 1810804 10792435 a4adf3 vmlinux.o
This change also removes commented-out copy of __nlmsg_put
which was last touched in 2005 with "Enable once all users
have been converted" comment on top.
Changes in v2: rediffed against net-next.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r-- | net/netlink/genetlink.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index c29d2568c9e..a1154717219 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -498,6 +498,37 @@ int genl_unregister_family(struct genl_family *family) | |||
498 | } | 498 | } |
499 | EXPORT_SYMBOL(genl_unregister_family); | 499 | EXPORT_SYMBOL(genl_unregister_family); |
500 | 500 | ||
501 | /** | ||
502 | * genlmsg_put - Add generic netlink header to netlink message | ||
503 | * @skb: socket buffer holding the message | ||
504 | * @pid: netlink pid the message is addressed to | ||
505 | * @seq: sequence number (usually the one of the sender) | ||
506 | * @family: generic netlink family | ||
507 | * @flags netlink message flags | ||
508 | * @cmd: generic netlink command | ||
509 | * | ||
510 | * Returns pointer to user specific header | ||
511 | */ | ||
512 | void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, | ||
513 | struct genl_family *family, int flags, u8 cmd) | ||
514 | { | ||
515 | struct nlmsghdr *nlh; | ||
516 | struct genlmsghdr *hdr; | ||
517 | |||
518 | nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN + | ||
519 | family->hdrsize, flags); | ||
520 | if (nlh == NULL) | ||
521 | return NULL; | ||
522 | |||
523 | hdr = nlmsg_data(nlh); | ||
524 | hdr->cmd = cmd; | ||
525 | hdr->version = family->version; | ||
526 | hdr->reserved = 0; | ||
527 | |||
528 | return (char *) hdr + GENL_HDRLEN; | ||
529 | } | ||
530 | EXPORT_SYMBOL(genlmsg_put); | ||
531 | |||
501 | static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | 532 | static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) |
502 | { | 533 | { |
503 | struct genl_ops *ops; | 534 | struct genl_ops *ops; |