aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-01-30 15:22:06 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-30 15:22:06 -0500
commita46621a3a8f24557201a7ef62de151c812f8985c (patch)
tree9701dd51e082d600ce4b69ee4773805630ab0ada /net/netlink/af_netlink.c
parent5de658f878d49e952d7b3f3f26a396132829f513 (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/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 629b06182f3f..4d751e3d4b4b 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1645,6 +1645,24 @@ static void netlink_destroy_callback(struct netlink_callback *cb)
1645 kfree(cb); 1645 kfree(cb);
1646} 1646}
1647 1647
1648struct nlmsghdr *
1649__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
1650{
1651 struct nlmsghdr *nlh;
1652 int size = NLMSG_LENGTH(len);
1653
1654 nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size));
1655 nlh->nlmsg_type = type;
1656 nlh->nlmsg_len = size;
1657 nlh->nlmsg_flags = flags;
1658 nlh->nlmsg_pid = pid;
1659 nlh->nlmsg_seq = seq;
1660 if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0)
1661 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
1662 return nlh;
1663}
1664EXPORT_SYMBOL(__nlmsg_put);
1665
1648/* 1666/*
1649 * It looks a bit ugly. 1667 * It looks a bit ugly.
1650 * It would be better to create kernel thread. 1668 * It would be better to create kernel thread.