mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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>
This commit is contained in:
parent
5de658f878
commit
a46621a3a8
5 changed files with 53 additions and 80 deletions
|
@ -1645,6 +1645,24 @@ static void netlink_destroy_callback(struct netlink_callback *cb)
|
|||
kfree(cb);
|
||||
}
|
||||
|
||||
struct nlmsghdr *
|
||||
__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
|
||||
{
|
||||
struct nlmsghdr *nlh;
|
||||
int size = NLMSG_LENGTH(len);
|
||||
|
||||
nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size));
|
||||
nlh->nlmsg_type = type;
|
||||
nlh->nlmsg_len = size;
|
||||
nlh->nlmsg_flags = flags;
|
||||
nlh->nlmsg_pid = pid;
|
||||
nlh->nlmsg_seq = seq;
|
||||
if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0)
|
||||
memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
|
||||
return nlh;
|
||||
}
|
||||
EXPORT_SYMBOL(__nlmsg_put);
|
||||
|
||||
/*
|
||||
* It looks a bit ugly.
|
||||
* It would be better to create kernel thread.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue