diff options
author | Robert Richter <robert.richter@amd.com> | 2010-10-11 19:26:50 +0200 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-10-11 19:26:50 +0200 |
commit | ad0f7cfaa85fc033523a09ab1f3dd6b8ded3dff5 (patch) | |
tree | 2565121e4b9945d953e02c77a2e53065b3789aa4 /net/netlink | |
parent | 86c8c04792f152c5469023885510140dd34817bc (diff) | |
parent | c7a27aa4652c63172489a73f3961455650a79a7f (diff) | |
download | linux-ad0f7cfaa85fc033523a09ab1f3dd6b8ded3dff5.tar.gz linux-ad0f7cfaa85fc033523a09ab1f3dd6b8ded3dff5.tar.bz2 linux-ad0f7cfaa85fc033523a09ab1f3dd6b8ded3dff5.zip |
Merge branch 'oprofile/urgent' (early part) into oprofile/perf
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 980fe4ad0016..cd96ed3ccee4 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2102,6 +2102,26 @@ static void __net_exit netlink_net_exit(struct net *net) #endif } +static void __init netlink_add_usersock_entry(void) +{ + unsigned long *listeners; + int groups = 32; + + listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head), + GFP_KERNEL); + if (!listeners) + panic("netlink_add_usersock_entry: Cannot allocate listneres\n"); + + netlink_table_grab(); + + nl_table[NETLINK_USERSOCK].groups = groups; + nl_table[NETLINK_USERSOCK].listeners = listeners; + nl_table[NETLINK_USERSOCK].module = THIS_MODULE; + nl_table[NETLINK_USERSOCK].registered = 1; + + netlink_table_ungrab(); +} + static struct pernet_operations __net_initdata netlink_net_ops = { .init = netlink_net_init, .exit = netlink_net_exit, @@ -2150,6 +2170,8 @@ static int __init netlink_proto_init(void) hash->rehash_time = jiffies; } + netlink_add_usersock_entry(); + sock_register(&netlink_family_ops); register_pernet_subsys(&netlink_net_ops); /* The netlink device handler may be needed early. */ |