aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bonding/bond_main.c12
-rw-r--r--net/8021q/vlan.c4
-rw-r--r--net/8021q/vlanproc.c2
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/core/fib_rules.c2
-rw-r--r--net/core/rtnetlink.c4
-rw-r--r--net/core/sock.c4
-rw-r--r--net/dccp/ipv4.c4
-rw-r--r--net/dccp/ipv6.c4
-rw-r--r--net/ipv4/fib_frontend.c4
-rw-r--r--net/ipv4/igmp.c4
-rw-r--r--net/ipv4/ip_fragment.c8
-rw-r--r--net/ipv4/ip_gre.c4
-rw-r--r--net/ipv4/ipip.c7
-rw-r--r--net/ipv4/tcp_ipv4.c4
-rw-r--r--net/ipv4/udp.c4
-rw-r--r--net/ipv4/udplite.c4
-rw-r--r--net/ipv6/addrconf.c8
-rw-r--r--net/ipv6/af_inet6.c4
-rw-r--r--net/ipv6/anycast.c2
-rw-r--r--net/ipv6/fib6_rules.c4
-rw-r--r--net/ipv6/icmp.c2
-rw-r--r--net/ipv6/ip6_fib.c6
-rw-r--r--net/ipv6/ip6_flowlabel.c9
-rw-r--r--net/ipv6/ip6_tunnel.c9
-rw-r--r--net/ipv6/mcast.c13
-rw-r--r--net/ipv6/ndisc.c4
-rw-r--r--net/ipv6/proc.c4
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/reassembly.c8
-rw-r--r--net/ipv6/route.c6
-rw-r--r--net/ipv6/sit.c9
-rw-r--r--net/ipv6/sysctl_net_ipv6.c4
-rw-r--r--net/ipv6/tcp_ipv6.c8
-rw-r--r--net/ipv6/udp.c2
-rw-r--r--net/ipv6/udplite.c4
-rw-r--r--net/key/af_key.c6
-rw-r--r--net/packet/af_packet.c4
-rw-r--r--net/phonet/pn_dev.c4
-rw-r--r--net/sysctl_net.c4
-rw-r--r--net/unix/af_unix.c4
-rw-r--r--net/unix/sysctl_net_unix.c2
-rw-r--r--net/wireless/wext-proc.c4
-rw-r--r--net/xfrm/xfrm_sysctl.c4
44 files changed, 107 insertions, 112 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6a42a1453afa..99a0ff3889ee 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3307,7 +3307,7 @@ static void bond_remove_proc_entry(struct bonding *bond)
3307/* Create the bonding directory under /proc/net, if doesn't exist yet. 3307/* Create the bonding directory under /proc/net, if doesn't exist yet.
3308 * Caller must hold rtnl_lock. 3308 * Caller must hold rtnl_lock.
3309 */ 3309 */
3310static void bond_create_proc_dir(struct bond_net *bn) 3310static void __net_init bond_create_proc_dir(struct bond_net *bn)
3311{ 3311{
3312 if (!bn->proc_dir) { 3312 if (!bn->proc_dir) {
3313 bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net); 3313 bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
@@ -3320,7 +3320,7 @@ static void bond_create_proc_dir(struct bond_net *bn)
3320/* Destroy the bonding directory under /proc/net, if empty. 3320/* Destroy the bonding directory under /proc/net, if empty.
3321 * Caller must hold rtnl_lock. 3321 * Caller must hold rtnl_lock.
3322 */ 3322 */
3323static void bond_destroy_proc_dir(struct bond_net *bn) 3323static void __net_exit bond_destroy_proc_dir(struct bond_net *bn)
3324{ 3324{
3325 if (bn->proc_dir) { 3325 if (bn->proc_dir) {
3326 remove_proc_entry(DRV_NAME, bn->net->proc_net); 3326 remove_proc_entry(DRV_NAME, bn->net->proc_net);
@@ -3338,11 +3338,11 @@ static void bond_remove_proc_entry(struct bonding *bond)
3338{ 3338{
3339} 3339}
3340 3340
3341static void bond_create_proc_dir(struct bond_net *bn) 3341static inline void bond_create_proc_dir(struct bond_net *bn)
3342{ 3342{
3343} 3343}
3344 3344
3345static void bond_destroy_proc_dir(struct bond_net *bn) 3345static inline void bond_destroy_proc_dir(struct bond_net *bn)
3346{ 3346{
3347} 3347}
3348 3348
@@ -4955,7 +4955,7 @@ out_netdev:
4955 goto out; 4955 goto out;
4956} 4956}
4957 4957
4958static int bond_net_init(struct net *net) 4958static int __net_init bond_net_init(struct net *net)
4959{ 4959{
4960 struct bond_net *bn = net_generic(net, bond_net_id); 4960 struct bond_net *bn = net_generic(net, bond_net_id);
4961 4961
@@ -4967,7 +4967,7 @@ static int bond_net_init(struct net *net)
4967 return 0; 4967 return 0;
4968} 4968}
4969 4969
4970static void bond_net_exit(struct net *net) 4970static void __net_exit bond_net_exit(struct net *net)
4971{ 4971{
4972 struct bond_net *bn = net_generic(net, bond_net_id); 4972 struct bond_net *bn = net_generic(net, bond_net_id);
4973 4973
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 33f90e7362cc..453512266ea1 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -663,7 +663,7 @@ out:
663 return err; 663 return err;
664} 664}
665 665
666static int vlan_init_net(struct net *net) 666static int __net_init vlan_init_net(struct net *net)
667{ 667{
668 struct vlan_net *vn = net_generic(net, vlan_net_id); 668 struct vlan_net *vn = net_generic(net, vlan_net_id);
669 int err; 669 int err;
@@ -675,7 +675,7 @@ static int vlan_init_net(struct net *net)
675 return err; 675 return err;
676} 676}
677 677
678static void vlan_exit_net(struct net *net) 678static void __net_exit vlan_exit_net(struct net *net)
679{ 679{
680 vlan_proc_cleanup(net); 680 vlan_proc_cleanup(net);
681} 681}
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 9ec1f057c03a..afead353e215 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -140,7 +140,7 @@ void vlan_proc_cleanup(struct net *net)
140 * Create /proc/net/vlan entries 140 * Create /proc/net/vlan entries
141 */ 141 */
142 142
143int vlan_proc_init(struct net *net) 143int __net_init vlan_proc_init(struct net *net)
144{ 144{
145 struct vlan_net *vn = net_generic(net, vlan_net_id); 145 struct vlan_net *vn = net_generic(net, vlan_net_id);
146 146
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index a2cbe61f6e65..7bc0604069c7 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -467,7 +467,7 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
467 return 0; 467 return 0;
468} 468}
469 469
470void br_net_exit(struct net *net) 470void __net_exit br_net_exit(struct net *net)
471{ 471{
472 struct net_device *dev; 472 struct net_device *dev;
473 LIST_HEAD(list); 473 LIST_HEAD(list);
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
711static int fib_rules_net_init(struct net *net) 711static 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
1389static int rtnetlink_net_init(struct net *net) 1389static 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
1400static void rtnetlink_net_exit(struct net *net) 1400static 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}
2141EXPORT_SYMBOL_GPL(sock_prot_inuse_get); 2141EXPORT_SYMBOL_GPL(sock_prot_inuse_get);
2142 2142
2143static int sock_inuse_init_net(struct net *net) 2143static 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
2149static void sock_inuse_exit_net(struct net *net) 2149static 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}
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index dad7bc4878e0..b195c4feaa0a 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -996,7 +996,7 @@ static struct inet_protosw dccp_v4_protosw = {
996 .flags = INET_PROTOSW_ICSK, 996 .flags = INET_PROTOSW_ICSK,
997}; 997};
998 998
999static int dccp_v4_init_net(struct net *net) 999static int __net_init dccp_v4_init_net(struct net *net)
1000{ 1000{
1001 int err; 1001 int err;
1002 1002
@@ -1005,7 +1005,7 @@ static int dccp_v4_init_net(struct net *net)
1005 return err; 1005 return err;
1006} 1006}
1007 1007
1008static void dccp_v4_exit_net(struct net *net) 1008static void __net_exit dccp_v4_exit_net(struct net *net)
1009{ 1009{
1010 inet_ctl_sock_destroy(net->dccp.v4_ctl_sk); 1010 inet_ctl_sock_destroy(net->dccp.v4_ctl_sk);
1011} 1011}
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index baf05cf43c28..1aec6349e858 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1189,7 +1189,7 @@ static struct inet_protosw dccp_v6_protosw = {
1189 .flags = INET_PROTOSW_ICSK, 1189 .flags = INET_PROTOSW_ICSK,
1190}; 1190};
1191 1191
1192static int dccp_v6_init_net(struct net *net) 1192static int __net_init dccp_v6_init_net(struct net *net)
1193{ 1193{
1194 int err; 1194 int err;
1195 1195
@@ -1198,7 +1198,7 @@ static int dccp_v6_init_net(struct net *net)
1198 return err; 1198 return err;
1199} 1199}
1200 1200
1201static void dccp_v6_exit_net(struct net *net) 1201static void __net_exit dccp_v6_exit_net(struct net *net)
1202{ 1202{
1203 inet_ctl_sock_destroy(net->dccp.v6_ctl_sk); 1203 inet_ctl_sock_destroy(net->dccp.v6_ctl_sk);
1204} 1204}
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 82dbf711d6d0..9b3e28ed5240 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -883,7 +883,7 @@ static void nl_fib_input(struct sk_buff *skb)
883 netlink_unicast(net->ipv4.fibnl, skb, pid, MSG_DONTWAIT); 883 netlink_unicast(net->ipv4.fibnl, skb, pid, MSG_DONTWAIT);
884} 884}
885 885
886static int nl_fib_lookup_init(struct net *net) 886static int __net_init nl_fib_lookup_init(struct net *net)
887{ 887{
888 struct sock *sk; 888 struct sock *sk;
889 sk = netlink_kernel_create(net, NETLINK_FIB_LOOKUP, 0, 889 sk = netlink_kernel_create(net, NETLINK_FIB_LOOKUP, 0,
@@ -1004,7 +1004,7 @@ fail:
1004 return err; 1004 return err;
1005} 1005}
1006 1006
1007static void __net_exit ip_fib_net_exit(struct net *net) 1007static void ip_fib_net_exit(struct net *net)
1008{ 1008{
1009 unsigned int i; 1009 unsigned int i;
1010 1010
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 76c08402c933..8f5468393f01 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2603,7 +2603,7 @@ static const struct file_operations igmp_mcf_seq_fops = {
2603 .release = seq_release_net, 2603 .release = seq_release_net,
2604}; 2604};
2605 2605
2606static int igmp_net_init(struct net *net) 2606static int __net_init igmp_net_init(struct net *net)
2607{ 2607{
2608 struct proc_dir_entry *pde; 2608 struct proc_dir_entry *pde;
2609 2609
@@ -2621,7 +2621,7 @@ out_igmp:
2621 return -ENOMEM; 2621 return -ENOMEM;
2622} 2622}
2623 2623
2624static void igmp_net_exit(struct net *net) 2624static void __net_exit igmp_net_exit(struct net *net)
2625{ 2625{
2626 proc_net_remove(net, "mcfilter"); 2626 proc_net_remove(net, "mcfilter");
2627 proc_net_remove(net, "igmp"); 2627 proc_net_remove(net, "igmp");
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 86964b353c31..891c72aea520 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -646,7 +646,7 @@ static struct ctl_table ip4_frags_ctl_table[] = {
646 { } 646 { }
647}; 647};
648 648
649static int ip4_frags_ns_ctl_register(struct net *net) 649static int __net_init ip4_frags_ns_ctl_register(struct net *net)
650{ 650{
651 struct ctl_table *table; 651 struct ctl_table *table;
652 struct ctl_table_header *hdr; 652 struct ctl_table_header *hdr;
@@ -676,7 +676,7 @@ err_alloc:
676 return -ENOMEM; 676 return -ENOMEM;
677} 677}
678 678
679static void ip4_frags_ns_ctl_unregister(struct net *net) 679static void __net_exit ip4_frags_ns_ctl_unregister(struct net *net)
680{ 680{
681 struct ctl_table *table; 681 struct ctl_table *table;
682 682
@@ -704,7 +704,7 @@ static inline void ip4_frags_ctl_register(void)
704} 704}
705#endif 705#endif
706 706
707static int ipv4_frags_init_net(struct net *net) 707static int __net_init ipv4_frags_init_net(struct net *net)
708{ 708{
709 /* 709 /*
710 * Fragment cache limits. We will commit 256K at one time. Should we 710 * Fragment cache limits. We will commit 256K at one time. Should we
@@ -726,7 +726,7 @@ static int ipv4_frags_init_net(struct net *net)
726 return ip4_frags_ns_ctl_register(net); 726 return ip4_frags_ns_ctl_register(net);
727} 727}
728 728
729static void ipv4_frags_exit_net(struct net *net) 729static void __net_exit ipv4_frags_exit_net(struct net *net)
730{ 730{
731 ip4_frags_ns_ctl_unregister(net); 731 ip4_frags_ns_ctl_unregister(net);
732 inet_frags_exit_net(&net->ipv4.frags, &ip4_frags); 732 inet_frags_exit_net(&net->ipv4.frags, &ip4_frags);
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f36ce156cac6..7631b20490f5 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1307,7 +1307,7 @@ static void ipgre_destroy_tunnels(struct ipgre_net *ign, struct list_head *head)
1307 } 1307 }
1308} 1308}
1309 1309
1310static int ipgre_init_net(struct net *net) 1310static int __net_init ipgre_init_net(struct net *net)
1311{ 1311{
1312 struct ipgre_net *ign = net_generic(net, ipgre_net_id); 1312 struct ipgre_net *ign = net_generic(net, ipgre_net_id);
1313 int err; 1313 int err;
@@ -1334,7 +1334,7 @@ err_alloc_dev:
1334 return err; 1334 return err;
1335} 1335}
1336 1336
1337static void ipgre_exit_net(struct net *net) 1337static void __net_exit ipgre_exit_net(struct net *net)
1338{ 1338{
1339 struct ipgre_net *ign; 1339 struct ipgre_net *ign;
1340 LIST_HEAD(list); 1340 LIST_HEAD(list);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index eda04fed3379..95db732e542b 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -130,7 +130,6 @@ struct ipip_net {
130 struct net_device *fb_tunnel_dev; 130 struct net_device *fb_tunnel_dev;
131}; 131};
132 132
133static void ipip_fb_tunnel_init(struct net_device *dev);
134static void ipip_tunnel_init(struct net_device *dev); 133static void ipip_tunnel_init(struct net_device *dev);
135static void ipip_tunnel_setup(struct net_device *dev); 134static void ipip_tunnel_setup(struct net_device *dev);
136 135
@@ -730,7 +729,7 @@ static void ipip_tunnel_init(struct net_device *dev)
730 ipip_tunnel_bind_dev(dev); 729 ipip_tunnel_bind_dev(dev);
731} 730}
732 731
733static void ipip_fb_tunnel_init(struct net_device *dev) 732static void __net_init ipip_fb_tunnel_init(struct net_device *dev)
734{ 733{
735 struct ip_tunnel *tunnel = netdev_priv(dev); 734 struct ip_tunnel *tunnel = netdev_priv(dev);
736 struct iphdr *iph = &tunnel->parms.iph; 735 struct iphdr *iph = &tunnel->parms.iph;
@@ -773,7 +772,7 @@ static void ipip_destroy_tunnels(struct ipip_net *ipn, struct list_head *head)
773 } 772 }
774} 773}
775 774
776static int ipip_init_net(struct net *net) 775static int __net_init ipip_init_net(struct net *net)
777{ 776{
778 struct ipip_net *ipn = net_generic(net, ipip_net_id); 777 struct ipip_net *ipn = net_generic(net, ipip_net_id);
779 int err; 778 int err;
@@ -806,7 +805,7 @@ err_alloc_dev:
806 return err; 805 return err;
807} 806}
808 807
809static void ipip_exit_net(struct net *net) 808static void __net_exit ipip_exit_net(struct net *net)
810{ 809{
811 struct ipip_net *ipn = net_generic(net, ipip_net_id); 810 struct ipip_net *ipn = net_generic(net, ipip_net_id);
812 LIST_HEAD(list); 811 LIST_HEAD(list);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 356f544c4c10..c3588b4fd979 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2430,12 +2430,12 @@ static struct tcp_seq_afinfo tcp4_seq_afinfo = {
2430 }, 2430 },
2431}; 2431};
2432 2432
2433static int tcp4_proc_init_net(struct net *net) 2433static int __net_init tcp4_proc_init_net(struct net *net)
2434{ 2434{
2435 return tcp_proc_register(net, &tcp4_seq_afinfo); 2435 return tcp_proc_register(net, &tcp4_seq_afinfo);
2436} 2436}
2437 2437
2438static void tcp4_proc_exit_net(struct net *net) 2438static void __net_exit tcp4_proc_exit_net(struct net *net)
2439{ 2439{
2440 tcp_proc_unregister(net, &tcp4_seq_afinfo); 2440 tcp_proc_unregister(net, &tcp4_seq_afinfo);
2441} 2441}
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f0126fdd7e04..4f7d2122d818 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2027,12 +2027,12 @@ static struct udp_seq_afinfo udp4_seq_afinfo = {
2027 }, 2027 },
2028}; 2028};
2029 2029
2030static int udp4_proc_init_net(struct net *net) 2030static int __net_init udp4_proc_init_net(struct net *net)
2031{ 2031{
2032 return udp_proc_register(net, &udp4_seq_afinfo); 2032 return udp_proc_register(net, &udp4_seq_afinfo);
2033} 2033}
2034 2034
2035static void udp4_proc_exit_net(struct net *net) 2035static void __net_exit udp4_proc_exit_net(struct net *net)
2036{ 2036{
2037 udp_proc_unregister(net, &udp4_seq_afinfo); 2037 udp_proc_unregister(net, &udp4_seq_afinfo);
2038} 2038}
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 66f79513f4a5..6610bf76369f 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -81,12 +81,12 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = {
81 }, 81 },
82}; 82};
83 83
84static int udplite4_proc_init_net(struct net *net) 84static int __net_init udplite4_proc_init_net(struct net *net)
85{ 85{
86 return udp_proc_register(net, &udplite4_seq_afinfo); 86 return udp_proc_register(net, &udplite4_seq_afinfo);
87} 87}
88 88
89static void udplite4_proc_exit_net(struct net *net) 89static void __net_exit udplite4_proc_exit_net(struct net *net)
90{ 90{
91 udp_proc_unregister(net, &udplite4_seq_afinfo); 91 udp_proc_unregister(net, &udplite4_seq_afinfo);
92} 92}
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index de7a194a64ab..1593289155ff 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3027,14 +3027,14 @@ static const struct file_operations if6_fops = {
3027 .release = seq_release_net, 3027 .release = seq_release_net,
3028}; 3028};
3029 3029
3030static int if6_proc_net_init(struct net *net) 3030static int __net_init if6_proc_net_init(struct net *net)
3031{ 3031{
3032 if (!proc_net_fops_create(net, "if_inet6", S_IRUGO, &if6_fops)) 3032 if (!proc_net_fops_create(net, "if_inet6", S_IRUGO, &if6_fops))
3033 return -ENOMEM; 3033 return -ENOMEM;
3034 return 0; 3034 return 0;
3035} 3035}
3036 3036
3037static void if6_proc_net_exit(struct net *net) 3037static void __net_exit if6_proc_net_exit(struct net *net)
3038{ 3038{
3039 proc_net_remove(net, "if_inet6"); 3039 proc_net_remove(net, "if_inet6");
3040} 3040}
@@ -4418,7 +4418,7 @@ static void addrconf_sysctl_unregister(struct inet6_dev *idev)
4418 4418
4419#endif 4419#endif
4420 4420
4421static int addrconf_init_net(struct net *net) 4421static int __net_init addrconf_init_net(struct net *net)
4422{ 4422{
4423 int err; 4423 int err;
4424 struct ipv6_devconf *all, *dflt; 4424 struct ipv6_devconf *all, *dflt;
@@ -4467,7 +4467,7 @@ err_alloc_all:
4467 return err; 4467 return err;
4468} 4468}
4469 4469
4470static void addrconf_exit_net(struct net *net) 4470static void __net_exit addrconf_exit_net(struct net *net)
4471{ 4471{
4472#ifdef CONFIG_SYSCTL 4472#ifdef CONFIG_SYSCTL
4473 __addrconf_sysctl_unregister(net->ipv6.devconf_dflt); 4473 __addrconf_sysctl_unregister(net->ipv6.devconf_dflt);
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 12e69d364dd5..e29160ff4a0f 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -999,7 +999,7 @@ err_udplite_mib:
999 return -ENOMEM; 999 return -ENOMEM;
1000} 1000}
1001 1001
1002static void __net_exit ipv6_cleanup_mibs(struct net *net) 1002static void ipv6_cleanup_mibs(struct net *net)
1003{ 1003{
1004 snmp_mib_free((void **)net->mib.udp_stats_in6); 1004 snmp_mib_free((void **)net->mib.udp_stats_in6);
1005 snmp_mib_free((void **)net->mib.udplite_stats_in6); 1005 snmp_mib_free((void **)net->mib.udplite_stats_in6);
@@ -1042,7 +1042,7 @@ out:
1042#endif 1042#endif
1043} 1043}
1044 1044
1045static void inet6_net_exit(struct net *net) 1045static void __net_exit inet6_net_exit(struct net *net)
1046{ 1046{
1047#ifdef CONFIG_PROC_FS 1047#ifdef CONFIG_PROC_FS
1048 udp6_proc_exit(net); 1048 udp6_proc_exit(net);
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index f1c74c8ef9de..c4f6ca32fa74 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -538,7 +538,7 @@ static const struct file_operations ac6_seq_fops = {
538 .release = seq_release_net, 538 .release = seq_release_net,
539}; 539};
540 540
541int ac6_proc_init(struct net *net) 541int __net_init ac6_proc_init(struct net *net)
542{ 542{
543 if (!proc_net_fops_create(net, "anycast6", S_IRUGO, &ac6_seq_fops)) 543 if (!proc_net_fops_create(net, "anycast6", S_IRUGO, &ac6_seq_fops))
544 return -ENOMEM; 544 return -ENOMEM;
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index b7aa7c64cc4a..551882b9dfd6 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -262,7 +262,7 @@ static struct fib_rules_ops fib6_rules_ops_template = {
262 .fro_net = &init_net, 262 .fro_net = &init_net,
263}; 263};
264 264
265static int fib6_rules_net_init(struct net *net) 265static int __net_init fib6_rules_net_init(struct net *net)
266{ 266{
267 struct fib_rules_ops *ops; 267 struct fib_rules_ops *ops;
268 int err = -ENOMEM; 268 int err = -ENOMEM;
@@ -291,7 +291,7 @@ out_fib6_rules_ops:
291 goto out; 291 goto out;
292} 292}
293 293
294static void fib6_rules_net_exit(struct net *net) 294static void __net_exit fib6_rules_net_exit(struct net *net)
295{ 295{
296 fib_rules_unregister(net->ipv6.fib6_rules_ops); 296 fib_rules_unregister(net->ipv6.fib6_rules_ops);
297} 297}
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 4ae661bc3677..217dbc2e28d4 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -951,7 +951,7 @@ ctl_table ipv6_icmp_table_template[] = {
951 { }, 951 { },
952}; 952};
953 953
954struct ctl_table *ipv6_icmp_sysctl_init(struct net *net) 954struct ctl_table * __net_init ipv6_icmp_sysctl_init(struct net *net)
955{ 955{
956 struct ctl_table *table; 956 struct ctl_table *table;
957 957
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 0e93ca56eb69..f626ea2b304f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -239,7 +239,7 @@ struct fib6_table *fib6_get_table(struct net *net, u32 id)
239 return NULL; 239 return NULL;
240} 240}
241 241
242static void fib6_tables_init(struct net *net) 242static void __net_init fib6_tables_init(struct net *net)
243{ 243{
244 fib6_link_table(net, net->ipv6.fib6_main_tbl); 244 fib6_link_table(net, net->ipv6.fib6_main_tbl);
245 fib6_link_table(net, net->ipv6.fib6_local_tbl); 245 fib6_link_table(net, net->ipv6.fib6_local_tbl);
@@ -262,7 +262,7 @@ struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi *fl,
262 return (struct dst_entry *) lookup(net, net->ipv6.fib6_main_tbl, fl, flags); 262 return (struct dst_entry *) lookup(net, net->ipv6.fib6_main_tbl, fl, flags);
263} 263}
264 264
265static void fib6_tables_init(struct net *net) 265static void __net_init fib6_tables_init(struct net *net)
266{ 266{
267 fib6_link_table(net, net->ipv6.fib6_main_tbl); 267 fib6_link_table(net, net->ipv6.fib6_main_tbl);
268} 268}
@@ -1469,7 +1469,7 @@ static void fib6_gc_timer_cb(unsigned long arg)
1469 fib6_run_gc(0, (struct net *)arg); 1469 fib6_run_gc(0, (struct net *)arg);
1470} 1470}
1471 1471
1472static int fib6_net_init(struct net *net) 1472static int __net_init fib6_net_init(struct net *net)
1473{ 1473{
1474 setup_timer(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, (unsigned long)net); 1474 setup_timer(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, (unsigned long)net);
1475 1475
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 6e7bffa2205e..e41eba8aacf1 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -154,7 +154,7 @@ static void ip6_fl_gc(unsigned long dummy)
154 write_unlock(&ip6_fl_lock); 154 write_unlock(&ip6_fl_lock);
155} 155}
156 156
157static void ip6_fl_purge(struct net *net) 157static void __net_exit ip6_fl_purge(struct net *net)
158{ 158{
159 int i; 159 int i;
160 160
@@ -735,7 +735,7 @@ static const struct file_operations ip6fl_seq_fops = {
735 .release = seq_release_net, 735 .release = seq_release_net,
736}; 736};
737 737
738static int ip6_flowlabel_proc_init(struct net *net) 738static int __net_init ip6_flowlabel_proc_init(struct net *net)
739{ 739{
740 if (!proc_net_fops_create(net, "ip6_flowlabel", 740 if (!proc_net_fops_create(net, "ip6_flowlabel",
741 S_IRUGO, &ip6fl_seq_fops)) 741 S_IRUGO, &ip6fl_seq_fops))
@@ -743,7 +743,7 @@ static int ip6_flowlabel_proc_init(struct net *net)
743 return 0; 743 return 0;
744} 744}
745 745
746static void ip6_flowlabel_proc_fini(struct net *net) 746static void __net_exit ip6_flowlabel_proc_fini(struct net *net)
747{ 747{
748 proc_net_remove(net, "ip6_flowlabel"); 748 proc_net_remove(net, "ip6_flowlabel");
749} 749}
@@ -754,11 +754,10 @@ static inline int ip6_flowlabel_proc_init(struct net *net)
754} 754}
755static inline void ip6_flowlabel_proc_fini(struct net *net) 755static inline void ip6_flowlabel_proc_fini(struct net *net)
756{ 756{
757 return ;
758} 757}
759#endif 758#endif
760 759
761static inline void ip6_flowlabel_net_exit(struct net *net) 760static void __net_exit ip6_flowlabel_net_exit(struct net *net)
762{ 761{
763 ip6_fl_purge(net); 762 ip6_fl_purge(net);
764 ip6_flowlabel_proc_fini(net); 763 ip6_flowlabel_proc_fini(net);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index d453d07b0dfe..fbd786981aa9 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -74,7 +74,6 @@ MODULE_LICENSE("GPL");
74 (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \ 74 (addr)->s6_addr32[2] ^ (addr)->s6_addr32[3]) & \
75 (HASH_SIZE - 1)) 75 (HASH_SIZE - 1))
76 76
77static void ip6_fb_tnl_dev_init(struct net_device *dev);
78static void ip6_tnl_dev_init(struct net_device *dev); 77static void ip6_tnl_dev_init(struct net_device *dev);
79static void ip6_tnl_dev_setup(struct net_device *dev); 78static void ip6_tnl_dev_setup(struct net_device *dev);
80 79
@@ -1364,7 +1363,7 @@ static void ip6_tnl_dev_init(struct net_device *dev)
1364 * Return: 0 1363 * Return: 0
1365 **/ 1364 **/
1366 1365
1367static void ip6_fb_tnl_dev_init(struct net_device *dev) 1366static void __net_init ip6_fb_tnl_dev_init(struct net_device *dev)
1368{ 1367{
1369 struct ip6_tnl *t = netdev_priv(dev); 1368 struct ip6_tnl *t = netdev_priv(dev);
1370 struct net *net = dev_net(dev); 1369 struct net *net = dev_net(dev);
@@ -1388,7 +1387,7 @@ static struct xfrm6_tunnel ip6ip6_handler = {
1388 .priority = 1, 1387 .priority = 1,
1389}; 1388};
1390 1389
1391static void ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n) 1390static void __net_exit ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n)
1392{ 1391{
1393 int h; 1392 int h;
1394 struct ip6_tnl *t; 1393 struct ip6_tnl *t;
@@ -1407,7 +1406,7 @@ static void ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n)
1407 unregister_netdevice_many(&list); 1406 unregister_netdevice_many(&list);
1408} 1407}
1409 1408
1410static int ip6_tnl_init_net(struct net *net) 1409static int __net_init ip6_tnl_init_net(struct net *net)
1411{ 1410{
1412 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); 1411 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1413 int err; 1412 int err;
@@ -1436,7 +1435,7 @@ err_alloc_dev:
1436 return err; 1435 return err;
1437} 1436}
1438 1437
1439static void ip6_tnl_exit_net(struct net *net) 1438static void __net_exit ip6_tnl_exit_net(struct net *net)
1440{ 1439{
1441 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); 1440 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1442 1441
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 1f9c44442e65..25f6cca79e6b 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2646,7 +2646,7 @@ static const struct file_operations igmp6_mcf_seq_fops = {
2646 .release = seq_release_net, 2646 .release = seq_release_net,
2647}; 2647};
2648 2648
2649static int igmp6_proc_init(struct net *net) 2649static int __net_init igmp6_proc_init(struct net *net)
2650{ 2650{
2651 int err; 2651 int err;
2652 2652
@@ -2666,23 +2666,22 @@ out_proc_net_igmp6:
2666 goto out; 2666 goto out;
2667} 2667}
2668 2668
2669static void igmp6_proc_exit(struct net *net) 2669static void __net_exit igmp6_proc_exit(struct net *net)
2670{ 2670{
2671 proc_net_remove(net, "mcfilter6"); 2671 proc_net_remove(net, "mcfilter6");
2672 proc_net_remove(net, "igmp6"); 2672 proc_net_remove(net, "igmp6");
2673} 2673}
2674#else 2674#else
2675static int igmp6_proc_init(struct net *net) 2675static inline int igmp6_proc_init(struct net *net)
2676{ 2676{
2677 return 0; 2677 return 0;
2678} 2678}
2679static void igmp6_proc_exit(struct net *net) 2679static inline void igmp6_proc_exit(struct net *net)
2680{ 2680{
2681 ;
2682} 2681}
2683#endif 2682#endif
2684 2683
2685static int igmp6_net_init(struct net *net) 2684static int __net_init igmp6_net_init(struct net *net)
2686{ 2685{
2687 int err; 2686 int err;
2688 2687
@@ -2708,7 +2707,7 @@ out_sock_create:
2708 goto out; 2707 goto out;
2709} 2708}
2710 2709
2711static void igmp6_net_exit(struct net *net) 2710static void __net_exit igmp6_net_exit(struct net *net)
2712{ 2711{
2713 inet_ctl_sock_destroy(net->ipv6.igmp_sk); 2712 inet_ctl_sock_destroy(net->ipv6.igmp_sk);
2714 igmp6_proc_exit(net); 2713 igmp6_proc_exit(net);
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index c45852798092..2dfec6bb8ada 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1772,7 +1772,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu
1772 1772
1773#endif 1773#endif
1774 1774
1775static int ndisc_net_init(struct net *net) 1775static int __net_init ndisc_net_init(struct net *net)
1776{ 1776{
1777 struct ipv6_pinfo *np; 1777 struct ipv6_pinfo *np;
1778 struct sock *sk; 1778 struct sock *sk;
@@ -1797,7 +1797,7 @@ static int ndisc_net_init(struct net *net)
1797 return 0; 1797 return 0;
1798} 1798}
1799 1799
1800static void ndisc_net_exit(struct net *net) 1800static void __net_exit ndisc_net_exit(struct net *net)
1801{ 1801{
1802 inet_ctl_sock_destroy(net->ipv6.ndisc_sk); 1802 inet_ctl_sock_destroy(net->ipv6.ndisc_sk);
1803} 1803}
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 7b197b7132e0..02f20016b4c9 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -267,7 +267,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
267 return 0; 267 return 0;
268} 268}
269 269
270static int ipv6_proc_init_net(struct net *net) 270static int __net_init ipv6_proc_init_net(struct net *net)
271{ 271{
272 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO, 272 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO,
273 &sockstat6_seq_fops)) 273 &sockstat6_seq_fops))
@@ -288,7 +288,7 @@ proc_dev_snmp6_fail:
288 return -ENOMEM; 288 return -ENOMEM;
289} 289}
290 290
291static void ipv6_proc_exit_net(struct net *net) 291static void __net_exit ipv6_proc_exit_net(struct net *net)
292{ 292{
293 proc_net_remove(net, "sockstat6"); 293 proc_net_remove(net, "sockstat6");
294 proc_net_remove(net, "dev_snmp6"); 294 proc_net_remove(net, "dev_snmp6");
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 926ce8eeffaf..ed31c37c6e39 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1275,7 +1275,7 @@ static const struct file_operations raw6_seq_fops = {
1275 .release = seq_release_net, 1275 .release = seq_release_net,
1276}; 1276};
1277 1277
1278static int raw6_init_net(struct net *net) 1278static int __net_init raw6_init_net(struct net *net)
1279{ 1279{
1280 if (!proc_net_fops_create(net, "raw6", S_IRUGO, &raw6_seq_fops)) 1280 if (!proc_net_fops_create(net, "raw6", S_IRUGO, &raw6_seq_fops))
1281 return -ENOMEM; 1281 return -ENOMEM;
@@ -1283,7 +1283,7 @@ static int raw6_init_net(struct net *net)
1283 return 0; 1283 return 0;
1284} 1284}
1285 1285
1286static void raw6_exit_net(struct net *net) 1286static void __net_exit raw6_exit_net(struct net *net)
1287{ 1287{
1288 proc_net_remove(net, "raw6"); 1288 proc_net_remove(net, "raw6");
1289} 1289}
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2cddea3bd6be..fa38fc7cc6e9 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -672,7 +672,7 @@ static struct ctl_table ip6_frags_ctl_table[] = {
672 { } 672 { }
673}; 673};
674 674
675static int ip6_frags_ns_sysctl_register(struct net *net) 675static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
676{ 676{
677 struct ctl_table *table; 677 struct ctl_table *table;
678 struct ctl_table_header *hdr; 678 struct ctl_table_header *hdr;
@@ -702,7 +702,7 @@ err_alloc:
702 return -ENOMEM; 702 return -ENOMEM;
703} 703}
704 704
705static void ip6_frags_ns_sysctl_unregister(struct net *net) 705static void __net_exit ip6_frags_ns_sysctl_unregister(struct net *net)
706{ 706{
707 struct ctl_table *table; 707 struct ctl_table *table;
708 708
@@ -745,7 +745,7 @@ static inline void ip6_frags_sysctl_unregister(void)
745} 745}
746#endif 746#endif
747 747
748static int ipv6_frags_init_net(struct net *net) 748static int __net_init ipv6_frags_init_net(struct net *net)
749{ 749{
750 net->ipv6.frags.high_thresh = 256 * 1024; 750 net->ipv6.frags.high_thresh = 256 * 1024;
751 net->ipv6.frags.low_thresh = 192 * 1024; 751 net->ipv6.frags.low_thresh = 192 * 1024;
@@ -756,7 +756,7 @@ static int ipv6_frags_init_net(struct net *net)
756 return ip6_frags_ns_sysctl_register(net); 756 return ip6_frags_ns_sysctl_register(net);
757} 757}
758 758
759static void ipv6_frags_exit_net(struct net *net) 759static void __net_exit ipv6_frags_exit_net(struct net *net)
760{ 760{
761 ip6_frags_ns_sysctl_unregister(net); 761 ip6_frags_ns_sysctl_unregister(net);
762 inet_frags_exit_net(&net->ipv6.frags, &ip6_frags); 762 inet_frags_exit_net(&net->ipv6.frags, &ip6_frags);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c2bd74c5f8d9..8500156f2637 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2612,7 +2612,7 @@ ctl_table ipv6_route_table_template[] = {
2612 { } 2612 { }
2613}; 2613};
2614 2614
2615struct ctl_table *ipv6_route_sysctl_init(struct net *net) 2615struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
2616{ 2616{
2617 struct ctl_table *table; 2617 struct ctl_table *table;
2618 2618
@@ -2637,7 +2637,7 @@ struct ctl_table *ipv6_route_sysctl_init(struct net *net)
2637} 2637}
2638#endif 2638#endif
2639 2639
2640static int ip6_route_net_init(struct net *net) 2640static int __net_init ip6_route_net_init(struct net *net)
2641{ 2641{
2642 int ret = -ENOMEM; 2642 int ret = -ENOMEM;
2643 2643
@@ -2702,7 +2702,7 @@ out_ip6_dst_ops:
2702 goto out; 2702 goto out;
2703} 2703}
2704 2704
2705static void ip6_route_net_exit(struct net *net) 2705static void __net_exit ip6_route_net_exit(struct net *net)
2706{ 2706{
2707#ifdef CONFIG_PROC_FS 2707#ifdef CONFIG_PROC_FS
2708 proc_net_remove(net, "ipv6_route"); 2708 proc_net_remove(net, "ipv6_route");
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 976e68244b99..10207cc8cc0e 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -62,7 +62,6 @@
62#define HASH_SIZE 16 62#define HASH_SIZE 16
63#define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF) 63#define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF)
64 64
65static void ipip6_fb_tunnel_init(struct net_device *dev);
66static void ipip6_tunnel_init(struct net_device *dev); 65static void ipip6_tunnel_init(struct net_device *dev);
67static void ipip6_tunnel_setup(struct net_device *dev); 66static void ipip6_tunnel_setup(struct net_device *dev);
68 67
@@ -1120,7 +1119,7 @@ static void ipip6_tunnel_init(struct net_device *dev)
1120 ipip6_tunnel_bind_dev(dev); 1119 ipip6_tunnel_bind_dev(dev);
1121} 1120}
1122 1121
1123static void ipip6_fb_tunnel_init(struct net_device *dev) 1122static void __net_init ipip6_fb_tunnel_init(struct net_device *dev)
1124{ 1123{
1125 struct ip_tunnel *tunnel = netdev_priv(dev); 1124 struct ip_tunnel *tunnel = netdev_priv(dev);
1126 struct iphdr *iph = &tunnel->parms.iph; 1125 struct iphdr *iph = &tunnel->parms.iph;
@@ -1145,7 +1144,7 @@ static struct xfrm_tunnel sit_handler = {
1145 .priority = 1, 1144 .priority = 1,
1146}; 1145};
1147 1146
1148static void sit_destroy_tunnels(struct sit_net *sitn, struct list_head *head) 1147static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_head *head)
1149{ 1148{
1150 int prio; 1149 int prio;
1151 1150
@@ -1162,7 +1161,7 @@ static void sit_destroy_tunnels(struct sit_net *sitn, struct list_head *head)
1162 } 1161 }
1163} 1162}
1164 1163
1165static int sit_init_net(struct net *net) 1164static int __net_init sit_init_net(struct net *net)
1166{ 1165{
1167 struct sit_net *sitn = net_generic(net, sit_net_id); 1166 struct sit_net *sitn = net_generic(net, sit_net_id);
1168 int err; 1167 int err;
@@ -1195,7 +1194,7 @@ err_alloc_dev:
1195 return err; 1194 return err;
1196} 1195}
1197 1196
1198static void sit_exit_net(struct net *net) 1197static void __net_exit sit_exit_net(struct net *net)
1199{ 1198{
1200 struct sit_net *sitn = net_generic(net, sit_net_id); 1199 struct sit_net *sitn = net_generic(net, sit_net_id);
1201 LIST_HEAD(list); 1200 LIST_HEAD(list);
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index c690736885b4..f841d93bf987 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -55,7 +55,7 @@ struct ctl_path net_ipv6_ctl_path[] = {
55}; 55};
56EXPORT_SYMBOL_GPL(net_ipv6_ctl_path); 56EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
57 57
58static int ipv6_sysctl_net_init(struct net *net) 58static int __net_init ipv6_sysctl_net_init(struct net *net)
59{ 59{
60 struct ctl_table *ipv6_table; 60 struct ctl_table *ipv6_table;
61 struct ctl_table *ipv6_route_table; 61 struct ctl_table *ipv6_route_table;
@@ -98,7 +98,7 @@ out_ipv6_table:
98 goto out; 98 goto out;
99} 99}
100 100
101static void ipv6_sysctl_net_exit(struct net *net) 101static void __net_exit ipv6_sysctl_net_exit(struct net *net)
102{ 102{
103 struct ctl_table *ipv6_table; 103 struct ctl_table *ipv6_table;
104 struct ctl_table *ipv6_route_table; 104 struct ctl_table *ipv6_route_table;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 82f2dea0e39e..6963a6b6763e 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2113,7 +2113,7 @@ static struct tcp_seq_afinfo tcp6_seq_afinfo = {
2113 }, 2113 },
2114}; 2114};
2115 2115
2116int tcp6_proc_init(struct net *net) 2116int __net_init tcp6_proc_init(struct net *net)
2117{ 2117{
2118 return tcp_proc_register(net, &tcp6_seq_afinfo); 2118 return tcp_proc_register(net, &tcp6_seq_afinfo);
2119} 2119}
@@ -2182,18 +2182,18 @@ static struct inet_protosw tcpv6_protosw = {
2182 INET_PROTOSW_ICSK, 2182 INET_PROTOSW_ICSK,
2183}; 2183};
2184 2184
2185static int tcpv6_net_init(struct net *net) 2185static int __net_init tcpv6_net_init(struct net *net)
2186{ 2186{
2187 return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6, 2187 return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6,
2188 SOCK_RAW, IPPROTO_TCP, net); 2188 SOCK_RAW, IPPROTO_TCP, net);
2189} 2189}
2190 2190
2191static void tcpv6_net_exit(struct net *net) 2191static void __net_exit tcpv6_net_exit(struct net *net)
2192{ 2192{
2193 inet_ctl_sock_destroy(net->ipv6.tcp_sk); 2193 inet_ctl_sock_destroy(net->ipv6.tcp_sk);
2194} 2194}
2195 2195
2196static void tcpv6_net_exit_batch(struct list_head *net_exit_list) 2196static void __net_exit tcpv6_net_exit_batch(struct list_head *net_exit_list)
2197{ 2197{
2198 inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET6); 2198 inet_twsk_purge(&tcp_hashinfo, &tcp_death_row, AF_INET6);
2199} 2199}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 69ebdbe78c47..34efb3589ffa 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1396,7 +1396,7 @@ static struct udp_seq_afinfo udp6_seq_afinfo = {
1396 }, 1396 },
1397}; 1397};
1398 1398
1399int udp6_proc_init(struct net *net) 1399int __net_init udp6_proc_init(struct net *net)
1400{ 1400{
1401 return udp_proc_register(net, &udp6_seq_afinfo); 1401 return udp_proc_register(net, &udp6_seq_afinfo);
1402} 1402}
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 6ea6938919e6..5f48fadc27f7 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -104,12 +104,12 @@ static struct udp_seq_afinfo udplite6_seq_afinfo = {
104 }, 104 },
105}; 105};
106 106
107static int udplite6_proc_init_net(struct net *net) 107static int __net_init udplite6_proc_init_net(struct net *net)
108{ 108{
109 return udp_proc_register(net, &udplite6_seq_afinfo); 109 return udp_proc_register(net, &udplite6_seq_afinfo);
110} 110}
111 111
112static void udplite6_proc_exit_net(struct net *net) 112static void __net_exit udplite6_proc_exit_net(struct net *net)
113{ 113{
114 udp_proc_unregister(net, &udplite6_seq_afinfo); 114 udp_proc_unregister(net, &udplite6_seq_afinfo);
115} 115}
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 76fa6fef6473..4744b1f6372f 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3738,17 +3738,17 @@ static int __net_init pfkey_init_proc(struct net *net)
3738 return 0; 3738 return 0;
3739} 3739}
3740 3740
3741static void pfkey_exit_proc(struct net *net) 3741static void __net_exit pfkey_exit_proc(struct net *net)
3742{ 3742{
3743 proc_net_remove(net, "pfkey"); 3743 proc_net_remove(net, "pfkey");
3744} 3744}
3745#else 3745#else
3746static int __net_init pfkey_init_proc(struct net *net) 3746static inline int pfkey_init_proc(struct net *net)
3747{ 3747{
3748 return 0; 3748 return 0;
3749} 3749}
3750 3750
3751static void pfkey_exit_proc(struct net *net) 3751static inline void pfkey_exit_proc(struct net *net)
3752{ 3752{
3753} 3753}
3754#endif 3754#endif
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e0516a22be2e..a97acfe7e770 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2448,7 +2448,7 @@ static const struct file_operations packet_seq_fops = {
2448 2448
2449#endif 2449#endif
2450 2450
2451static int packet_net_init(struct net *net) 2451static int __net_init packet_net_init(struct net *net)
2452{ 2452{
2453 rwlock_init(&net->packet.sklist_lock); 2453 rwlock_init(&net->packet.sklist_lock);
2454 INIT_HLIST_HEAD(&net->packet.sklist); 2454 INIT_HLIST_HEAD(&net->packet.sklist);
@@ -2459,7 +2459,7 @@ static int packet_net_init(struct net *net)
2459 return 0; 2459 return 0;
2460} 2460}
2461 2461
2462static void packet_net_exit(struct net *net) 2462static void __net_exit packet_net_exit(struct net *net)
2463{ 2463{
2464 proc_net_remove(net, "packet"); 2464 proc_net_remove(net, "packet");
2465} 2465}
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index bc4a33bf2d3d..c597cc53a6fb 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -311,7 +311,7 @@ static struct notifier_block phonet_device_notifier = {
311}; 311};
312 312
313/* Per-namespace Phonet devices handling */ 313/* Per-namespace Phonet devices handling */
314static int phonet_init_net(struct net *net) 314static int __net_init phonet_init_net(struct net *net)
315{ 315{
316 struct phonet_net *pnn = net_generic(net, phonet_net_id); 316 struct phonet_net *pnn = net_generic(net, phonet_net_id);
317 317
@@ -324,7 +324,7 @@ static int phonet_init_net(struct net *net)
324 return 0; 324 return 0;
325} 325}
326 326
327static void phonet_exit_net(struct net *net) 327static void __net_exit phonet_exit_net(struct net *net)
328{ 328{
329 struct phonet_net *pnn = net_generic(net, phonet_net_id); 329 struct phonet_net *pnn = net_generic(net, phonet_net_id);
330 struct net_device *dev; 330 struct net_device *dev;
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 0b15d7250c40..53196009160a 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -71,7 +71,7 @@ static struct ctl_table_root net_sysctl_ro_root = {
71 .permissions = net_ctl_ro_header_perms, 71 .permissions = net_ctl_ro_header_perms,
72}; 72};
73 73
74static int sysctl_net_init(struct net *net) 74static int __net_init sysctl_net_init(struct net *net)
75{ 75{
76 setup_sysctl_set(&net->sysctls, 76 setup_sysctl_set(&net->sysctls,
77 &net_sysctl_ro_root.default_set, 77 &net_sysctl_ro_root.default_set,
@@ -79,7 +79,7 @@ static int sysctl_net_init(struct net *net)
79 return 0; 79 return 0;
80} 80}
81 81
82static void sysctl_net_exit(struct net *net) 82static void __net_exit sysctl_net_exit(struct net *net)
83{ 83{
84 WARN_ON(!list_empty(&net->sysctls.list)); 84 WARN_ON(!list_empty(&net->sysctls.list));
85 return; 85 return;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f25511903115..9bc9b92bc099 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2224,7 +2224,7 @@ static const struct net_proto_family unix_family_ops = {
2224}; 2224};
2225 2225
2226 2226
2227static int unix_net_init(struct net *net) 2227static int __net_init unix_net_init(struct net *net)
2228{ 2228{
2229 int error = -ENOMEM; 2229 int error = -ENOMEM;
2230 2230
@@ -2243,7 +2243,7 @@ out:
2243 return error; 2243 return error;
2244} 2244}
2245 2245
2246static void unix_net_exit(struct net *net) 2246static void __net_exit unix_net_exit(struct net *net)
2247{ 2247{
2248 unix_sysctl_unregister(net); 2248 unix_sysctl_unregister(net);
2249 proc_net_remove(net, "unix"); 2249 proc_net_remove(net, "unix");
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 708f5df6b7f0..d095c7be10d0 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -31,7 +31,7 @@ static struct ctl_path unix_path[] = {
31 { }, 31 { },
32}; 32};
33 33
34int unix_sysctl_register(struct net *net) 34int __net_init unix_sysctl_register(struct net *net)
35{ 35{
36 struct ctl_table *table; 36 struct ctl_table *table;
37 37
diff --git a/net/wireless/wext-proc.c b/net/wireless/wext-proc.c
index 273a7f77c834..8bafa31fa9f8 100644
--- a/net/wireless/wext-proc.c
+++ b/net/wireless/wext-proc.c
@@ -140,7 +140,7 @@ static const struct file_operations wireless_seq_fops = {
140 .release = seq_release_net, 140 .release = seq_release_net,
141}; 141};
142 142
143int wext_proc_init(struct net *net) 143int __net_init wext_proc_init(struct net *net)
144{ 144{
145 /* Create /proc/net/wireless entry */ 145 /* Create /proc/net/wireless entry */
146 if (!proc_net_fops_create(net, "wireless", S_IRUGO, &wireless_seq_fops)) 146 if (!proc_net_fops_create(net, "wireless", S_IRUGO, &wireless_seq_fops))
@@ -149,7 +149,7 @@ int wext_proc_init(struct net *net)
149 return 0; 149 return 0;
150} 150}
151 151
152void wext_proc_exit(struct net *net) 152void __net_exit wext_proc_exit(struct net *net)
153{ 153{
154 proc_net_remove(net, "wireless"); 154 proc_net_remove(net, "wireless");
155} 155}
diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c
index 2e221f2cad7e..2c4d6cdcba49 100644
--- a/net/xfrm/xfrm_sysctl.c
+++ b/net/xfrm/xfrm_sysctl.c
@@ -2,7 +2,7 @@
2#include <net/net_namespace.h> 2#include <net/net_namespace.h>
3#include <net/xfrm.h> 3#include <net/xfrm.h>
4 4
5static void __xfrm_sysctl_init(struct net *net) 5static void __net_init __xfrm_sysctl_init(struct net *net)
6{ 6{
7 net->xfrm.sysctl_aevent_etime = XFRM_AE_ETIME; 7 net->xfrm.sysctl_aevent_etime = XFRM_AE_ETIME;
8 net->xfrm.sysctl_aevent_rseqth = XFRM_AE_SEQT_SIZE; 8 net->xfrm.sysctl_aevent_rseqth = XFRM_AE_SEQT_SIZE;
@@ -64,7 +64,7 @@ out_kmemdup:
64 return -ENOMEM; 64 return -ENOMEM;
65} 65}
66 66
67void xfrm_sysctl_fini(struct net *net) 67void __net_exit xfrm_sysctl_fini(struct net *net)
68{ 68{
69 struct ctl_table *table; 69 struct ctl_table *table;
70 70