aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-02-17 20:34:56 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-18 14:53:08 -0500
commitece31ffd539e8e2b586b1ca5f50bc4f4591e3893 (patch)
tree05407d915a4c0be78a4aa85f54ae3b148ec91ea3
parentb4278c961aca320839964e23cfc7906ff61af0c2 (diff)
net: proc: change proc_net_remove to remove_proc_entry
proc_net_remove is only used to remove proc entries that under /proc/net,it's not a general function for removing proc entries of netns. if we want to remove some proc entries which under /proc/net/stat/, we still need to call remove_proc_entry. this patch use remove_proc_entry to replace proc_net_remove. we can remove proc_net_remove after this patch. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/connector/connector.c2
-rw-r--r--drivers/net/hamradio/bpqether.c2
-rw-r--r--drivers/net/hamradio/scc.c2
-rw-r--r--drivers/net/hamradio/yam.c2
-rw-r--r--drivers/net/ppp/pppoe.c2
-rw-r--r--net/8021q/vlanproc.c2
-rw-r--r--net/atm/proc.c2
-rw-r--r--net/ax25/af_ax25.c6
-rw-r--r--net/bluetooth/af_bluetooth.c2
-rw-r--r--net/can/bcm.c2
-rw-r--r--net/can/proc.c2
-rw-r--r--net/core/dev.c12
-rw-r--r--net/core/dev_addr_lists.c2
-rw-r--r--net/core/pktgen.c4
-rw-r--r--net/core/sock.c2
-rw-r--r--net/dccp/probe.c4
-rw-r--r--net/decnet/af_decnet.c2
-rw-r--r--net/decnet/dn_dev.c2
-rw-r--r--net/decnet/dn_neigh.c2
-rw-r--r--net/decnet/dn_route.c2
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/fib_trie.c10
-rw-r--r--net/ipv4/igmp.c6
-rw-r--r--net/ipv4/ipmr.c6
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c8
-rw-r--r--net/ipv4/ping.c2
-rw-r--r--net/ipv4/proc.c10
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/tcp_probe.c4
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/ipv6/addrconf.c2
-rw-r--r--net/ipv6/anycast.c2
-rw-r--r--net/ipv6/ip6_flowlabel.c2
-rw-r--r--net/ipv6/ip6mr.c6
-rw-r--r--net/ipv6/mcast.c6
-rw-r--r--net/ipv6/proc.c10
-rw-r--r--net/ipv6/raw.c2
-rw-r--r--net/ipv6/route.c4
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/l2tp/l2tp_ppp.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_app.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_conn.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c6
-rw-r--r--net/netfilter/nf_conntrack_expect.c2
-rw-r--r--net/netfilter/nf_conntrack_standalone.c4
-rw-r--r--net/netfilter/x_tables.c10
-rw-r--r--net/netfilter/xt_hashlimit.c6
-rw-r--r--net/netfilter/xt_recent.c2
-rw-r--r--net/netlink/af_netlink.c2
-rw-r--r--net/netrom/af_netrom.c6
-rw-r--r--net/packet/af_packet.c2
-rw-r--r--net/phonet/pn_dev.c4
-rw-r--r--net/rose/af_rose.c8
-rw-r--r--net/rxrpc/af_rxrpc.c4
-rw-r--r--net/sched/sch_api.c2
-rw-r--r--net/sctp/probe.c4
-rw-r--r--net/unix/af_unix.c2
-rw-r--r--net/wireless/wext-proc.c2
-rw-r--r--net/xfrm/xfrm_proc.c2
60 files changed, 112 insertions, 112 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index ed17a57ab3cb..f1b7e244bfc1 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -287,7 +287,7 @@ static void cn_fini(void)
287 287
288 cn_already_initialized = 0; 288 cn_already_initialized = 0;
289 289
290 proc_net_remove(&init_net, "connector"); 290 remove_proc_entry("connector", init_net.proc_net);
291 291
292 cn_queue_free_dev(dev->cbdev); 292 cn_queue_free_dev(dev->cbdev);
293 netlink_kernel_release(dev->nls); 293 netlink_kernel_release(dev->nls);
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 61f28842163d..02de6c891670 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -611,7 +611,7 @@ static void __exit bpq_cleanup_driver(void)
611 611
612 unregister_netdevice_notifier(&bpq_dev_notifier); 612 unregister_netdevice_notifier(&bpq_dev_notifier);
613 613
614 proc_net_remove(&init_net, "bpqether"); 614 remove_proc_entry("bpqether", init_net.proc_net);
615 615
616 rtnl_lock(); 616 rtnl_lock();
617 while (!list_empty(&bpq_devices)) { 617 while (!list_empty(&bpq_devices)) {
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index cab13f4d2942..bc1d52170389 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -2173,7 +2173,7 @@ static void __exit scc_cleanup_driver(void)
2173 if (Vector_Latch) 2173 if (Vector_Latch)
2174 release_region(Vector_Latch, 1); 2174 release_region(Vector_Latch, 1);
2175 2175
2176 proc_net_remove(&init_net, "z8530drv"); 2176 remove_proc_entry("z8530drv", init_net.proc_net);
2177} 2177}
2178 2178
2179MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>"); 2179MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>");
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 92847d27b2e8..4cf8f1017aad 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -1199,7 +1199,7 @@ static void __exit yam_cleanup_driver(void)
1199 kfree(p); 1199 kfree(p);
1200 } 1200 }
1201 1201
1202 proc_net_remove(&init_net, "yam"); 1202 remove_proc_entry("yam", init_net.proc_net);
1203} 1203}
1204 1204
1205/* --------------------------------------------------------------------- */ 1205/* --------------------------------------------------------------------- */
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index d7fa96c42ae7..bb07ba94c3aa 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -1145,7 +1145,7 @@ static __net_init int pppoe_init_net(struct net *net)
1145 1145
1146static __net_exit void pppoe_exit_net(struct net *net) 1146static __net_exit void pppoe_exit_net(struct net *net)
1147{ 1147{
1148 proc_net_remove(net, "pppoe"); 1148 remove_proc_entry("pppoe", net->proc_net);
1149} 1149}
1150 1150
1151static struct pernet_operations pppoe_net_ops = { 1151static struct pernet_operations pppoe_net_ops = {
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 4de77ea5fa37..dc526ec965e4 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -131,7 +131,7 @@ void vlan_proc_cleanup(struct net *net)
131 remove_proc_entry(name_conf, vn->proc_vlan_dir); 131 remove_proc_entry(name_conf, vn->proc_vlan_dir);
132 132
133 if (vn->proc_vlan_dir) 133 if (vn->proc_vlan_dir)
134 proc_net_remove(net, name_root); 134 remove_proc_entry(name_root, net->proc_net);
135 135
136 /* Dynamically added entries should be cleaned up as their vlan_device 136 /* Dynamically added entries should be cleaned up as their vlan_device
137 * is removed, so we should not have to take care of it here... 137 * is removed, so we should not have to take care of it here...
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 0d020de8d233..b4e75340b162 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -460,7 +460,7 @@ static void atm_proc_dirs_remove(void)
460 if (e->dirent) 460 if (e->dirent)
461 remove_proc_entry(e->name, atm_proc_root); 461 remove_proc_entry(e->name, atm_proc_root);
462 } 462 }
463 proc_net_remove(&init_net, "atm"); 463 remove_proc_entry("atm", init_net.proc_net);
464} 464}
465 465
466int __init atm_proc_init(void) 466int __init atm_proc_init(void)
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index b6ccbea3477e..69a06c47b648 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -2009,9 +2009,9 @@ MODULE_ALIAS_NETPROTO(PF_AX25);
2009 2009
2010static void __exit ax25_exit(void) 2010static void __exit ax25_exit(void)
2011{ 2011{
2012 proc_net_remove(&init_net, "ax25_route"); 2012 remove_proc_entry("ax25_route", init_net.proc_net);
2013 proc_net_remove(&init_net, "ax25"); 2013 remove_proc_entry("ax25", init_net.proc_net);
2014 proc_net_remove(&init_net, "ax25_calls"); 2014 remove_proc_entry("ax25_calls", init_net.proc_net);
2015 2015
2016 unregister_netdevice_notifier(&ax25_dev_notifier); 2016 unregister_netdevice_notifier(&ax25_dev_notifier);
2017 2017
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 8412b637407b..d3ee69b35a78 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -652,7 +652,7 @@ int bt_procfs_init(struct module* module, struct net *net, const char *name,
652 652
653void bt_procfs_cleanup(struct net *net, const char *name) 653void bt_procfs_cleanup(struct net *net, const char *name)
654{ 654{
655 proc_net_remove(net, name); 655 remove_proc_entry(name, net->proc_net);
656} 656}
657#else 657#else
658int bt_procfs_init(struct module* module, struct net *net, const char *name, 658int bt_procfs_init(struct module* module, struct net *net, const char *name,
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 28e12d18f0f1..5dcb20076f39 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1633,7 +1633,7 @@ static void __exit bcm_module_exit(void)
1633 can_proto_unregister(&bcm_can_proto); 1633 can_proto_unregister(&bcm_can_proto);
1634 1634
1635 if (proc_dir) 1635 if (proc_dir)
1636 proc_net_remove(&init_net, "can-bcm"); 1636 remove_proc_entry("can-bcm", init_net.proc_net);
1637} 1637}
1638 1638
1639module_init(bcm_module_init); 1639module_init(bcm_module_init);
diff --git a/net/can/proc.c b/net/can/proc.c
index ae566902d2bf..497335892146 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -531,5 +531,5 @@ void can_remove_proc(void)
531 can_remove_proc_readentry(CAN_PROC_RCVLIST_SFF); 531 can_remove_proc_readentry(CAN_PROC_RCVLIST_SFF);
532 532
533 if (can_dir) 533 if (can_dir)
534 proc_net_remove(&init_net, "can"); 534 remove_proc_entry("can", init_net.proc_net);
535} 535}
diff --git a/net/core/dev.c b/net/core/dev.c
index f2f81ef5bbd6..decf55f9ad80 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4532,11 +4532,11 @@ static int __net_init dev_proc_net_init(struct net *net)
4532out: 4532out:
4533 return rc; 4533 return rc;
4534out_ptype: 4534out_ptype:
4535 proc_net_remove(net, "ptype"); 4535 remove_proc_entry("ptype", net->proc_net);
4536out_softnet: 4536out_softnet:
4537 proc_net_remove(net, "softnet_stat"); 4537 remove_proc_entry("softnet_stat", net->proc_net);
4538out_dev: 4538out_dev:
4539 proc_net_remove(net, "dev"); 4539 remove_proc_entry("dev", net->proc_net);
4540 goto out; 4540 goto out;
4541} 4541}
4542 4542
@@ -4544,9 +4544,9 @@ static void __net_exit dev_proc_net_exit(struct net *net)
4544{ 4544{
4545 wext_proc_exit(net); 4545 wext_proc_exit(net);
4546 4546
4547 proc_net_remove(net, "ptype"); 4547 remove_proc_entry("ptype", net->proc_net);
4548 proc_net_remove(net, "softnet_stat"); 4548 remove_proc_entry("softnet_stat", net->proc_net);
4549 proc_net_remove(net, "dev"); 4549 remove_proc_entry("dev", net->proc_net);
4550} 4550}
4551 4551
4552static struct pernet_operations __net_initdata dev_proc_ops = { 4552static struct pernet_operations __net_initdata dev_proc_ops = {
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 7c62ec449f3c..89562529df45 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -787,7 +787,7 @@ static int __net_init dev_mc_net_init(struct net *net)
787 787
788static void __net_exit dev_mc_net_exit(struct net *net) 788static void __net_exit dev_mc_net_exit(struct net *net)
789{ 789{
790 proc_net_remove(net, "dev_mcast"); 790 remove_proc_entry("dev_mcast", net->proc_net);
791} 791}
792 792
793static struct pernet_operations __net_initdata dev_mc_net_ops = { 793static struct pernet_operations __net_initdata dev_mc_net_ops = {
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2201e699ad67..6048fc1da1c2 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3650,7 +3650,7 @@ static int __net_init pg_net_init(struct net *net)
3650remove_entry: 3650remove_entry:
3651 remove_proc_entry(PGCTRL, pn->proc_dir); 3651 remove_proc_entry(PGCTRL, pn->proc_dir);
3652remove: 3652remove:
3653 proc_net_remove(pn->net, PG_PROC_DIR); 3653 remove_proc_entry(PG_PROC_DIR, pn->net->proc_net);
3654 return ret; 3654 return ret;
3655} 3655}
3656 3656
@@ -3676,7 +3676,7 @@ static void __net_exit pg_net_exit(struct net *net)
3676 } 3676 }
3677 3677
3678 remove_proc_entry(PGCTRL, pn->proc_dir); 3678 remove_proc_entry(PGCTRL, pn->proc_dir);
3679 proc_net_remove(pn->net, PG_PROC_DIR); 3679 remove_proc_entry(PG_PROC_DIR, pn->net->proc_net);
3680} 3680}
3681 3681
3682static struct pernet_operations pg_net_ops = { 3682static struct pernet_operations pg_net_ops = {
diff --git a/net/core/sock.c b/net/core/sock.c
index b4d562ef36fb..fe96c5d34299 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2844,7 +2844,7 @@ static __net_init int proto_init_net(struct net *net)
2844 2844
2845static __net_exit void proto_exit_net(struct net *net) 2845static __net_exit void proto_exit_net(struct net *net)
2846{ 2846{
2847 proc_net_remove(net, "protocols"); 2847 remove_proc_entry("protocols", net->proc_net);
2848} 2848}
2849 2849
2850 2850
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index d183589b77e9..4c6bdf97a657 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -181,7 +181,7 @@ static __init int dccpprobe_init(void)
181 pr_info("DCCP watch registered (port=%d)\n", port); 181 pr_info("DCCP watch registered (port=%d)\n", port);
182 return 0; 182 return 0;
183err1: 183err1:
184 proc_net_remove(&init_net, procname); 184 remove_proc_entry(procname, init_net.proc_net);
185err0: 185err0:
186 kfifo_free(&dccpw.fifo); 186 kfifo_free(&dccpw.fifo);
187 return ret; 187 return ret;
@@ -191,7 +191,7 @@ module_init(dccpprobe_init);
191static __exit void dccpprobe_exit(void) 191static __exit void dccpprobe_exit(void)
192{ 192{
193 kfifo_free(&dccpw.fifo); 193 kfifo_free(&dccpw.fifo);
194 proc_net_remove(&init_net, procname); 194 remove_proc_entry(procname, init_net.proc_net);
195 unregister_jprobe(&dccp_send_probe); 195 unregister_jprobe(&dccp_send_probe);
196 196
197} 197}
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index f916013d9074..c4a2def5b7bd 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -2413,7 +2413,7 @@ static void __exit decnet_exit(void)
2413 dn_neigh_cleanup(); 2413 dn_neigh_cleanup();
2414 dn_fib_cleanup(); 2414 dn_fib_cleanup();
2415 2415
2416 proc_net_remove(&init_net, "decnet"); 2416 remove_proc_entry("decnet", init_net.proc_net);
2417 2417
2418 proto_unregister(&dn_proto); 2418 proto_unregister(&dn_proto);
2419 2419
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index a04894a2c26e..c8da116d84a4 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1433,7 +1433,7 @@ void __exit dn_dev_cleanup(void)
1433 } 1433 }
1434#endif /* CONFIG_SYSCTL */ 1434#endif /* CONFIG_SYSCTL */
1435 1435
1436 proc_net_remove(&init_net, "decnet_dev"); 1436 remove_proc_entry("decnet_dev", init_net.proc_net);
1437 1437
1438 dn_dev_devices_off(); 1438 dn_dev_devices_off();
1439} 1439}
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index f3408f369fe3..f8637f93d318 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -596,6 +596,6 @@ void __init dn_neigh_init(void)
596 596
597void __exit dn_neigh_cleanup(void) 597void __exit dn_neigh_cleanup(void)
598{ 598{
599 proc_net_remove(&init_net, "decnet_neigh"); 599 remove_proc_entry("decnet_neigh", init_net.proc_net);
600 neigh_table_clear(&dn_neigh_table); 600 neigh_table_clear(&dn_neigh_table);
601} 601}
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 8afb257f279f..5ac0e153ef83 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1918,7 +1918,7 @@ void __exit dn_route_cleanup(void)
1918 del_timer(&dn_route_timer); 1918 del_timer(&dn_route_timer);
1919 dn_run_flush(0); 1919 dn_run_flush(0);
1920 1920
1921 proc_net_remove(&init_net, "decnet_cache"); 1921 remove_proc_entry("decnet_cache", init_net.proc_net);
1922 dst_entries_destroy(&dn_dst_ops); 1922 dst_entries_destroy(&dn_dst_ops);
1923} 1923}
1924 1924
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b04c114ef055..fea4929f6200 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1412,7 +1412,7 @@ static int __net_init arp_net_init(struct net *net)
1412 1412
1413static void __net_exit arp_net_exit(struct net *net) 1413static void __net_exit arp_net_exit(struct net *net)
1414{ 1414{
1415 proc_net_remove(net, "arp"); 1415 remove_proc_entry("arp", net->proc_net);
1416} 1416}
1417 1417
1418static struct pernet_operations arp_net_ops = { 1418static struct pernet_operations arp_net_ops = {
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 67c1d4b641d4..61e03da3e1f5 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2620,18 +2620,18 @@ int __net_init fib_proc_init(struct net *net)
2620 return 0; 2620 return 0;
2621 2621
2622out3: 2622out3:
2623 proc_net_remove(net, "fib_triestat"); 2623 remove_proc_entry("fib_triestat", net->proc_net);
2624out2: 2624out2:
2625 proc_net_remove(net, "fib_trie"); 2625 remove_proc_entry("fib_trie", net->proc_net);
2626out1: 2626out1:
2627 return -ENOMEM; 2627 return -ENOMEM;
2628} 2628}
2629 2629
2630void __net_exit fib_proc_exit(struct net *net) 2630void __net_exit fib_proc_exit(struct net *net)
2631{ 2631{
2632 proc_net_remove(net, "fib_trie"); 2632 remove_proc_entry("fib_trie", net->proc_net);
2633 proc_net_remove(net, "fib_triestat"); 2633 remove_proc_entry("fib_triestat", net->proc_net);
2634 proc_net_remove(net, "route"); 2634 remove_proc_entry("route", net->proc_net);
2635} 2635}
2636 2636
2637#endif /* CONFIG_PROC_FS */ 2637#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index be85628e6a83..d8c232794bcb 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2656,15 +2656,15 @@ static int __net_init igmp_net_init(struct net *net)
2656 return 0; 2656 return 0;
2657 2657
2658out_mcfilter: 2658out_mcfilter:
2659 proc_net_remove(net, "igmp"); 2659 remove_proc_entry("igmp", net->proc_net);
2660out_igmp: 2660out_igmp:
2661 return -ENOMEM; 2661 return -ENOMEM;
2662} 2662}
2663 2663
2664static void __net_exit igmp_net_exit(struct net *net) 2664static void __net_exit igmp_net_exit(struct net *net)
2665{ 2665{
2666 proc_net_remove(net, "mcfilter"); 2666 remove_proc_entry("mcfilter", net->proc_net);
2667 proc_net_remove(net, "igmp"); 2667 remove_proc_entry("igmp", net->proc_net);
2668} 2668}
2669 2669
2670static struct pernet_operations igmp_net_ops = { 2670static struct pernet_operations igmp_net_ops = {
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 160a8b8e9cae..5f95b3aa579e 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -2712,7 +2712,7 @@ static int __net_init ipmr_net_init(struct net *net)
2712 2712
2713#ifdef CONFIG_PROC_FS 2713#ifdef CONFIG_PROC_FS
2714proc_cache_fail: 2714proc_cache_fail:
2715 proc_net_remove(net, "ip_mr_vif"); 2715 remove_proc_entry("ip_mr_vif", net->proc_net);
2716proc_vif_fail: 2716proc_vif_fail:
2717 ipmr_rules_exit(net); 2717 ipmr_rules_exit(net);
2718#endif 2718#endif
@@ -2723,8 +2723,8 @@ fail:
2723static void __net_exit ipmr_net_exit(struct net *net) 2723static void __net_exit ipmr_net_exit(struct net *net)
2724{ 2724{
2725#ifdef CONFIG_PROC_FS 2725#ifdef CONFIG_PROC_FS
2726 proc_net_remove(net, "ip_mr_cache"); 2726 remove_proc_entry("ip_mr_cache", net->proc_net);
2727 proc_net_remove(net, "ip_mr_vif"); 2727 remove_proc_entry("ip_mr_vif", net->proc_net);
2728#endif 2728#endif
2729 ipmr_rules_exit(net); 2729 ipmr_rules_exit(net);
2730} 2730}
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
index 48bc681f5d32..f2ca12794081 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
@@ -433,9 +433,9 @@ static int __net_init ip_conntrack_net_init(struct net *net)
433 return 0; 433 return 0;
434 434
435err3: 435err3:
436 proc_net_remove(net, "ip_conntrack_expect"); 436 remove_proc_entry("ip_conntrack_expect", net->proc_net);
437err2: 437err2:
438 proc_net_remove(net, "ip_conntrack"); 438 remove_proc_entry("ip_conntrack", net->proc_net);
439err1: 439err1:
440 return -ENOMEM; 440 return -ENOMEM;
441} 441}
@@ -443,8 +443,8 @@ err1:
443static void __net_exit ip_conntrack_net_exit(struct net *net) 443static void __net_exit ip_conntrack_net_exit(struct net *net)
444{ 444{
445 remove_proc_entry("ip_conntrack", net->proc_net_stat); 445 remove_proc_entry("ip_conntrack", net->proc_net_stat);
446 proc_net_remove(net, "ip_conntrack_expect"); 446 remove_proc_entry("ip_conntrack_expect", net->proc_net);
447 proc_net_remove(net, "ip_conntrack"); 447 remove_proc_entry("ip_conntrack", net->proc_net);
448} 448}
449 449
450static struct pernet_operations ip_conntrack_net_ops = { 450static struct pernet_operations ip_conntrack_net_ops = {
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index fc62a13b5eef..55c4ee1bba06 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -897,7 +897,7 @@ static int ping_proc_register(struct net *net)
897 897
898static void ping_proc_unregister(struct net *net) 898static void ping_proc_unregister(struct net *net)
899{ 899{
900 proc_net_remove(net, "icmp"); 900 remove_proc_entry("icmp", net->proc_net);
901} 901}
902 902
903 903
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 954bcd42d50e..32030a24e776 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -482,18 +482,18 @@ static __net_init int ip_proc_init_net(struct net *net)
482 return 0; 482 return 0;
483 483
484out_snmp: 484out_snmp:
485 proc_net_remove(net, "netstat"); 485 remove_proc_entry("netstat", net->proc_net);
486out_netstat: 486out_netstat:
487 proc_net_remove(net, "sockstat"); 487 remove_proc_entry("sockstat", net->proc_net);
488out_sockstat: 488out_sockstat:
489 return -ENOMEM; 489 return -ENOMEM;
490} 490}
491 491
492static __net_exit void ip_proc_exit_net(struct net *net) 492static __net_exit void ip_proc_exit_net(struct net *net)
493{ 493{
494 proc_net_remove(net, "snmp"); 494 remove_proc_entry("snmp", net->proc_net);
495 proc_net_remove(net, "netstat"); 495 remove_proc_entry("netstat", net->proc_net);
496 proc_net_remove(net, "sockstat"); 496 remove_proc_entry("sockstat", net->proc_net);
497} 497}
498 498
499static __net_initdata struct pernet_operations ip_proc_ops = { 499static __net_initdata struct pernet_operations ip_proc_ops = {
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 5043a7d0c64e..53ddebc292b6 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -1058,7 +1058,7 @@ static __net_init int raw_init_net(struct net *net)
1058 1058
1059static __net_exit void raw_exit_net(struct net *net) 1059static __net_exit void raw_exit_net(struct net *net)
1060{ 1060{
1061 proc_net_remove(net, "raw"); 1061 remove_proc_entry("raw", net->proc_net);
1062} 1062}
1063 1063
1064static __net_initdata struct pernet_operations raw_net_ops = { 1064static __net_initdata struct pernet_operations raw_net_ops = {
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 77f5050efc8d..145d3bf8df86 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2616,7 +2616,7 @@ EXPORT_SYMBOL(tcp_proc_register);
2616 2616
2617void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) 2617void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo)
2618{ 2618{
2619 proc_net_remove(net, afinfo->name); 2619 remove_proc_entry(afinfo->name, net->proc_net);
2620} 2620}
2621EXPORT_SYMBOL(tcp_proc_unregister); 2621EXPORT_SYMBOL(tcp_proc_unregister);
2622 2622
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 1e3a1fb3c0cd..d4943f67aff2 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -244,7 +244,7 @@ static __init int tcpprobe_init(void)
244 pr_info("probe registered (port=%d) bufsize=%u\n", port, bufsize); 244 pr_info("probe registered (port=%d) bufsize=%u\n", port, bufsize);
245 return 0; 245 return 0;
246 err1: 246 err1:
247 proc_net_remove(&init_net, procname); 247 remove_proc_entry(procname, init_net.proc_net);
248 err0: 248 err0:
249 kfree(tcp_probe.log); 249 kfree(tcp_probe.log);
250 return ret; 250 return ret;
@@ -253,7 +253,7 @@ module_init(tcpprobe_init);
253 253
254static __exit void tcpprobe_exit(void) 254static __exit void tcpprobe_exit(void)
255{ 255{
256 proc_net_remove(&init_net, procname); 256 remove_proc_entry(procname, init_net.proc_net);
257 unregister_jprobe(&tcp_jprobe); 257 unregister_jprobe(&tcp_jprobe);
258 kfree(tcp_probe.log); 258 kfree(tcp_probe.log);
259} 259}
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 39a5e7a9a77f..265c42cf963c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2122,7 +2122,7 @@ EXPORT_SYMBOL(udp_proc_register);
2122 2122
2123void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo) 2123void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo)
2124{ 2124{
2125 proc_net_remove(net, afinfo->name); 2125 remove_proc_entry(afinfo->name, net->proc_net);
2126} 2126}
2127EXPORT_SYMBOL(udp_proc_unregister); 2127EXPORT_SYMBOL(udp_proc_unregister);
2128 2128
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index bad71083db86..4dc0d44a5d31 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3332,7 +3332,7 @@ static int __net_init if6_proc_net_init(struct net *net)
3332 3332
3333static void __net_exit if6_proc_net_exit(struct net *net) 3333static void __net_exit if6_proc_net_exit(struct net *net)
3334{ 3334{
3335 proc_net_remove(net, "if_inet6"); 3335 remove_proc_entry("if_inet6", net->proc_net);
3336} 3336}
3337 3337
3338static struct pernet_operations if6_proc_net_ops = { 3338static struct pernet_operations if6_proc_net_ops = {
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 5a8c00983de5..5a80f15a9de2 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -517,7 +517,7 @@ int __net_init ac6_proc_init(struct net *net)
517 517
518void ac6_proc_exit(struct net *net) 518void ac6_proc_exit(struct net *net)
519{ 519{
520 proc_net_remove(net, "anycast6"); 520 remove_proc_entry("anycast6", net->proc_net);
521} 521}
522#endif 522#endif
523 523
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 900d79eda51e..b973ed3d06cf 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -814,7 +814,7 @@ static int __net_init ip6_flowlabel_proc_init(struct net *net)
814 814
815static void __net_exit ip6_flowlabel_proc_fini(struct net *net) 815static void __net_exit ip6_flowlabel_proc_fini(struct net *net)
816{ 816{
817 proc_net_remove(net, "ip6_flowlabel"); 817 remove_proc_entry("ip6_flowlabel", net->proc_net);
818} 818}
819#else 819#else
820static inline int ip6_flowlabel_proc_init(struct net *net) 820static inline int ip6_flowlabel_proc_init(struct net *net)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index fdfd96d288ed..96bfb4e4b820 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1369,7 +1369,7 @@ static int __net_init ip6mr_net_init(struct net *net)
1369 1369
1370#ifdef CONFIG_PROC_FS 1370#ifdef CONFIG_PROC_FS
1371proc_cache_fail: 1371proc_cache_fail:
1372 proc_net_remove(net, "ip6_mr_vif"); 1372 remove_proc_entry("ip6_mr_vif", net->proc_net);
1373proc_vif_fail: 1373proc_vif_fail:
1374 ip6mr_rules_exit(net); 1374 ip6mr_rules_exit(net);
1375#endif 1375#endif
@@ -1380,8 +1380,8 @@ fail:
1380static void __net_exit ip6mr_net_exit(struct net *net) 1380static void __net_exit ip6mr_net_exit(struct net *net)
1381{ 1381{
1382#ifdef CONFIG_PROC_FS 1382#ifdef CONFIG_PROC_FS
1383 proc_net_remove(net, "ip6_mr_cache"); 1383 remove_proc_entry("ip6_mr_cache", net->proc_net);
1384 proc_net_remove(net, "ip6_mr_vif"); 1384 remove_proc_entry("ip6_mr_vif", net->proc_net);
1385#endif 1385#endif
1386 ip6mr_rules_exit(net); 1386 ip6mr_rules_exit(net);
1387} 1387}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index de7d4b9a58b0..bfa6cc36ef2a 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2610,14 +2610,14 @@ out:
2610 return err; 2610 return err;
2611 2611
2612out_proc_net_igmp6: 2612out_proc_net_igmp6:
2613 proc_net_remove(net, "igmp6"); 2613 remove_proc_entry("igmp6", net->proc_net);
2614 goto out; 2614 goto out;
2615} 2615}
2616 2616
2617static void __net_exit igmp6_proc_exit(struct net *net) 2617static void __net_exit igmp6_proc_exit(struct net *net)
2618{ 2618{
2619 proc_net_remove(net, "mcfilter6"); 2619 remove_proc_entry("mcfilter6", net->proc_net);
2620 proc_net_remove(net, "igmp6"); 2620 remove_proc_entry("igmp6", net->proc_net);
2621} 2621}
2622#else 2622#else
2623static inline int igmp6_proc_init(struct net *net) 2623static inline int igmp6_proc_init(struct net *net)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index cf8901dc653e..bbbe53a99b57 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -308,17 +308,17 @@ static int __net_init ipv6_proc_init_net(struct net *net)
308 return 0; 308 return 0;
309 309
310proc_dev_snmp6_fail: 310proc_dev_snmp6_fail:
311 proc_net_remove(net, "snmp6"); 311 remove_proc_entry("snmp6", net->proc_net);
312proc_snmp6_fail: 312proc_snmp6_fail:
313 proc_net_remove(net, "sockstat6"); 313 remove_proc_entry("sockstat6", net->proc_net);
314 return -ENOMEM; 314 return -ENOMEM;
315} 315}
316 316
317static void __net_exit ipv6_proc_exit_net(struct net *net) 317static void __net_exit ipv6_proc_exit_net(struct net *net)
318{ 318{
319 proc_net_remove(net, "sockstat6"); 319 remove_proc_entry("sockstat6", net->proc_net);
320 proc_net_remove(net, "dev_snmp6"); 320 remove_proc_entry("dev_snmp6", net->proc_net);
321 proc_net_remove(net, "snmp6"); 321 remove_proc_entry("snmp6", net->proc_net);
322} 322}
323 323
324static struct pernet_operations ipv6_proc_ops = { 324static struct pernet_operations ipv6_proc_ops = {
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index ff42fb309eec..c65907db8c44 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1300,7 +1300,7 @@ static int __net_init raw6_init_net(struct net *net)
1300 1300
1301static void __net_exit raw6_exit_net(struct net *net) 1301static void __net_exit raw6_exit_net(struct net *net)
1302{ 1302{
1303 proc_net_remove(net, "raw6"); 1303 remove_proc_entry("raw6", net->proc_net);
1304} 1304}
1305 1305
1306static struct pernet_operations raw6_net_ops = { 1306static struct pernet_operations raw6_net_ops = {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e1228d839ebf..515bb51e05a8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3004,8 +3004,8 @@ static int __net_init ip6_route_net_init_late(struct net *net)
3004static void __net_exit ip6_route_net_exit_late(struct net *net) 3004static void __net_exit ip6_route_net_exit_late(struct net *net)
3005{ 3005{
3006#ifdef CONFIG_PROC_FS 3006#ifdef CONFIG_PROC_FS
3007 proc_net_remove(net, "ipv6_route"); 3007 remove_proc_entry("ipv6_route", net->proc_net);
3008 proc_net_remove(net, "rt6_stats"); 3008 remove_proc_entry("rt6_stats", net->proc_net);
3009#endif 3009#endif
3010} 3010}
3011 3011
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 021a429312b1..9ef79851f297 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3749,7 +3749,7 @@ static int __net_init pfkey_init_proc(struct net *net)
3749 3749
3750static void __net_exit pfkey_exit_proc(struct net *net) 3750static void __net_exit pfkey_exit_proc(struct net *net)
3751{ 3751{
3752 proc_net_remove(net, "pfkey"); 3752 remove_proc_entry("pfkey", net->proc_net);
3753} 3753}
3754#else 3754#else
3755static inline int pfkey_init_proc(struct net *net) 3755static inline int pfkey_init_proc(struct net *net)
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 3ca270b4d47c..3f4e3afc191a 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1796,7 +1796,7 @@ out:
1796 1796
1797static __net_exit void pppol2tp_exit_net(struct net *net) 1797static __net_exit void pppol2tp_exit_net(struct net *net)
1798{ 1798{
1799 proc_net_remove(net, "pppol2tp"); 1799 remove_proc_entry("pppol2tp", net->proc_net);
1800} 1800}
1801 1801
1802static struct pernet_operations pppol2tp_net_ops = { 1802static struct pernet_operations pppol2tp_net_ops = {
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 1db8a25fe4ba..0b779d7df881 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -612,5 +612,5 @@ int __net_init ip_vs_app_net_init(struct net *net)
612void __net_exit ip_vs_app_net_cleanup(struct net *net) 612void __net_exit ip_vs_app_net_cleanup(struct net *net)
613{ 613{
614 unregister_ip_vs_app(net, NULL /* all */); 614 unregister_ip_vs_app(net, NULL /* all */);
615 proc_net_remove(net, "ip_vs_app"); 615 remove_proc_entry("ip_vs_app", net->proc_net);
616} 616}
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 91ae11280c24..9f00db7e03f2 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1300,8 +1300,8 @@ void __net_exit ip_vs_conn_net_cleanup(struct net *net)
1300{ 1300{
1301 /* flush all the connection entries first */ 1301 /* flush all the connection entries first */
1302 ip_vs_conn_flush(net); 1302 ip_vs_conn_flush(net);
1303 proc_net_remove(net, "ip_vs_conn"); 1303 remove_proc_entry("ip_vs_conn", net->proc_net);
1304 proc_net_remove(net, "ip_vs_conn_sync"); 1304 remove_proc_entry("ip_vs_conn_sync", net->proc_net);
1305} 1305}
1306 1306
1307int __init ip_vs_conn_init(void) 1307int __init ip_vs_conn_init(void)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 7d69181f8daa..c68198bf9128 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -3822,9 +3822,9 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net)
3822 ip_vs_trash_cleanup(net); 3822 ip_vs_trash_cleanup(net);
3823 ip_vs_stop_estimator(net, &ipvs->tot_stats); 3823 ip_vs_stop_estimator(net, &ipvs->tot_stats);
3824 ip_vs_control_net_cleanup_sysctl(net); 3824 ip_vs_control_net_cleanup_sysctl(net);
3825 proc_net_remove(net, "ip_vs_stats_percpu"); 3825 remove_proc_entry("ip_vs_stats_percpu", net->proc_net);
3826 proc_net_remove(net, "ip_vs_stats"); 3826 remove_proc_entry("ip_vs_stats", net->proc_net);
3827 proc_net_remove(net, "ip_vs"); 3827 remove_proc_entry("ip_vs", net->proc_net);
3828 free_percpu(ipvs->tot_stats.cpustats); 3828 free_percpu(ipvs->tot_stats.cpustats);
3829} 3829}
3830 3830
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 4c15f8d0b741..3921e5bc1235 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -582,7 +582,7 @@ static int exp_proc_init(struct net *net)
582static void exp_proc_remove(struct net *net) 582static void exp_proc_remove(struct net *net)
583{ 583{
584#ifdef CONFIG_NF_CONNTRACK_PROCFS 584#ifdef CONFIG_NF_CONNTRACK_PROCFS
585 proc_net_remove(net, "nf_conntrack_expect"); 585 remove_proc_entry("nf_conntrack_expect", net->proc_net);
586#endif /* CONFIG_NF_CONNTRACK_PROCFS */ 586#endif /* CONFIG_NF_CONNTRACK_PROCFS */
587} 587}
588 588
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index bee9aecc7ba7..6bcce401fd1c 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -377,7 +377,7 @@ static int nf_conntrack_standalone_init_proc(struct net *net)
377 return 0; 377 return 0;
378 378
379out_stat_nf_conntrack: 379out_stat_nf_conntrack:
380 proc_net_remove(net, "nf_conntrack"); 380 remove_proc_entry("nf_conntrack", net->proc_net);
381out_nf_conntrack: 381out_nf_conntrack:
382 return -ENOMEM; 382 return -ENOMEM;
383} 383}
@@ -385,7 +385,7 @@ out_nf_conntrack:
385static void nf_conntrack_standalone_fini_proc(struct net *net) 385static void nf_conntrack_standalone_fini_proc(struct net *net)
386{ 386{
387 remove_proc_entry("nf_conntrack", net->proc_net_stat); 387 remove_proc_entry("nf_conntrack", net->proc_net_stat);
388 proc_net_remove(net, "nf_conntrack"); 388 remove_proc_entry("nf_conntrack", net->proc_net);
389} 389}
390#else 390#else
391static int nf_conntrack_standalone_init_proc(struct net *net) 391static int nf_conntrack_standalone_init_proc(struct net *net)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 7b3a9e5999c0..686c7715d777 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1323,12 +1323,12 @@ int xt_proto_init(struct net *net, u_int8_t af)
1323out_remove_matches: 1323out_remove_matches:
1324 strlcpy(buf, xt_prefix[af], sizeof(buf)); 1324 strlcpy(buf, xt_prefix[af], sizeof(buf));
1325 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 1325 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
1326 proc_net_remove(net, buf); 1326 remove_proc_entry(buf, net->proc_net);
1327 1327
1328out_remove_tables: 1328out_remove_tables:
1329 strlcpy(buf, xt_prefix[af], sizeof(buf)); 1329 strlcpy(buf, xt_prefix[af], sizeof(buf));
1330 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 1330 strlcat(buf, FORMAT_TABLES, sizeof(buf));
1331 proc_net_remove(net, buf); 1331 remove_proc_entry(buf, net->proc_net);
1332out: 1332out:
1333 return -1; 1333 return -1;
1334#endif 1334#endif
@@ -1342,15 +1342,15 @@ void xt_proto_fini(struct net *net, u_int8_t af)
1342 1342
1343 strlcpy(buf, xt_prefix[af], sizeof(buf)); 1343 strlcpy(buf, xt_prefix[af], sizeof(buf));
1344 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 1344 strlcat(buf, FORMAT_TABLES, sizeof(buf));
1345 proc_net_remove(net, buf); 1345 remove_proc_entry(buf, net->proc_net);
1346 1346
1347 strlcpy(buf, xt_prefix[af], sizeof(buf)); 1347 strlcpy(buf, xt_prefix[af], sizeof(buf));
1348 strlcat(buf, FORMAT_TARGETS, sizeof(buf)); 1348 strlcat(buf, FORMAT_TARGETS, sizeof(buf));
1349 proc_net_remove(net, buf); 1349 remove_proc_entry(buf, net->proc_net);
1350 1350
1351 strlcpy(buf, xt_prefix[af], sizeof(buf)); 1351 strlcpy(buf, xt_prefix[af], sizeof(buf));
1352 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 1352 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
1353 proc_net_remove(net, buf); 1353 remove_proc_entry(buf, net->proc_net);
1354#endif /*CONFIG_PROC_FS*/ 1354#endif /*CONFIG_PROC_FS*/
1355} 1355}
1356EXPORT_SYMBOL_GPL(xt_proto_fini); 1356EXPORT_SYMBOL_GPL(xt_proto_fini);
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index a9d7af953ceb..98218c896d2e 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -867,7 +867,7 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
867#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 867#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
868 hashlimit_net->ip6t_hashlimit = proc_mkdir("ip6t_hashlimit", net->proc_net); 868 hashlimit_net->ip6t_hashlimit = proc_mkdir("ip6t_hashlimit", net->proc_net);
869 if (!hashlimit_net->ip6t_hashlimit) { 869 if (!hashlimit_net->ip6t_hashlimit) {
870 proc_net_remove(net, "ipt_hashlimit"); 870 remove_proc_entry("ipt_hashlimit", net->proc_net);
871 return -ENOMEM; 871 return -ENOMEM;
872 } 872 }
873#endif 873#endif
@@ -897,9 +897,9 @@ static void __net_exit hashlimit_proc_net_exit(struct net *net)
897 hashlimit_net->ip6t_hashlimit = NULL; 897 hashlimit_net->ip6t_hashlimit = NULL;
898 mutex_unlock(&hashlimit_mutex); 898 mutex_unlock(&hashlimit_mutex);
899 899
900 proc_net_remove(net, "ipt_hashlimit"); 900 remove_proc_entry("ipt_hashlimit", net->proc_net);
901#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) 901#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
902 proc_net_remove(net, "ip6t_hashlimit"); 902 remove_proc_entry("ip6t_hashlimit", net->proc_net);
903#endif 903#endif
904} 904}
905 905
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 978efc9b555a..31bf233dae97 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -643,7 +643,7 @@ static void __net_exit recent_proc_net_exit(struct net *net)
643 recent_net->xt_recent = NULL; 643 recent_net->xt_recent = NULL;
644 spin_unlock_bh(&recent_lock); 644 spin_unlock_bh(&recent_lock);
645 645
646 proc_net_remove(net, "xt_recent"); 646 remove_proc_entry("xt_recent", net->proc_net);
647} 647}
648#else 648#else
649static inline int recent_proc_net_init(struct net *net) 649static inline int recent_proc_net_init(struct net *net)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 50084c40a129..3d55e0c713e2 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2154,7 +2154,7 @@ static int __net_init netlink_net_init(struct net *net)
2154static void __net_exit netlink_net_exit(struct net *net) 2154static void __net_exit netlink_net_exit(struct net *net)
2155{ 2155{
2156#ifdef CONFIG_PROC_FS 2156#ifdef CONFIG_PROC_FS
2157 proc_net_remove(net, "netlink"); 2157 remove_proc_entry("netlink", net->proc_net);
2158#endif 2158#endif
2159} 2159}
2160 2160
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 71b861338407..297b07a029de 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1482,9 +1482,9 @@ static void __exit nr_exit(void)
1482{ 1482{
1483 int i; 1483 int i;
1484 1484
1485 proc_net_remove(&init_net, "nr"); 1485 remove_proc_entry("nr", init_net.proc_net);
1486 proc_net_remove(&init_net, "nr_neigh"); 1486 remove_proc_entry("nr_neigh", init_net.proc_net);
1487 proc_net_remove(&init_net, "nr_nodes"); 1487 remove_proc_entry("nr_nodes", init_net.proc_net);
1488 nr_loopback_clear(); 1488 nr_loopback_clear();
1489 1489
1490 nr_rt_free(); 1490 nr_rt_free();
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index b7b2d56126c4..c7bfeff10767 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3836,7 +3836,7 @@ static int __net_init packet_net_init(struct net *net)
3836 3836
3837static void __net_exit packet_net_exit(struct net *net) 3837static void __net_exit packet_net_exit(struct net *net)
3838{ 3838{
3839 proc_net_remove(net, "packet"); 3839 remove_proc_entry("packet", net->proc_net);
3840} 3840}
3841 3841
3842static struct pernet_operations packet_net_ops = { 3842static struct pernet_operations packet_net_ops = {
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 0e527c9dd041..45a7df6575de 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -331,7 +331,7 @@ static int __net_init phonet_init_net(struct net *net)
331 331
332static void __net_exit phonet_exit_net(struct net *net) 332static void __net_exit phonet_exit_net(struct net *net)
333{ 333{
334 proc_net_remove(net, "phonet"); 334 remove_proc_entry("phonet", net->proc_net);
335} 335}
336 336
337static struct pernet_operations phonet_net_ops = { 337static struct pernet_operations phonet_net_ops = {
@@ -361,7 +361,7 @@ void phonet_device_exit(void)
361 rtnl_unregister_all(PF_PHONET); 361 rtnl_unregister_all(PF_PHONET);
362 unregister_netdevice_notifier(&phonet_device_notifier); 362 unregister_netdevice_notifier(&phonet_device_notifier);
363 unregister_pernet_subsys(&phonet_net_ops); 363 unregister_pernet_subsys(&phonet_net_ops);
364 proc_net_remove(&init_net, "pnresource"); 364 remove_proc_entry("pnresource", init_net.proc_net);
365} 365}
366 366
367int phonet_route_add(struct net_device *dev, u8 daddr) 367int phonet_route_add(struct net_device *dev, u8 daddr)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 5fd8aacbb5ae..b768fe9d5e7a 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1608,10 +1608,10 @@ static void __exit rose_exit(void)
1608{ 1608{
1609 int i; 1609 int i;
1610 1610
1611 proc_net_remove(&init_net, "rose"); 1611 remove_proc_entry("rose", init_net.proc_net);
1612 proc_net_remove(&init_net, "rose_neigh"); 1612 remove_proc_entry("rose_neigh", init_net.proc_net);
1613 proc_net_remove(&init_net, "rose_nodes"); 1613 remove_proc_entry("rose_nodes", init_net.proc_net);
1614 proc_net_remove(&init_net, "rose_routes"); 1614 remove_proc_entry("rose_routes", init_net.proc_net);
1615 rose_loopback_clear(); 1615 rose_loopback_clear();
1616 1616
1617 rose_rt_free(); 1617 rose_rt_free();
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 59c7c7d59402..e61aa6001c65 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -879,8 +879,8 @@ static void __exit af_rxrpc_exit(void)
879 879
880 _debug("flush scheduled work"); 880 _debug("flush scheduled work");
881 flush_workqueue(rxrpc_workqueue); 881 flush_workqueue(rxrpc_workqueue);
882 proc_net_remove(&init_net, "rxrpc_conns"); 882 remove_proc_entry("rxrpc_conns", init_net.proc_net);
883 proc_net_remove(&init_net, "rxrpc_calls"); 883 remove_proc_entry("rxrpc_calls", init_net.proc_net);
884 destroy_workqueue(rxrpc_workqueue); 884 destroy_workqueue(rxrpc_workqueue);
885 kmem_cache_destroy(rxrpc_call_jar); 885 kmem_cache_destroy(rxrpc_call_jar);
886 _leave(""); 886 _leave("");
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index d8cf7d3dfe8c..a181b484812a 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1777,7 +1777,7 @@ static int __net_init psched_net_init(struct net *net)
1777 1777
1778static void __net_exit psched_net_exit(struct net *net) 1778static void __net_exit psched_net_exit(struct net *net)
1779{ 1779{
1780 proc_net_remove(net, "psched"); 1780 remove_proc_entry("psched", net->proc_net);
1781} 1781}
1782#else 1782#else
1783static int __net_init psched_net_init(struct net *net) 1783static int __net_init psched_net_init(struct net *net)
diff --git a/net/sctp/probe.c b/net/sctp/probe.c
index dd507f5ca8e7..ad0dba870341 100644
--- a/net/sctp/probe.c
+++ b/net/sctp/probe.c
@@ -208,7 +208,7 @@ static __init int sctpprobe_init(void)
208 return 0; 208 return 0;
209 209
210remove_proc: 210remove_proc:
211 proc_net_remove(&init_net, procname); 211 remove_proc_entry(procname, init_net.proc_net);
212free_kfifo: 212free_kfifo:
213 kfifo_free(&sctpw.fifo); 213 kfifo_free(&sctpw.fifo);
214 return ret; 214 return ret;
@@ -217,7 +217,7 @@ free_kfifo:
217static __exit void sctpprobe_exit(void) 217static __exit void sctpprobe_exit(void)
218{ 218{
219 kfifo_free(&sctpw.fifo); 219 kfifo_free(&sctpw.fifo);
220 proc_net_remove(&init_net, procname); 220 remove_proc_entry(procname, init_net.proc_net);
221 unregister_jprobe(&sctp_recv_probe); 221 unregister_jprobe(&sctp_recv_probe);
222} 222}
223 223
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0c479b6f407c..87d284289012 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2415,7 +2415,7 @@ out:
2415static void __net_exit unix_net_exit(struct net *net) 2415static void __net_exit unix_net_exit(struct net *net)
2416{ 2416{
2417 unix_sysctl_unregister(net); 2417 unix_sysctl_unregister(net);
2418 proc_net_remove(net, "unix"); 2418 remove_proc_entry("unix", net->proc_net);
2419} 2419}
2420 2420
2421static struct pernet_operations unix_net_ops = { 2421static struct pernet_operations unix_net_ops = {
diff --git a/net/wireless/wext-proc.c b/net/wireless/wext-proc.c
index 00fc5bb3fb63..e98a01c1034f 100644
--- a/net/wireless/wext-proc.c
+++ b/net/wireless/wext-proc.c
@@ -152,5 +152,5 @@ int __net_init wext_proc_init(struct net *net)
152 152
153void __net_exit wext_proc_exit(struct net *net) 153void __net_exit wext_proc_exit(struct net *net)
154{ 154{
155 proc_net_remove(net, "wireless"); 155 remove_proc_entry("wireless", net->proc_net);
156} 156}
diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c
index 9abe14fb59b5..c721b0d9ab8b 100644
--- a/net/xfrm/xfrm_proc.c
+++ b/net/xfrm/xfrm_proc.c
@@ -82,5 +82,5 @@ int __net_init xfrm_proc_init(struct net *net)
82 82
83void xfrm_proc_fini(struct net *net) 83void xfrm_proc_fini(struct net *net)
84{ 84{
85 proc_net_remove(net, "xfrm_stat"); 85 remove_proc_entry("xfrm_stat", net->proc_net);
86} 86}