diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-01-16 22:35:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-17 22:16:02 -0500 |
commit | 2c8c1e7297e19bdef3c178c3ea41d898a7716e3e (patch) | |
tree | 4d336562e8d5379732a0646e17b0bb1750111ef6 /net/core | |
parent | 72659ecce68588b74f6c46862c2b4cec137d7a5a (diff) |
net: spread __net_init, __net_exit
__net_init/__net_exit are apparently not going away, so use them
to full extent.
In some cases __net_init was removed, because it was called from
__net_exit code.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/fib_rules.c | 2 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 4 | ||||
-rw-r--r-- | net/core/sock.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 02a3b2c69c1e..9a24377146bf 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -708,7 +708,7 @@ static struct notifier_block fib_rules_notifier = { | |||
708 | .notifier_call = fib_rules_event, | 708 | .notifier_call = fib_rules_event, |
709 | }; | 709 | }; |
710 | 710 | ||
711 | static int fib_rules_net_init(struct net *net) | 711 | static int __net_init fib_rules_net_init(struct net *net) |
712 | { | 712 | { |
713 | INIT_LIST_HEAD(&net->rules_ops); | 713 | INIT_LIST_HEAD(&net->rules_ops); |
714 | spin_lock_init(&net->rules_mod_lock); | 714 | spin_lock_init(&net->rules_mod_lock); |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 794bcb897ff0..62f3878a6010 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1386,7 +1386,7 @@ static struct notifier_block rtnetlink_dev_notifier = { | |||
1386 | }; | 1386 | }; |
1387 | 1387 | ||
1388 | 1388 | ||
1389 | static int rtnetlink_net_init(struct net *net) | 1389 | static int __net_init rtnetlink_net_init(struct net *net) |
1390 | { | 1390 | { |
1391 | struct sock *sk; | 1391 | struct sock *sk; |
1392 | sk = netlink_kernel_create(net, NETLINK_ROUTE, RTNLGRP_MAX, | 1392 | sk = netlink_kernel_create(net, NETLINK_ROUTE, RTNLGRP_MAX, |
@@ -1397,7 +1397,7 @@ static int rtnetlink_net_init(struct net *net) | |||
1397 | return 0; | 1397 | return 0; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | static void rtnetlink_net_exit(struct net *net) | 1400 | static void __net_exit rtnetlink_net_exit(struct net *net) |
1401 | { | 1401 | { |
1402 | netlink_kernel_release(net->rtnl); | 1402 | netlink_kernel_release(net->rtnl); |
1403 | net->rtnl = NULL; | 1403 | net->rtnl = NULL; |
diff --git a/net/core/sock.c b/net/core/sock.c index 10b1d3243a72..ceef50bd131b 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2140,13 +2140,13 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot) | |||
2140 | } | 2140 | } |
2141 | EXPORT_SYMBOL_GPL(sock_prot_inuse_get); | 2141 | EXPORT_SYMBOL_GPL(sock_prot_inuse_get); |
2142 | 2142 | ||
2143 | static int sock_inuse_init_net(struct net *net) | 2143 | static int __net_init sock_inuse_init_net(struct net *net) |
2144 | { | 2144 | { |
2145 | net->core.inuse = alloc_percpu(struct prot_inuse); | 2145 | net->core.inuse = alloc_percpu(struct prot_inuse); |
2146 | return net->core.inuse ? 0 : -ENOMEM; | 2146 | return net->core.inuse ? 0 : -ENOMEM; |
2147 | } | 2147 | } |
2148 | 2148 | ||
2149 | static void sock_inuse_exit_net(struct net *net) | 2149 | static void __net_exit sock_inuse_exit_net(struct net *net) |
2150 | { | 2150 | { |
2151 | free_percpu(net->core.inuse); | 2151 | free_percpu(net->core.inuse); |
2152 | } | 2152 | } |