aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-09-12 06:01:34 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:06 -0400
commit457c4cbc5a3dde259d2a1f15d5f9785290397267 (patch)
treea2ceee88780cbce27433b9a4434b3e9251efd81a
parent07feaebfcc10cd35e745c7073667935246494bee (diff)
[NET]: Make /proc/net per network namespace
This patch makes /proc/net per network namespace. It modifies the global variables proc_net and proc_net_stat to be per network namespace. The proc_net file helpers are modified to take a network namespace argument, and all of their callers are fixed to pass &init_net for that argument. This ensures that all of the /proc/net files are only visible and usable in the initial network namespace until the code behind them has been updated to be handle multiple network namespaces. Making /proc/net per namespace is necessary as at least some files in /proc/net depend upon the set of network devices which is per network namespace, and even more files in /proc/net have contents that are relevant to a single network namespace. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/divert/divert_procfs.c7
-rw-r--r--drivers/isdn/hardware/eicon/diva_didd.c5
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c5
-rw-r--r--drivers/net/bonding/bond_main.c7
-rw-r--r--drivers/net/hamradio/bpqether.c5
-rw-r--r--drivers/net/hamradio/scc.c5
-rw-r--r--drivers/net/hamradio/yam.c5
-rw-r--r--drivers/net/ibmveth.c7
-rw-r--r--drivers/net/pppoe.c5
-rw-r--r--drivers/net/pppol2tp.c5
-rw-r--r--drivers/net/tokenring/lanstreamer.c5
-rw-r--r--drivers/net/tokenring/olympic.c9
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c7
-rw-r--r--drivers/net/wireless/strip.c5
-rw-r--r--fs/proc/Makefile1
-rw-r--r--fs/proc/internal.h5
-rw-r--r--fs/proc/root.c8
-rw-r--r--include/linux/proc_fs.h44
-rw-r--r--include/net/net_namespace.h5
-rw-r--r--net/802/tr.c3
-rw-r--r--net/8021q/vlanproc.c5
-rw-r--r--net/appletalk/atalk_proc.c7
-rw-r--r--net/atm/proc.c5
-rw-r--r--net/ax25/af_ax25.c13
-rw-r--r--net/core/dev.c19
-rw-r--r--net/core/dev_mcast.c3
-rw-r--r--net/core/neighbour.c3
-rw-r--r--net/core/pktgen.c9
-rw-r--r--net/core/sock.c3
-rw-r--r--net/dccp/probe.c7
-rw-r--r--net/decnet/af_decnet.c5
-rw-r--r--net/decnet/dn_dev.c5
-rw-r--r--net/decnet/dn_neigh.c5
-rw-r--r--net/decnet/dn_route.c5
-rw-r--r--net/ieee80211/ieee80211_module.c7
-rw-r--r--net/ipv4/arp.c3
-rw-r--r--net/ipv4/fib_hash.c5
-rw-r--r--net/ipv4/fib_trie.c17
-rw-r--r--net/ipv4/igmp.c5
-rw-r--r--net/ipv4/ipconfig.c3
-rw-r--r--net/ipv4/ipmr.c5
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c5
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c5
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c9
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c5
-rw-r--r--net/ipv4/netfilter/ip_queue.c8
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c3
-rw-r--r--net/ipv4/netfilter/ipt_recent.c5
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c17
-rw-r--r--net/ipv4/proc.c11
-rw-r--r--net/ipv4/raw.c5
-rw-r--r--net/ipv4/route.c7
-rw-r--r--net/ipv4/tcp_ipv4.c5
-rw-r--r--net/ipv4/tcp_probe.c7
-rw-r--r--net/ipv4/udp.c5
-rw-r--r--net/ipv6/addrconf.c7
-rw-r--r--net/ipv6/anycast.c5
-rw-r--r--net/ipv6/ip6_flowlabel.c5
-rw-r--r--net/ipv6/mcast.c9
-rw-r--r--net/ipv6/netfilter/ip6_queue.c7
-rw-r--r--net/ipv6/proc.c17
-rw-r--r--net/ipv6/raw.c5
-rw-r--r--net/ipv6/route.c9
-rw-r--r--net/ipx/ipx_proc.c7
-rw-r--r--net/irda/irproc.c5
-rw-r--r--net/key/af_key.c5
-rw-r--r--net/llc/llc_proc.c7
-rw-r--r--net/netfilter/core.c3
-rw-r--r--net/netfilter/nf_conntrack_expect.c5
-rw-r--r--net/netfilter/nf_conntrack_standalone.c13
-rw-r--r--net/netfilter/x_tables.c17
-rw-r--r--net/netfilter/xt_hashlimit.c11
-rw-r--r--net/netlink/af_netlink.c3
-rw-r--r--net/netrom/af_netrom.c13
-rw-r--r--net/packet/af_packet.c5
-rw-r--r--net/rose/af_rose.c17
-rw-r--r--net/rxrpc/af_rxrpc.c9
-rw-r--r--net/sched/sch_api.c3
-rw-r--r--net/sctp/protocol.c5
-rw-r--r--net/sunrpc/stats.c5
-rw-r--r--net/unix/af_unix.c5
-rw-r--r--net/wanrouter/wanproc.c7
-rw-r--r--net/wireless/wext.c3
-rw-r--r--net/x25/x25_proc.c7
84 files changed, 342 insertions, 261 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 559a0d0244cf..4fd4c46892e3 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -17,6 +17,7 @@
17#include <linux/fs.h> 17#include <linux/fs.h>
18#endif 18#endif
19#include <linux/isdnif.h> 19#include <linux/isdnif.h>
20#include <net/net_namespace.h>
20#include "isdn_divert.h" 21#include "isdn_divert.h"
21 22
22 23
@@ -284,12 +285,12 @@ divert_dev_init(void)
284 init_waitqueue_head(&rd_queue); 285 init_waitqueue_head(&rd_queue);
285 286
286#ifdef CONFIG_PROC_FS 287#ifdef CONFIG_PROC_FS
287 isdn_proc_entry = proc_mkdir("net/isdn", NULL); 288 isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net);
288 if (!isdn_proc_entry) 289 if (!isdn_proc_entry)
289 return (-1); 290 return (-1);
290 isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry); 291 isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry);
291 if (!isdn_divert_entry) { 292 if (!isdn_divert_entry) {
292 remove_proc_entry("net/isdn", NULL); 293 remove_proc_entry("isdn", init_net.proc_net);
293 return (-1); 294 return (-1);
294 } 295 }
295 isdn_divert_entry->proc_fops = &isdn_fops; 296 isdn_divert_entry->proc_fops = &isdn_fops;
@@ -309,7 +310,7 @@ divert_dev_deinit(void)
309 310
310#ifdef CONFIG_PROC_FS 311#ifdef CONFIG_PROC_FS
311 remove_proc_entry("divert", isdn_proc_entry); 312 remove_proc_entry("divert", isdn_proc_entry);
312 remove_proc_entry("net/isdn", NULL); 313 remove_proc_entry("isdn", init_net.proc_net);
313#endif /* CONFIG_PROC_FS */ 314#endif /* CONFIG_PROC_FS */
314 315
315 return (0); 316 return (0);
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c
index d755d904e62c..993b14cf1778 100644
--- a/drivers/isdn/hardware/eicon/diva_didd.c
+++ b/drivers/isdn/hardware/eicon/diva_didd.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
18#include <net/net_namespace.h>
18 19
19#include "platform.h" 20#include "platform.h"
20#include "di_defs.h" 21#include "di_defs.h"
@@ -86,7 +87,7 @@ proc_read(char *page, char **start, off_t off, int count, int *eof,
86 87
87static int DIVA_INIT_FUNCTION create_proc(void) 88static int DIVA_INIT_FUNCTION create_proc(void)
88{ 89{
89 proc_net_eicon = proc_mkdir("net/eicon", NULL); 90 proc_net_eicon = proc_mkdir("eicon", init_net.proc_net);
90 91
91 if (proc_net_eicon) { 92 if (proc_net_eicon) {
92 if ((proc_didd = 93 if ((proc_didd =
@@ -102,7 +103,7 @@ static int DIVA_INIT_FUNCTION create_proc(void)
102static void remove_proc(void) 103static void remove_proc(void)
103{ 104{
104 remove_proc_entry(DRIVERLNAME, proc_net_eicon); 105 remove_proc_entry(DRIVERLNAME, proc_net_eicon);
105 remove_proc_entry("net/eicon", NULL); 106 remove_proc_entry("eicon", init_net.proc_net);
106} 107}
107 108
108static int DIVA_INIT_FUNCTION divadidd_init(void) 109static int DIVA_INIT_FUNCTION divadidd_init(void)
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index dc477e0aab0e..27d890b48f88 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -16,6 +16,7 @@
16#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
17#include <linux/pci.h> 17#include <linux/pci.h>
18#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
19#include <net/net_namespace.h>
19 20
20#include "hysdn_defs.h" 21#include "hysdn_defs.h"
21 22
@@ -392,7 +393,7 @@ hysdn_procconf_init(void)
392 hysdn_card *card; 393 hysdn_card *card;
393 unsigned char conf_name[20]; 394 unsigned char conf_name[20];
394 395
395 hysdn_proc_entry = proc_mkdir(PROC_SUBDIR_NAME, proc_net); 396 hysdn_proc_entry = proc_mkdir(PROC_SUBDIR_NAME, init_net.proc_net);
396 if (!hysdn_proc_entry) { 397 if (!hysdn_proc_entry) {
397 printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); 398 printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n");
398 return (-1); 399 return (-1);
@@ -437,5 +438,5 @@ hysdn_procconf_release(void)
437 card = card->next; /* point to next card */ 438 card = card->next; /* point to next card */
438 } 439 }
439 440
440 remove_proc_entry(PROC_SUBDIR_NAME, proc_net); 441 remove_proc_entry(PROC_SUBDIR_NAME, init_net.proc_net);
441} 442}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1afda3230def..5de648f90a45 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -75,6 +75,7 @@
75#include <linux/if_vlan.h> 75#include <linux/if_vlan.h>
76#include <linux/if_bonding.h> 76#include <linux/if_bonding.h>
77#include <net/route.h> 77#include <net/route.h>
78#include <net/net_namespace.h>
78#include "bonding.h" 79#include "bonding.h"
79#include "bond_3ad.h" 80#include "bond_3ad.h"
80#include "bond_alb.h" 81#include "bond_alb.h"
@@ -3144,7 +3145,7 @@ static void bond_create_proc_dir(void)
3144{ 3145{
3145 int len = strlen(DRV_NAME); 3146 int len = strlen(DRV_NAME);
3146 3147
3147 for (bond_proc_dir = proc_net->subdir; bond_proc_dir; 3148 for (bond_proc_dir = init_net.proc_net->subdir; bond_proc_dir;
3148 bond_proc_dir = bond_proc_dir->next) { 3149 bond_proc_dir = bond_proc_dir->next) {
3149 if ((bond_proc_dir->namelen == len) && 3150 if ((bond_proc_dir->namelen == len) &&
3150 !memcmp(bond_proc_dir->name, DRV_NAME, len)) { 3151 !memcmp(bond_proc_dir->name, DRV_NAME, len)) {
@@ -3153,7 +3154,7 @@ static void bond_create_proc_dir(void)
3153 } 3154 }
3154 3155
3155 if (!bond_proc_dir) { 3156 if (!bond_proc_dir) {
3156 bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); 3157 bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net);
3157 if (bond_proc_dir) { 3158 if (bond_proc_dir) {
3158 bond_proc_dir->owner = THIS_MODULE; 3159 bond_proc_dir->owner = THIS_MODULE;
3159 } else { 3160 } else {
@@ -3188,7 +3189,7 @@ static void bond_destroy_proc_dir(void)
3188 bond_proc_dir->owner = NULL; 3189 bond_proc_dir->owner = NULL;
3189 } 3190 }
3190 } else { 3191 } else {
3191 remove_proc_entry(DRV_NAME, proc_net); 3192 remove_proc_entry(DRV_NAME, init_net.proc_net);
3192 bond_proc_dir = NULL; 3193 bond_proc_dir = NULL;
3193 } 3194 }
3194} 3195}
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index cc0ee93669ea..1699d42d13ca 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -83,6 +83,7 @@
83 83
84#include <net/ip.h> 84#include <net/ip.h>
85#include <net/arp.h> 85#include <net/arp.h>
86#include <net/net_namespace.h>
86 87
87#include <linux/bpqether.h> 88#include <linux/bpqether.h>
88 89
@@ -594,7 +595,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi
594static int __init bpq_init_driver(void) 595static int __init bpq_init_driver(void)
595{ 596{
596#ifdef CONFIG_PROC_FS 597#ifdef CONFIG_PROC_FS
597 if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) { 598 if (!proc_net_fops_create(&init_net, "bpqether", S_IRUGO, &bpq_info_fops)) {
598 printk(KERN_ERR 599 printk(KERN_ERR
599 "bpq: cannot create /proc/net/bpqether entry.\n"); 600 "bpq: cannot create /proc/net/bpqether entry.\n");
600 return -ENOENT; 601 return -ENOENT;
@@ -618,7 +619,7 @@ static void __exit bpq_cleanup_driver(void)
618 619
619 unregister_netdevice_notifier(&bpq_dev_notifier); 620 unregister_netdevice_notifier(&bpq_dev_notifier);
620 621
621 proc_net_remove("bpqether"); 622 proc_net_remove(&init_net, "bpqether");
622 623
623 rtnl_lock(); 624 rtnl_lock();
624 while (!list_empty(&bpq_devices)) { 625 while (!list_empty(&bpq_devices)) {
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 6fdaad5a4577..39b3b82aa4a4 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -174,6 +174,7 @@
174#include <linux/seq_file.h> 174#include <linux/seq_file.h>
175#include <linux/bitops.h> 175#include <linux/bitops.h>
176 176
177#include <net/net_namespace.h>
177#include <net/ax25.h> 178#include <net/ax25.h>
178 179
179#include <asm/irq.h> 180#include <asm/irq.h>
@@ -2114,7 +2115,7 @@ static int __init scc_init_driver (void)
2114 } 2115 }
2115 rtnl_unlock(); 2116 rtnl_unlock();
2116 2117
2117 proc_net_fops_create("z8530drv", 0, &scc_net_seq_fops); 2118 proc_net_fops_create(&init_net, "z8530drv", 0, &scc_net_seq_fops);
2118 2119
2119 return 0; 2120 return 0;
2120} 2121}
@@ -2169,7 +2170,7 @@ static void __exit scc_cleanup_driver(void)
2169 if (Vector_Latch) 2170 if (Vector_Latch)
2170 release_region(Vector_Latch, 1); 2171 release_region(Vector_Latch, 1);
2171 2172
2172 proc_net_remove("z8530drv"); 2173 proc_net_remove(&init_net, "z8530drv");
2173} 2174}
2174 2175
2175MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>"); 2176MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>");
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 467559debfd6..401724ddafcd 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -65,6 +65,7 @@
65#include <linux/kernel.h> 65#include <linux/kernel.h>
66#include <linux/proc_fs.h> 66#include <linux/proc_fs.h>
67#include <linux/seq_file.h> 67#include <linux/seq_file.h>
68#include <net/net_namespace.h>
68 69
69#include <asm/uaccess.h> 70#include <asm/uaccess.h>
70#include <linux/init.h> 71#include <linux/init.h>
@@ -1142,7 +1143,7 @@ static int __init yam_init_driver(void)
1142 yam_timer.expires = jiffies + HZ / 100; 1143 yam_timer.expires = jiffies + HZ / 100;
1143 add_timer(&yam_timer); 1144 add_timer(&yam_timer);
1144 1145
1145 proc_net_fops_create("yam", S_IRUGO, &yam_info_fops); 1146 proc_net_fops_create(&init_net, "yam", S_IRUGO, &yam_info_fops);
1146 return 0; 1147 return 0;
1147 error: 1148 error:
1148 while (--i >= 0) { 1149 while (--i >= 0) {
@@ -1174,7 +1175,7 @@ static void __exit yam_cleanup_driver(void)
1174 kfree(p); 1175 kfree(p);
1175 } 1176 }
1176 1177
1177 proc_net_remove("yam"); 1178 proc_net_remove(&init_net, "yam");
1178} 1179}
1179 1180
1180/* --------------------------------------------------------------------- */ 1181/* --------------------------------------------------------------------- */
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 78e28ada1e21..0c35d72f5f8d 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -47,6 +47,7 @@
47#include <linux/mm.h> 47#include <linux/mm.h>
48#include <linux/ethtool.h> 48#include <linux/ethtool.h>
49#include <linux/proc_fs.h> 49#include <linux/proc_fs.h>
50#include <net/net_namespace.h>
50#include <asm/semaphore.h> 51#include <asm/semaphore.h>
51#include <asm/hvcall.h> 52#include <asm/hvcall.h>
52#include <asm/atomic.h> 53#include <asm/atomic.h>
@@ -97,7 +98,7 @@ static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter);
97static struct kobj_type ktype_veth_pool; 98static struct kobj_type ktype_veth_pool;
98 99
99#ifdef CONFIG_PROC_FS 100#ifdef CONFIG_PROC_FS
100#define IBMVETH_PROC_DIR "net/ibmveth" 101#define IBMVETH_PROC_DIR "ibmveth"
101static struct proc_dir_entry *ibmveth_proc_dir; 102static struct proc_dir_entry *ibmveth_proc_dir;
102#endif 103#endif
103 104
@@ -1091,7 +1092,7 @@ static int __devexit ibmveth_remove(struct vio_dev *dev)
1091#ifdef CONFIG_PROC_FS 1092#ifdef CONFIG_PROC_FS
1092static void ibmveth_proc_register_driver(void) 1093static void ibmveth_proc_register_driver(void)
1093{ 1094{
1094 ibmveth_proc_dir = proc_mkdir(IBMVETH_PROC_DIR, NULL); 1095 ibmveth_proc_dir = proc_mkdir(IBMVETH_PROC_DIR, init_net.proc_net);
1095 if (ibmveth_proc_dir) { 1096 if (ibmveth_proc_dir) {
1096 SET_MODULE_OWNER(ibmveth_proc_dir); 1097 SET_MODULE_OWNER(ibmveth_proc_dir);
1097 } 1098 }
@@ -1099,7 +1100,7 @@ static void ibmveth_proc_register_driver(void)
1099 1100
1100static void ibmveth_proc_unregister_driver(void) 1101static void ibmveth_proc_unregister_driver(void)
1101{ 1102{
1102 remove_proc_entry(IBMVETH_PROC_DIR, NULL); 1103 remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net);
1103} 1104}
1104 1105
1105static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos) 1106static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos)
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 9b30cd600a64..ee8ce195c538 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -78,6 +78,7 @@
78#include <linux/proc_fs.h> 78#include <linux/proc_fs.h>
79#include <linux/seq_file.h> 79#include <linux/seq_file.h>
80 80
81#include <net/net_namespace.h>
81#include <net/sock.h> 82#include <net/sock.h>
82 83
83#include <asm/uaccess.h> 84#include <asm/uaccess.h>
@@ -1042,7 +1043,7 @@ static int __init pppoe_proc_init(void)
1042{ 1043{
1043 struct proc_dir_entry *p; 1044 struct proc_dir_entry *p;
1044 1045
1045 p = create_proc_entry("net/pppoe", S_IRUGO, NULL); 1046 p = create_proc_entry("pppoe", S_IRUGO, init_net.proc_net);
1046 if (!p) 1047 if (!p)
1047 return -ENOMEM; 1048 return -ENOMEM;
1048 1049
@@ -1113,7 +1114,7 @@ static void __exit pppoe_exit(void)
1113 dev_remove_pack(&pppoes_ptype); 1114 dev_remove_pack(&pppoes_ptype);
1114 dev_remove_pack(&pppoed_ptype); 1115 dev_remove_pack(&pppoed_ptype);
1115 unregister_netdevice_notifier(&pppoe_notifier); 1116 unregister_netdevice_notifier(&pppoe_notifier);
1116 remove_proc_entry("net/pppoe", NULL); 1117 remove_proc_entry("pppoe", init_net.proc_net);
1117 proto_unregister(&pppoe_sk_proto); 1118 proto_unregister(&pppoe_sk_proto);
1118} 1119}
1119 1120
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index abe91cb595f4..2eb424ba58e5 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -91,6 +91,7 @@
91#include <linux/hash.h> 91#include <linux/hash.h>
92#include <linux/sort.h> 92#include <linux/sort.h>
93#include <linux/proc_fs.h> 93#include <linux/proc_fs.h>
94#include <net/net_namespace.h>
94#include <net/dst.h> 95#include <net/dst.h>
95#include <net/ip.h> 96#include <net/ip.h>
96#include <net/udp.h> 97#include <net/udp.h>
@@ -2444,7 +2445,7 @@ static int __init pppol2tp_init(void)
2444 goto out_unregister_pppol2tp_proto; 2445 goto out_unregister_pppol2tp_proto;
2445 2446
2446#ifdef CONFIG_PROC_FS 2447#ifdef CONFIG_PROC_FS
2447 pppol2tp_proc = create_proc_entry("pppol2tp", 0, proc_net); 2448 pppol2tp_proc = create_proc_entry("pppol2tp", 0, init_net.proc_net);
2448 if (!pppol2tp_proc) { 2449 if (!pppol2tp_proc) {
2449 err = -ENOMEM; 2450 err = -ENOMEM;
2450 goto out_unregister_pppox_proto; 2451 goto out_unregister_pppox_proto;
@@ -2469,7 +2470,7 @@ static void __exit pppol2tp_exit(void)
2469 unregister_pppox_proto(PX_PROTO_OL2TP); 2470 unregister_pppox_proto(PX_PROTO_OL2TP);
2470 2471
2471#ifdef CONFIG_PROC_FS 2472#ifdef CONFIG_PROC_FS
2472 remove_proc_entry("pppol2tp", proc_net); 2473 remove_proc_entry("pppol2tp", init_net.proc_net);
2473#endif 2474#endif
2474 proto_unregister(&pppol2tp_sk_proto); 2475 proto_unregister(&pppol2tp_sk_proto);
2475} 2476}
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 5d849c089a3b..fc4495581f96 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -123,6 +123,7 @@
123#include <linux/bitops.h> 123#include <linux/bitops.h>
124#include <linux/jiffies.h> 124#include <linux/jiffies.h>
125 125
126#include <net/net_namespace.h>
126#include <net/checksum.h> 127#include <net/checksum.h>
127 128
128#include <asm/io.h> 129#include <asm/io.h>
@@ -250,7 +251,7 @@ static int __devinit streamer_init_one(struct pci_dev *pdev,
250#if STREAMER_NETWORK_MONITOR 251#if STREAMER_NETWORK_MONITOR
251#ifdef CONFIG_PROC_FS 252#ifdef CONFIG_PROC_FS
252 if (!dev_streamer) 253 if (!dev_streamer)
253 create_proc_read_entry("net/streamer_tr", 0, 0, 254 create_proc_read_entry("streamer_tr", 0, init_net.proc_net,
254 streamer_proc_info, NULL); 255 streamer_proc_info, NULL);
255 streamer_priv->next = dev_streamer; 256 streamer_priv->next = dev_streamer;
256 dev_streamer = streamer_priv; 257 dev_streamer = streamer_priv;
@@ -423,7 +424,7 @@ static void __devexit streamer_remove_one(struct pci_dev *pdev)
423 } 424 }
424 } 425 }
425 if (!dev_streamer) 426 if (!dev_streamer)
426 remove_proc_entry("net/streamer_tr", NULL); 427 remove_proc_entry("streamer_tr", init_net.proc_net);
427 } 428 }
428#endif 429#endif
429#endif 430#endif
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 09b3cfb8e809..c323101a895b 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -102,6 +102,7 @@
102#include <linux/jiffies.h> 102#include <linux/jiffies.h>
103 103
104#include <net/checksum.h> 104#include <net/checksum.h>
105#include <net/net_namespace.h>
105 106
106#include <asm/io.h> 107#include <asm/io.h>
107#include <asm/system.h> 108#include <asm/system.h>
@@ -268,9 +269,9 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
268 printk("Olympic: %s registered as: %s\n",olympic_priv->olympic_card_name,dev->name); 269 printk("Olympic: %s registered as: %s\n",olympic_priv->olympic_card_name,dev->name);
269 if (olympic_priv->olympic_network_monitor) { /* Must go after register_netdev as we need the device name */ 270 if (olympic_priv->olympic_network_monitor) { /* Must go after register_netdev as we need the device name */
270 char proc_name[20] ; 271 char proc_name[20] ;
271 strcpy(proc_name,"net/olympic_") ; 272 strcpy(proc_name,"olympic_") ;
272 strcat(proc_name,dev->name) ; 273 strcat(proc_name,dev->name) ;
273 create_proc_read_entry(proc_name,0,NULL,olympic_proc_info,(void *)dev) ; 274 create_proc_read_entry(proc_name,0,init_net.proc_net,olympic_proc_info,(void *)dev) ;
274 printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); 275 printk("Olympic: Network Monitor information: /proc/%s\n",proc_name);
275 } 276 }
276 return 0 ; 277 return 0 ;
@@ -1752,9 +1753,9 @@ static void __devexit olympic_remove_one(struct pci_dev *pdev)
1752 1753
1753 if (olympic_priv->olympic_network_monitor) { 1754 if (olympic_priv->olympic_network_monitor) {
1754 char proc_name[20] ; 1755 char proc_name[20] ;
1755 strcpy(proc_name,"net/olympic_") ; 1756 strcpy(proc_name,"olympic_") ;
1756 strcat(proc_name,dev->name) ; 1757 strcat(proc_name,dev->name) ;
1757 remove_proc_entry(proc_name,NULL); 1758 remove_proc_entry(proc_name,init_net.proc_net);
1758 } 1759 }
1759 unregister_netdev(dev) ; 1760 unregister_netdev(dev) ;
1760 iounmap(olympic_priv->olympic_mmio) ; 1761 iounmap(olympic_priv->olympic_mmio) ;
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 446de51bab74..9a470e80ca24 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -24,6 +24,7 @@
24#include <linux/rtnetlink.h> 24#include <linux/rtnetlink.h>
25#include <linux/wireless.h> 25#include <linux/wireless.h>
26#include <linux/etherdevice.h> 26#include <linux/etherdevice.h>
27#include <net/net_namespace.h>
27#include <net/iw_handler.h> 28#include <net/iw_handler.h>
28#include <net/ieee80211.h> 29#include <net/ieee80211.h>
29#include <net/ieee80211_crypt.h> 30#include <net/ieee80211_crypt.h>
@@ -1093,8 +1094,8 @@ struct proc_dir_entry *hostap_proc;
1093 1094
1094static int __init hostap_init(void) 1095static int __init hostap_init(void)
1095{ 1096{
1096 if (proc_net != NULL) { 1097 if (init_net.proc_net != NULL) {
1097 hostap_proc = proc_mkdir("hostap", proc_net); 1098 hostap_proc = proc_mkdir("hostap", init_net.proc_net);
1098 if (!hostap_proc) 1099 if (!hostap_proc)
1099 printk(KERN_WARNING "Failed to mkdir " 1100 printk(KERN_WARNING "Failed to mkdir "
1100 "/proc/net/hostap\n"); 1101 "/proc/net/hostap\n");
@@ -1109,7 +1110,7 @@ static void __exit hostap_exit(void)
1109{ 1110{
1110 if (hostap_proc != NULL) { 1111 if (hostap_proc != NULL) {
1111 hostap_proc = NULL; 1112 hostap_proc = NULL;
1112 remove_proc_entry("hostap", proc_net); 1113 remove_proc_entry("hostap", init_net.proc_net);
1113 } 1114 }
1114} 1115}
1115 1116
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index ef32a5c1e818..edb214e8c744 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -107,6 +107,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
107#include <linux/serialP.h> 107#include <linux/serialP.h>
108#include <linux/rcupdate.h> 108#include <linux/rcupdate.h>
109#include <net/arp.h> 109#include <net/arp.h>
110#include <net/net_namespace.h>
110 111
111#include <linux/ip.h> 112#include <linux/ip.h>
112#include <linux/tcp.h> 113#include <linux/tcp.h>
@@ -2787,7 +2788,7 @@ static int __init strip_init_driver(void)
2787 /* 2788 /*
2788 * Register the status file with /proc 2789 * Register the status file with /proc
2789 */ 2790 */
2790 proc_net_fops_create("strip", S_IFREG | S_IRUGO, &strip_seq_fops); 2791 proc_net_fops_create(&init_net, "strip", S_IFREG | S_IRUGO, &strip_seq_fops);
2791 2792
2792 return status; 2793 return status;
2793} 2794}
@@ -2809,7 +2810,7 @@ static void __exit strip_exit_driver(void)
2809 } 2810 }
2810 2811
2811 /* Unregister with the /proc/net file here. */ 2812 /* Unregister with the /proc/net file here. */
2812 proc_net_remove("strip"); 2813 proc_net_remove(&init_net, "strip");
2813 2814
2814 if ((i = tty_unregister_ldisc(N_STRIP))) 2815 if ((i = tty_unregister_ldisc(N_STRIP)))
2815 printk(KERN_ERR "STRIP: can't unregister line discipline (err = %d)\n", i); 2816 printk(KERN_ERR "STRIP: can't unregister line discipline (err = %d)\n", i);
diff --git a/fs/proc/Makefile b/fs/proc/Makefile
index bce38e3f06cb..ebaba0213546 100644
--- a/fs/proc/Makefile
+++ b/fs/proc/Makefile
@@ -11,6 +11,7 @@ proc-y += inode.o root.o base.o generic.o array.o \
11 proc_tty.o proc_misc.o 11 proc_tty.o proc_misc.o
12 12
13proc-$(CONFIG_PROC_SYSCTL) += proc_sysctl.o 13proc-$(CONFIG_PROC_SYSCTL) += proc_sysctl.o
14proc-$(CONFIG_NET) += proc_net.o
14proc-$(CONFIG_PROC_KCORE) += kcore.o 15proc-$(CONFIG_PROC_KCORE) += kcore.o
15proc-$(CONFIG_PROC_VMCORE) += vmcore.o 16proc-$(CONFIG_PROC_VMCORE) += vmcore.o
16proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o 17proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index b215c3524fa6..1820eb2ef762 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -16,6 +16,11 @@ extern int proc_sys_init(void);
16#else 16#else
17static inline void proc_sys_init(void) { } 17static inline void proc_sys_init(void) { }
18#endif 18#endif
19#ifdef CONFIG_NET
20extern int proc_net_init(void);
21#else
22static inline int proc_net_init(void) { return 0; }
23#endif
19 24
20struct vmalloc_info { 25struct vmalloc_info {
21 unsigned long used; 26 unsigned long used;
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 41f17037f738..cf3046638b09 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -21,7 +21,7 @@
21 21
22#include "internal.h" 22#include "internal.h"
23 23
24struct proc_dir_entry *proc_net, *proc_net_stat, *proc_bus, *proc_root_fs, *proc_root_driver; 24struct proc_dir_entry *proc_bus, *proc_root_fs, *proc_root_driver;
25 25
26static int proc_get_sb(struct file_system_type *fs_type, 26static int proc_get_sb(struct file_system_type *fs_type,
27 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 27 int flags, const char *dev_name, void *data, struct vfsmount *mnt)
@@ -61,8 +61,8 @@ void __init proc_root_init(void)
61 return; 61 return;
62 } 62 }
63 proc_misc_init(); 63 proc_misc_init();
64 proc_net = proc_mkdir("net", NULL); 64
65 proc_net_stat = proc_mkdir("net/stat", NULL); 65 proc_net_init();
66 66
67#ifdef CONFIG_SYSVIPC 67#ifdef CONFIG_SYSVIPC
68 proc_mkdir("sysvipc", NULL); 68 proc_mkdir("sysvipc", NULL);
@@ -159,7 +159,5 @@ EXPORT_SYMBOL(create_proc_entry);
159EXPORT_SYMBOL(remove_proc_entry); 159EXPORT_SYMBOL(remove_proc_entry);
160EXPORT_SYMBOL(proc_root); 160EXPORT_SYMBOL(proc_root);
161EXPORT_SYMBOL(proc_root_fs); 161EXPORT_SYMBOL(proc_root_fs);
162EXPORT_SYMBOL(proc_net);
163EXPORT_SYMBOL(proc_net_stat);
164EXPORT_SYMBOL(proc_bus); 162EXPORT_SYMBOL(proc_bus);
165EXPORT_SYMBOL(proc_root_driver); 163EXPORT_SYMBOL(proc_root_driver);
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index cd13a78c5db8..59646705f151 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -7,6 +7,7 @@
7#include <linux/magic.h> 7#include <linux/magic.h>
8#include <asm/atomic.h> 8#include <asm/atomic.h>
9 9
10struct net;
10struct completion; 11struct completion;
11 12
12/* 13/*
@@ -97,8 +98,6 @@ struct vmcore {
97 98
98extern struct proc_dir_entry proc_root; 99extern struct proc_dir_entry proc_root;
99extern struct proc_dir_entry *proc_root_fs; 100extern struct proc_dir_entry *proc_root_fs;
100extern struct proc_dir_entry *proc_net;
101extern struct proc_dir_entry *proc_net_stat;
102extern struct proc_dir_entry *proc_bus; 101extern struct proc_dir_entry *proc_bus;
103extern struct proc_dir_entry *proc_root_driver; 102extern struct proc_dir_entry *proc_root_driver;
104extern struct proc_dir_entry *proc_root_kcore; 103extern struct proc_dir_entry *proc_root_kcore;
@@ -192,36 +191,21 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
192 if (res) res->get_info=get_info; 191 if (res) res->get_info=get_info;
193 return res; 192 return res;
194} 193}
195
196static inline struct proc_dir_entry *proc_net_create(const char *name,
197 mode_t mode, get_info_t *get_info)
198{
199 return create_proc_info_entry(name,mode,proc_net,get_info);
200}
201 194
202static inline struct proc_dir_entry *proc_net_fops_create(const char *name, 195extern struct proc_dir_entry *proc_net_create(struct net *net,
203 mode_t mode, const struct file_operations *fops) 196 const char *name, mode_t mode, get_info_t *get_info);
204{ 197extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
205 struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); 198 const char *name, mode_t mode, const struct file_operations *fops);
206 if (res) 199extern void proc_net_remove(struct net *net, const char *name);
207 res->proc_fops = fops;
208 return res;
209}
210
211static inline void proc_net_remove(const char *name)
212{
213 remove_proc_entry(name,proc_net);
214}
215 200
216#else 201#else
217 202
218#define proc_root_driver NULL 203#define proc_root_driver NULL
219#define proc_net NULL
220#define proc_bus NULL 204#define proc_bus NULL
221 205
222#define proc_net_fops_create(name, mode, fops) ({ (void)(mode), NULL; }) 206#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
223#define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) 207#define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; })
224static inline void proc_net_remove(const char *name) {} 208static inline void proc_net_remove(struct net *net, const char *name) {}
225 209
226static inline void proc_flush_task(struct task_struct *task) { } 210static inline void proc_flush_task(struct task_struct *task) { }
227 211
@@ -281,6 +265,16 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode)
281 return PROC_I(inode)->pde; 265 return PROC_I(inode)->pde;
282} 266}
283 267
268static inline struct net *PDE_NET(struct proc_dir_entry *pde)
269{
270 return pde->parent->data;
271}
272
273static inline struct net *PROC_NET(const struct inode *inode)
274{
275 return PDE_NET(PDE(inode));
276}
277
284struct proc_maps_private { 278struct proc_maps_private {
285 struct pid *pid; 279 struct pid *pid;
286 struct task_struct *task; 280 struct task_struct *task;
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 6344b77f81a2..547247681345 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -8,6 +8,7 @@
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9#include <linux/list.h> 9#include <linux/list.h>
10 10
11struct proc_dir_entry;
11struct net { 12struct net {
12 atomic_t count; /* To decided when the network 13 atomic_t count; /* To decided when the network
13 * namespace should be freed. 14 * namespace should be freed.
@@ -17,6 +18,10 @@ struct net {
17 */ 18 */
18 struct list_head list; /* list of network namespaces */ 19 struct list_head list; /* list of network namespaces */
19 struct work_struct work; /* work struct for freeing */ 20 struct work_struct work; /* work struct for freeing */
21
22 struct proc_dir_entry *proc_net;
23 struct proc_dir_entry *proc_net_stat;
24 struct proc_dir_entry *proc_net_root;
20}; 25};
21 26
22extern struct net init_net; 27extern struct net init_net;
diff --git a/net/802/tr.c b/net/802/tr.c
index e56e61a7f545..032c31e748eb 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -36,6 +36,7 @@
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/init.h> 37#include <linux/init.h>
38#include <net/arp.h> 38#include <net/arp.h>
39#include <net/net_namespace.h>
39 40
40static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev); 41static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev);
41static void rif_check_expire(unsigned long dummy); 42static void rif_check_expire(unsigned long dummy);
@@ -639,7 +640,7 @@ static int __init rif_init(void)
639 rif_timer.function = rif_check_expire; 640 rif_timer.function = rif_check_expire;
640 add_timer(&rif_timer); 641 add_timer(&rif_timer);
641 642
642 proc_net_fops_create("tr_rif", S_IRUGO, &rif_seq_fops); 643 proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
643 return 0; 644 return 0;
644} 645}
645 646
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index bd08aa090763..ac80e6b9ef53 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -33,6 +33,7 @@
33#include <linux/fs.h> 33#include <linux/fs.h>
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/if_vlan.h> 35#include <linux/if_vlan.h>
36#include <net/net_namespace.h>
36#include "vlanproc.h" 37#include "vlanproc.h"
37#include "vlan.h" 38#include "vlan.h"
38 39
@@ -143,7 +144,7 @@ void vlan_proc_cleanup(void)
143 remove_proc_entry(name_conf, proc_vlan_dir); 144 remove_proc_entry(name_conf, proc_vlan_dir);
144 145
145 if (proc_vlan_dir) 146 if (proc_vlan_dir)
146 proc_net_remove(name_root); 147 proc_net_remove(&init_net, name_root);
147 148
148 /* Dynamically added entries should be cleaned up as their vlan_device 149 /* Dynamically added entries should be cleaned up as their vlan_device
149 * is removed, so we should not have to take care of it here... 150 * is removed, so we should not have to take care of it here...
@@ -156,7 +157,7 @@ void vlan_proc_cleanup(void)
156 157
157int __init vlan_proc_init(void) 158int __init vlan_proc_init(void)
158{ 159{
159 proc_vlan_dir = proc_mkdir(name_root, proc_net); 160 proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net);
160 if (proc_vlan_dir) { 161 if (proc_vlan_dir) {
161 proc_vlan_conf = create_proc_entry(name_conf, 162 proc_vlan_conf = create_proc_entry(name_conf,
162 S_IFREG|S_IRUSR|S_IWUSR, 163 S_IFREG|S_IRUSR|S_IWUSR,
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index 87a582cc8111..05d9652afcb6 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
13#include <linux/seq_file.h> 13#include <linux/seq_file.h>
14#include <net/net_namespace.h>
14#include <net/sock.h> 15#include <net/sock.h>
15#include <linux/atalk.h> 16#include <linux/atalk.h>
16 17
@@ -271,7 +272,7 @@ int __init atalk_proc_init(void)
271 struct proc_dir_entry *p; 272 struct proc_dir_entry *p;
272 int rc = -ENOMEM; 273 int rc = -ENOMEM;
273 274
274 atalk_proc_dir = proc_mkdir("atalk", proc_net); 275 atalk_proc_dir = proc_mkdir("atalk", init_net.proc_net);
275 if (!atalk_proc_dir) 276 if (!atalk_proc_dir)
276 goto out; 277 goto out;
277 atalk_proc_dir->owner = THIS_MODULE; 278 atalk_proc_dir->owner = THIS_MODULE;
@@ -306,7 +307,7 @@ out_socket:
306out_route: 307out_route:
307 remove_proc_entry("interface", atalk_proc_dir); 308 remove_proc_entry("interface", atalk_proc_dir);
308out_interface: 309out_interface:
309 remove_proc_entry("atalk", proc_net); 310 remove_proc_entry("atalk", init_net.proc_net);
310 goto out; 311 goto out;
311} 312}
312 313
@@ -316,5 +317,5 @@ void __exit atalk_proc_exit(void)
316 remove_proc_entry("route", atalk_proc_dir); 317 remove_proc_entry("route", atalk_proc_dir);
317 remove_proc_entry("socket", atalk_proc_dir); 318 remove_proc_entry("socket", atalk_proc_dir);
318 remove_proc_entry("arp", atalk_proc_dir); 319 remove_proc_entry("arp", atalk_proc_dir);
319 remove_proc_entry("atalk", proc_net); 320 remove_proc_entry("atalk", init_net.proc_net);
320} 321}
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 99fc1fe950ee..3a6be64b0512 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -22,6 +22,7 @@
22#include <linux/netdevice.h> 22#include <linux/netdevice.h>
23#include <linux/atmclip.h> 23#include <linux/atmclip.h>
24#include <linux/init.h> /* for __init */ 24#include <linux/init.h> /* for __init */
25#include <net/net_namespace.h>
25#include <net/atmclip.h> 26#include <net/atmclip.h>
26#include <asm/uaccess.h> 27#include <asm/uaccess.h>
27#include <asm/atomic.h> 28#include <asm/atomic.h>
@@ -475,7 +476,7 @@ static void atm_proc_dirs_remove(void)
475 if (e->dirent) 476 if (e->dirent)
476 remove_proc_entry(e->name, atm_proc_root); 477 remove_proc_entry(e->name, atm_proc_root);
477 } 478 }
478 remove_proc_entry("net/atm", NULL); 479 remove_proc_entry("atm", init_net.proc_net);
479} 480}
480 481
481int __init atm_proc_init(void) 482int __init atm_proc_init(void)
@@ -483,7 +484,7 @@ int __init atm_proc_init(void)
483 static struct atm_proc_entry *e; 484 static struct atm_proc_entry *e;
484 int ret; 485 int ret;
485 486
486 atm_proc_root = proc_mkdir("net/atm",NULL); 487 atm_proc_root = proc_mkdir("atm", init_net.proc_net);
487 if (!atm_proc_root) 488 if (!atm_proc_root)
488 goto err_out; 489 goto err_out;
489 for (e = atm_proc_ents; e->name; e++) { 490 for (e = atm_proc_ents; e->name; e++) {
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index dae2a42d3d86..1d71f85680b8 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -44,6 +44,7 @@
44#include <linux/sysctl.h> 44#include <linux/sysctl.h>
45#include <linux/init.h> 45#include <linux/init.h>
46#include <linux/spinlock.h> 46#include <linux/spinlock.h>
47#include <net/net_namespace.h>
47#include <net/tcp_states.h> 48#include <net/tcp_states.h>
48#include <net/ip.h> 49#include <net/ip.h>
49#include <net/arp.h> 50#include <net/arp.h>
@@ -1998,9 +1999,9 @@ static int __init ax25_init(void)
1998 register_netdevice_notifier(&ax25_dev_notifier); 1999 register_netdevice_notifier(&ax25_dev_notifier);
1999 ax25_register_sysctl(); 2000 ax25_register_sysctl();
2000 2001
2001 proc_net_fops_create("ax25_route", S_IRUGO, &ax25_route_fops); 2002 proc_net_fops_create(&init_net, "ax25_route", S_IRUGO, &ax25_route_fops);
2002 proc_net_fops_create("ax25", S_IRUGO, &ax25_info_fops); 2003 proc_net_fops_create(&init_net, "ax25", S_IRUGO, &ax25_info_fops);
2003 proc_net_fops_create("ax25_calls", S_IRUGO, &ax25_uid_fops); 2004 proc_net_fops_create(&init_net, "ax25_calls", S_IRUGO, &ax25_uid_fops);
2004out: 2005out:
2005 return rc; 2006 return rc;
2006} 2007}
@@ -2014,9 +2015,9 @@ MODULE_ALIAS_NETPROTO(PF_AX25);
2014 2015
2015static void __exit ax25_exit(void) 2016static void __exit ax25_exit(void)
2016{ 2017{
2017 proc_net_remove("ax25_route"); 2018 proc_net_remove(&init_net, "ax25_route");
2018 proc_net_remove("ax25"); 2019 proc_net_remove(&init_net, "ax25");
2019 proc_net_remove("ax25_calls"); 2020 proc_net_remove(&init_net, "ax25_calls");
2020 ax25_rt_free(); 2021 ax25_rt_free();
2021 ax25_uid_free(); 2022 ax25_uid_free();
2022 ax25_dev_free(); 2023 ax25_dev_free();
diff --git a/net/core/dev.c b/net/core/dev.c
index 29cf00c5d865..618fb1c1dd47 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -92,6 +92,7 @@
92#include <linux/etherdevice.h> 92#include <linux/etherdevice.h>
93#include <linux/notifier.h> 93#include <linux/notifier.h>
94#include <linux/skbuff.h> 94#include <linux/skbuff.h>
95#include <net/net_namespace.h>
95#include <net/sock.h> 96#include <net/sock.h>
96#include <linux/rtnetlink.h> 97#include <linux/rtnetlink.h>
97#include <linux/proc_fs.h> 98#include <linux/proc_fs.h>
@@ -2556,24 +2557,24 @@ static int __init dev_proc_init(void)
2556{ 2557{
2557 int rc = -ENOMEM; 2558 int rc = -ENOMEM;
2558 2559
2559 if (!proc_net_fops_create("dev", S_IRUGO, &dev_seq_fops)) 2560 if (!proc_net_fops_create(&init_net, "dev", S_IRUGO, &dev_seq_fops))
2560 goto out; 2561 goto out;
2561 if (!proc_net_fops_create("softnet_stat", S_IRUGO, &softnet_seq_fops)) 2562 if (!proc_net_fops_create(&init_net, "softnet_stat", S_IRUGO, &softnet_seq_fops))
2562 goto out_dev; 2563 goto out_dev;
2563 if (!proc_net_fops_create("ptype", S_IRUGO, &ptype_seq_fops)) 2564 if (!proc_net_fops_create(&init_net, "ptype", S_IRUGO, &ptype_seq_fops))
2564 goto out_dev2; 2565 goto out_softnet;
2565 2566
2566 if (wext_proc_init()) 2567 if (wext_proc_init())
2567 goto out_softnet; 2568 goto out_ptype;
2568 rc = 0; 2569 rc = 0;
2569out: 2570out:
2570 return rc; 2571 return rc;
2572out_ptype:
2573 proc_net_remove(&init_net, "ptype");
2571out_softnet: 2574out_softnet:
2572 proc_net_remove("ptype"); 2575 proc_net_remove(&init_net, "softnet_stat");
2573out_dev2:
2574 proc_net_remove("softnet_stat");
2575out_dev: 2576out_dev:
2576 proc_net_remove("dev"); 2577 proc_net_remove(&init_net, "dev");
2577 goto out; 2578 goto out;
2578} 2579}
2579#else 2580#else
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 20330c572610..8e069fc207cb 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -41,6 +41,7 @@
41#include <linux/proc_fs.h> 41#include <linux/proc_fs.h>
42#include <linux/seq_file.h> 42#include <linux/seq_file.h>
43#include <linux/init.h> 43#include <linux/init.h>
44#include <net/net_namespace.h>
44#include <net/ip.h> 45#include <net/ip.h>
45#include <net/route.h> 46#include <net/route.h>
46#include <linux/skbuff.h> 47#include <linux/skbuff.h>
@@ -254,7 +255,7 @@ static const struct file_operations dev_mc_seq_fops = {
254 255
255void __init dev_mcast_init(void) 256void __init dev_mcast_init(void)
256{ 257{
257 proc_net_fops_create("dev_mcast", 0, &dev_mc_seq_fops); 258 proc_net_fops_create(&init_net, "dev_mcast", 0, &dev_mc_seq_fops);
258} 259}
259 260
260EXPORT_SYMBOL(dev_mc_add); 261EXPORT_SYMBOL(dev_mc_add);
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ecd43c4a2221..5f25f4f79b8c 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -25,6 +25,7 @@
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#endif 26#endif
27#include <linux/times.h> 27#include <linux/times.h>
28#include <net/net_namespace.h>
28#include <net/neighbour.h> 29#include <net/neighbour.h>
29#include <net/dst.h> 30#include <net/dst.h>
30#include <net/sock.h> 31#include <net/sock.h>
@@ -1350,7 +1351,7 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
1350 panic("cannot create neighbour cache statistics"); 1351 panic("cannot create neighbour cache statistics");
1351 1352
1352#ifdef CONFIG_PROC_FS 1353#ifdef CONFIG_PROC_FS
1353 tbl->pde = create_proc_entry(tbl->id, 0, proc_net_stat); 1354 tbl->pde = create_proc_entry(tbl->id, 0, init_net.proc_net_stat);
1354 if (!tbl->pde) 1355 if (!tbl->pde)
1355 panic("cannot create neighbour proc dir entry"); 1356 panic("cannot create neighbour proc dir entry");
1356 tbl->pde->proc_fops = &neigh_stat_seq_fops; 1357 tbl->pde->proc_fops = &neigh_stat_seq_fops;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 84c0edeedf6d..33d7247fb19d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -152,6 +152,7 @@
152#include <linux/wait.h> 152#include <linux/wait.h>
153#include <linux/etherdevice.h> 153#include <linux/etherdevice.h>
154#include <linux/kthread.h> 154#include <linux/kthread.h>
155#include <net/net_namespace.h>
155#include <net/checksum.h> 156#include <net/checksum.h>
156#include <net/ipv6.h> 157#include <net/ipv6.h>
157#include <net/addrconf.h> 158#include <net/addrconf.h>
@@ -3808,7 +3809,7 @@ static int __init pg_init(void)
3808 3809
3809 printk(KERN_INFO "%s", version); 3810 printk(KERN_INFO "%s", version);
3810 3811
3811 pg_proc_dir = proc_mkdir(PG_PROC_DIR, proc_net); 3812 pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net);
3812 if (!pg_proc_dir) 3813 if (!pg_proc_dir)
3813 return -ENODEV; 3814 return -ENODEV;
3814 pg_proc_dir->owner = THIS_MODULE; 3815 pg_proc_dir->owner = THIS_MODULE;
@@ -3817,7 +3818,7 @@ static int __init pg_init(void)
3817 if (pe == NULL) { 3818 if (pe == NULL) {
3818 printk(KERN_ERR "pktgen: ERROR: cannot create %s " 3819 printk(KERN_ERR "pktgen: ERROR: cannot create %s "
3819 "procfs entry.\n", PGCTRL); 3820 "procfs entry.\n", PGCTRL);
3820 proc_net_remove(PG_PROC_DIR); 3821 proc_net_remove(&init_net, PG_PROC_DIR);
3821 return -EINVAL; 3822 return -EINVAL;
3822 } 3823 }
3823 3824
@@ -3841,7 +3842,7 @@ static int __init pg_init(void)
3841 "all threads\n"); 3842 "all threads\n");
3842 unregister_netdevice_notifier(&pktgen_notifier_block); 3843 unregister_netdevice_notifier(&pktgen_notifier_block);
3843 remove_proc_entry(PGCTRL, pg_proc_dir); 3844 remove_proc_entry(PGCTRL, pg_proc_dir);
3844 proc_net_remove(PG_PROC_DIR); 3845 proc_net_remove(&init_net, PG_PROC_DIR);
3845 return -ENODEV; 3846 return -ENODEV;
3846 } 3847 }
3847 3848
@@ -3868,7 +3869,7 @@ static void __exit pg_cleanup(void)
3868 3869
3869 /* Clean up proc file system */ 3870 /* Clean up proc file system */
3870 remove_proc_entry(PGCTRL, pg_proc_dir); 3871 remove_proc_entry(PGCTRL, pg_proc_dir);
3871 proc_net_remove(PG_PROC_DIR); 3872 proc_net_remove(&init_net, PG_PROC_DIR);
3872} 3873}
3873 3874
3874module_init(pg_init); 3875module_init(pg_init);
diff --git a/net/core/sock.c b/net/core/sock.c
index beb924c248e8..bbc726a49d87 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -119,6 +119,7 @@
119#include <linux/netdevice.h> 119#include <linux/netdevice.h>
120#include <net/protocol.h> 120#include <net/protocol.h>
121#include <linux/skbuff.h> 121#include <linux/skbuff.h>
122#include <net/net_namespace.h>
122#include <net/request_sock.h> 123#include <net/request_sock.h>
123#include <net/sock.h> 124#include <net/sock.h>
124#include <net/xfrm.h> 125#include <net/xfrm.h>
@@ -1973,7 +1974,7 @@ static const struct file_operations proto_seq_fops = {
1973static int __init proto_init(void) 1974static int __init proto_init(void)
1974{ 1975{
1975 /* register /proc/net/protocols */ 1976 /* register /proc/net/protocols */
1976 return proc_net_fops_create("protocols", S_IRUGO, &proto_seq_fops) == NULL ? -ENOBUFS : 0; 1977 return proc_net_fops_create(&init_net, "protocols", S_IRUGO, &proto_seq_fops) == NULL ? -ENOBUFS : 0;
1977} 1978}
1978 1979
1979subsys_initcall(proto_init); 1980subsys_initcall(proto_init);
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index bae10b0f2fc3..7053bb827bc8 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kfifo.h> 31#include <linux/kfifo.h>
32#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
33#include <net/net_namespace.h>
33 34
34#include "dccp.h" 35#include "dccp.h"
35#include "ccid.h" 36#include "ccid.h"
@@ -168,7 +169,7 @@ static __init int dccpprobe_init(void)
168 if (IS_ERR(dccpw.fifo)) 169 if (IS_ERR(dccpw.fifo))
169 return PTR_ERR(dccpw.fifo); 170 return PTR_ERR(dccpw.fifo);
170 171
171 if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops)) 172 if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
172 goto err0; 173 goto err0;
173 174
174 ret = register_jprobe(&dccp_send_probe); 175 ret = register_jprobe(&dccp_send_probe);
@@ -178,7 +179,7 @@ static __init int dccpprobe_init(void)
178 pr_info("DCCP watch registered (port=%d)\n", port); 179 pr_info("DCCP watch registered (port=%d)\n", port);
179 return 0; 180 return 0;
180err1: 181err1:
181 proc_net_remove(procname); 182 proc_net_remove(&init_net, procname);
182err0: 183err0:
183 kfifo_free(dccpw.fifo); 184 kfifo_free(dccpw.fifo);
184 return ret; 185 return ret;
@@ -188,7 +189,7 @@ module_init(dccpprobe_init);
188static __exit void dccpprobe_exit(void) 189static __exit void dccpprobe_exit(void)
189{ 190{
190 kfifo_free(dccpw.fifo); 191 kfifo_free(dccpw.fifo);
191 proc_net_remove(procname); 192 proc_net_remove(&init_net, procname);
192 unregister_jprobe(&dccp_send_probe); 193 unregister_jprobe(&dccp_send_probe);
193 194
194} 195}
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index ed76d4aab4a9..625d5955b8e2 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -128,6 +128,7 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
128#include <linux/stat.h> 128#include <linux/stat.h>
129#include <linux/init.h> 129#include <linux/init.h>
130#include <linux/poll.h> 130#include <linux/poll.h>
131#include <net/net_namespace.h>
131#include <net/neighbour.h> 132#include <net/neighbour.h>
132#include <net/dst.h> 133#include <net/dst.h>
133#include <net/fib_rules.h> 134#include <net/fib_rules.h>
@@ -2399,7 +2400,7 @@ static int __init decnet_init(void)
2399 dev_add_pack(&dn_dix_packet_type); 2400 dev_add_pack(&dn_dix_packet_type);
2400 register_netdevice_notifier(&dn_dev_notifier); 2401 register_netdevice_notifier(&dn_dev_notifier);
2401 2402
2402 proc_net_fops_create("decnet", S_IRUGO, &dn_socket_seq_fops); 2403 proc_net_fops_create(&init_net, "decnet", S_IRUGO, &dn_socket_seq_fops);
2403 dn_register_sysctl(); 2404 dn_register_sysctl();
2404out: 2405out:
2405 return rc; 2406 return rc;
@@ -2428,7 +2429,7 @@ static void __exit decnet_exit(void)
2428 dn_neigh_cleanup(); 2429 dn_neigh_cleanup();
2429 dn_fib_cleanup(); 2430 dn_fib_cleanup();
2430 2431
2431 proc_net_remove("decnet"); 2432 proc_net_remove(&init_net, "decnet");
2432 2433
2433 proto_unregister(&dn_proto); 2434 proto_unregister(&dn_proto);
2434} 2435}
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 8def68209edd..83cb0761336a 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -42,6 +42,7 @@
42#include <linux/notifier.h> 42#include <linux/notifier.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/system.h> 44#include <asm/system.h>
45#include <net/net_namespace.h>
45#include <net/neighbour.h> 46#include <net/neighbour.h>
46#include <net/dst.h> 47#include <net/dst.h>
47#include <net/flow.h> 48#include <net/flow.h>
@@ -1462,7 +1463,7 @@ void __init dn_dev_init(void)
1462 rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL); 1463 rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL);
1463 rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr); 1464 rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr);
1464 1465
1465 proc_net_fops_create("decnet_dev", S_IRUGO, &dn_dev_seq_fops); 1466 proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops);
1466 1467
1467#ifdef CONFIG_SYSCTL 1468#ifdef CONFIG_SYSCTL
1468 { 1469 {
@@ -1483,7 +1484,7 @@ void __exit dn_dev_cleanup(void)
1483 } 1484 }
1484#endif /* CONFIG_SYSCTL */ 1485#endif /* CONFIG_SYSCTL */
1485 1486
1486 proc_net_remove("decnet_dev"); 1487 proc_net_remove(&init_net, "decnet_dev");
1487 1488
1488 dn_dev_devices_off(); 1489 dn_dev_devices_off();
1489} 1490}
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 174d8a7a6dac..a424a8ddbaf7 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -38,6 +38,7 @@
38#include <linux/rcupdate.h> 38#include <linux/rcupdate.h>
39#include <linux/jhash.h> 39#include <linux/jhash.h>
40#include <asm/atomic.h> 40#include <asm/atomic.h>
41#include <net/net_namespace.h>
41#include <net/neighbour.h> 42#include <net/neighbour.h>
42#include <net/dst.h> 43#include <net/dst.h>
43#include <net/flow.h> 44#include <net/flow.h>
@@ -611,11 +612,11 @@ static const struct file_operations dn_neigh_seq_fops = {
611void __init dn_neigh_init(void) 612void __init dn_neigh_init(void)
612{ 613{
613 neigh_table_init(&dn_neigh_table); 614 neigh_table_init(&dn_neigh_table);
614 proc_net_fops_create("decnet_neigh", S_IRUGO, &dn_neigh_seq_fops); 615 proc_net_fops_create(&init_net, "decnet_neigh", S_IRUGO, &dn_neigh_seq_fops);
615} 616}
616 617
617void __exit dn_neigh_cleanup(void) 618void __exit dn_neigh_cleanup(void)
618{ 619{
619 proc_net_remove("decnet_neigh"); 620 proc_net_remove(&init_net, "decnet_neigh");
620 neigh_table_clear(&dn_neigh_table); 621 neigh_table_clear(&dn_neigh_table);
621} 622}
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index a4a620971ef0..4cfea9563d2a 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -77,6 +77,7 @@
77#include <linux/rcupdate.h> 77#include <linux/rcupdate.h>
78#include <linux/times.h> 78#include <linux/times.h>
79#include <asm/errno.h> 79#include <asm/errno.h>
80#include <net/net_namespace.h>
80#include <net/netlink.h> 81#include <net/netlink.h>
81#include <net/neighbour.h> 82#include <net/neighbour.h>
82#include <net/dst.h> 83#include <net/dst.h>
@@ -1814,7 +1815,7 @@ void __init dn_route_init(void)
1814 1815
1815 dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1); 1816 dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1);
1816 1817
1817 proc_net_fops_create("decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops); 1818 proc_net_fops_create(&init_net, "decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops);
1818 1819
1819#ifdef CONFIG_DECNET_ROUTER 1820#ifdef CONFIG_DECNET_ROUTER
1820 rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump); 1821 rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump);
@@ -1829,6 +1830,6 @@ void __exit dn_route_cleanup(void)
1829 del_timer(&dn_route_timer); 1830 del_timer(&dn_route_timer);
1830 dn_run_flush(0); 1831 dn_run_flush(0);
1831 1832
1832 proc_net_remove("decnet_cache"); 1833 proc_net_remove(&init_net, "decnet_cache");
1833} 1834}
1834 1835
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index 17ad278696ed..69cb6aad25be 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -47,6 +47,7 @@
47#include <linux/wireless.h> 47#include <linux/wireless.h>
48#include <linux/etherdevice.h> 48#include <linux/etherdevice.h>
49#include <asm/uaccess.h> 49#include <asm/uaccess.h>
50#include <net/net_namespace.h>
50#include <net/arp.h> 51#include <net/arp.h>
51 52
52#include <net/ieee80211.h> 53#include <net/ieee80211.h>
@@ -264,7 +265,7 @@ static int __init ieee80211_init(void)
264 struct proc_dir_entry *e; 265 struct proc_dir_entry *e;
265 266
266 ieee80211_debug_level = debug; 267 ieee80211_debug_level = debug;
267 ieee80211_proc = proc_mkdir(DRV_NAME, proc_net); 268 ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
268 if (ieee80211_proc == NULL) { 269 if (ieee80211_proc == NULL) {
269 IEEE80211_ERROR("Unable to create " DRV_NAME 270 IEEE80211_ERROR("Unable to create " DRV_NAME
270 " proc directory\n"); 271 " proc directory\n");
@@ -273,7 +274,7 @@ static int __init ieee80211_init(void)
273 e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR, 274 e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR,
274 ieee80211_proc); 275 ieee80211_proc);
275 if (!e) { 276 if (!e) {
276 remove_proc_entry(DRV_NAME, proc_net); 277 remove_proc_entry(DRV_NAME, init_net.proc_net);
277 ieee80211_proc = NULL; 278 ieee80211_proc = NULL;
278 return -EIO; 279 return -EIO;
279 } 280 }
@@ -293,7 +294,7 @@ static void __exit ieee80211_exit(void)
293#ifdef CONFIG_IEEE80211_DEBUG 294#ifdef CONFIG_IEEE80211_DEBUG
294 if (ieee80211_proc) { 295 if (ieee80211_proc) {
295 remove_proc_entry("debug_level", ieee80211_proc); 296 remove_proc_entry("debug_level", ieee80211_proc);
296 remove_proc_entry(DRV_NAME, proc_net); 297 remove_proc_entry(DRV_NAME, init_net.proc_net);
297 ieee80211_proc = NULL; 298 ieee80211_proc = NULL;
298 } 299 }
299#endif /* CONFIG_IEEE80211_DEBUG */ 300#endif /* CONFIG_IEEE80211_DEBUG */
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 9ab9d534fbac..78dd3443016c 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -103,6 +103,7 @@
103#include <linux/sysctl.h> 103#include <linux/sysctl.h>
104#endif 104#endif
105 105
106#include <net/net_namespace.h>
106#include <net/ip.h> 107#include <net/ip.h>
107#include <net/icmp.h> 108#include <net/icmp.h>
108#include <net/route.h> 109#include <net/route.h>
@@ -1400,7 +1401,7 @@ static const struct file_operations arp_seq_fops = {
1400 1401
1401static int __init arp_proc_init(void) 1402static int __init arp_proc_init(void)
1402{ 1403{
1403 if (!proc_net_fops_create("arp", S_IRUGO, &arp_seq_fops)) 1404 if (!proc_net_fops_create(&init_net, "arp", S_IRUGO, &arp_seq_fops))
1404 return -ENOMEM; 1405 return -ENOMEM;
1405 return 0; 1406 return 0;
1406} 1407}
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 9ad1d9ff9ce7..9fafbeea8fe6 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -35,6 +35,7 @@
35#include <linux/netlink.h> 35#include <linux/netlink.h>
36#include <linux/init.h> 36#include <linux/init.h>
37 37
38#include <net/net_namespace.h>
38#include <net/ip.h> 39#include <net/ip.h>
39#include <net/protocol.h> 40#include <net/protocol.h>
40#include <net/route.h> 41#include <net/route.h>
@@ -1068,13 +1069,13 @@ static const struct file_operations fib_seq_fops = {
1068 1069
1069int __init fib_proc_init(void) 1070int __init fib_proc_init(void)
1070{ 1071{
1071 if (!proc_net_fops_create("route", S_IRUGO, &fib_seq_fops)) 1072 if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_seq_fops))
1072 return -ENOMEM; 1073 return -ENOMEM;
1073 return 0; 1074 return 0;
1074} 1075}
1075 1076
1076void __init fib_proc_exit(void) 1077void __init fib_proc_exit(void)
1077{ 1078{
1078 proc_net_remove("route"); 1079 proc_net_remove(&init_net, "route");
1079} 1080}
1080#endif /* CONFIG_PROC_FS */ 1081#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 52b2891c63b7..be34bd556d58 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -73,6 +73,7 @@
73#include <linux/netlink.h> 73#include <linux/netlink.h>
74#include <linux/init.h> 74#include <linux/init.h>
75#include <linux/list.h> 75#include <linux/list.h>
76#include <net/net_namespace.h>
76#include <net/ip.h> 77#include <net/ip.h>
77#include <net/protocol.h> 78#include <net/protocol.h>
78#include <net/route.h> 79#include <net/route.h>
@@ -2530,30 +2531,30 @@ static const struct file_operations fib_route_fops = {
2530 2531
2531int __init fib_proc_init(void) 2532int __init fib_proc_init(void)
2532{ 2533{
2533 if (!proc_net_fops_create("fib_trie", S_IRUGO, &fib_trie_fops)) 2534 if (!proc_net_fops_create(&init_net, "fib_trie", S_IRUGO, &fib_trie_fops))
2534 goto out1; 2535 goto out1;
2535 2536
2536 if (!proc_net_fops_create("fib_triestat", S_IRUGO, &fib_triestat_fops)) 2537 if (!proc_net_fops_create(&init_net, "fib_triestat", S_IRUGO, &fib_triestat_fops))
2537 goto out2; 2538 goto out2;
2538 2539
2539 if (!proc_net_fops_create("route", S_IRUGO, &fib_route_fops)) 2540 if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_route_fops))
2540 goto out3; 2541 goto out3;
2541 2542
2542 return 0; 2543 return 0;
2543 2544
2544out3: 2545out3:
2545 proc_net_remove("fib_triestat"); 2546 proc_net_remove(&init_net, "fib_triestat");
2546out2: 2547out2:
2547 proc_net_remove("fib_trie"); 2548 proc_net_remove(&init_net, "fib_trie");
2548out1: 2549out1:
2549 return -ENOMEM; 2550 return -ENOMEM;
2550} 2551}
2551 2552
2552void __init fib_proc_exit(void) 2553void __init fib_proc_exit(void)
2553{ 2554{
2554 proc_net_remove("fib_trie"); 2555 proc_net_remove(&init_net, "fib_trie");
2555 proc_net_remove("fib_triestat"); 2556 proc_net_remove(&init_net, "fib_triestat");
2556 proc_net_remove("route"); 2557 proc_net_remove(&init_net, "route");
2557} 2558}
2558 2559
2559#endif /* CONFIG_PROC_FS */ 2560#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index a646409c2d06..d78599a9dbd5 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -91,6 +91,7 @@
91#include <linux/rtnetlink.h> 91#include <linux/rtnetlink.h>
92#include <linux/times.h> 92#include <linux/times.h>
93 93
94#include <net/net_namespace.h>
94#include <net/arp.h> 95#include <net/arp.h>
95#include <net/ip.h> 96#include <net/ip.h>
96#include <net/protocol.h> 97#include <net/protocol.h>
@@ -2613,8 +2614,8 @@ static const struct file_operations igmp_mcf_seq_fops = {
2613 2614
2614int __init igmp_mc_proc_init(void) 2615int __init igmp_mc_proc_init(void)
2615{ 2616{
2616 proc_net_fops_create("igmp", S_IRUGO, &igmp_mc_seq_fops); 2617 proc_net_fops_create(&init_net, "igmp", S_IRUGO, &igmp_mc_seq_fops);
2617 proc_net_fops_create("mcfilter", S_IRUGO, &igmp_mcf_seq_fops); 2618 proc_net_fops_create(&init_net, "mcfilter", S_IRUGO, &igmp_mcf_seq_fops);
2618 return 0; 2619 return 0;
2619} 2620}
2620#endif 2621#endif
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index c5b247077539..5ae4849878a3 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -55,6 +55,7 @@
55#include <linux/root_dev.h> 55#include <linux/root_dev.h>
56#include <linux/delay.h> 56#include <linux/delay.h>
57#include <linux/nfs_fs.h> 57#include <linux/nfs_fs.h>
58#include <net/net_namespace.h>
58#include <net/arp.h> 59#include <net/arp.h>
59#include <net/ip.h> 60#include <net/ip.h>
60#include <net/ipconfig.h> 61#include <net/ipconfig.h>
@@ -1253,7 +1254,7 @@ static int __init ip_auto_config(void)
1253 __be32 addr; 1254 __be32 addr;
1254 1255
1255#ifdef CONFIG_PROC_FS 1256#ifdef CONFIG_PROC_FS
1256 proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops); 1257 proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
1257#endif /* CONFIG_PROC_FS */ 1258#endif /* CONFIG_PROC_FS */
1258 1259
1259 if (!ic_enable) 1260 if (!ic_enable)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 7003cc1b7fe2..35683e1a42e8 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -49,6 +49,7 @@
49#include <linux/mroute.h> 49#include <linux/mroute.h>
50#include <linux/init.h> 50#include <linux/init.h>
51#include <linux/if_ether.h> 51#include <linux/if_ether.h>
52#include <net/net_namespace.h>
52#include <net/ip.h> 53#include <net/ip.h>
53#include <net/protocol.h> 54#include <net/protocol.h>
54#include <linux/skbuff.h> 55#include <linux/skbuff.h>
@@ -1922,7 +1923,7 @@ void __init ip_mr_init(void)
1922 ipmr_expire_timer.function=ipmr_expire_process; 1923 ipmr_expire_timer.function=ipmr_expire_process;
1923 register_netdevice_notifier(&ip_mr_notifier); 1924 register_netdevice_notifier(&ip_mr_notifier);
1924#ifdef CONFIG_PROC_FS 1925#ifdef CONFIG_PROC_FS
1925 proc_net_fops_create("ip_mr_vif", 0, &ipmr_vif_fops); 1926 proc_net_fops_create(&init_net, "ip_mr_vif", 0, &ipmr_vif_fops);
1926 proc_net_fops_create("ip_mr_cache", 0, &ipmr_mfc_fops); 1927 proc_net_fops_create(&init_net, "ip_mr_cache", 0, &ipmr_mfc_fops);
1927#endif 1928#endif
1928} 1929}
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 8d6901d4e94f..341474eefa55 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -25,6 +25,7 @@
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26#include <linux/in.h> 26#include <linux/in.h>
27#include <linux/ip.h> 27#include <linux/ip.h>
28#include <net/net_namespace.h>
28#include <net/protocol.h> 29#include <net/protocol.h>
29#include <net/tcp.h> 30#include <net/tcp.h>
30#include <asm/system.h> 31#include <asm/system.h>
@@ -616,12 +617,12 @@ int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
616int ip_vs_app_init(void) 617int ip_vs_app_init(void)
617{ 618{
618 /* we will replace it with proc_net_ipvs_create() soon */ 619 /* we will replace it with proc_net_ipvs_create() soon */
619 proc_net_fops_create("ip_vs_app", 0, &ip_vs_app_fops); 620 proc_net_fops_create(&init_net, "ip_vs_app", 0, &ip_vs_app_fops);
620 return 0; 621 return 0;
621} 622}
622 623
623 624
624void ip_vs_app_cleanup(void) 625void ip_vs_app_cleanup(void)
625{ 626{
626 proc_net_remove("ip_vs_app"); 627 proc_net_remove(&init_net, "ip_vs_app");
627} 628}
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index d612a6a5d957..4b702f708d30 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -35,6 +35,7 @@
35#include <linux/jhash.h> 35#include <linux/jhash.h>
36#include <linux/random.h> 36#include <linux/random.h>
37 37
38#include <net/net_namespace.h>
38#include <net/ip_vs.h> 39#include <net/ip_vs.h>
39 40
40 41
@@ -922,7 +923,7 @@ int ip_vs_conn_init(void)
922 rwlock_init(&__ip_vs_conntbl_lock_array[idx].l); 923 rwlock_init(&__ip_vs_conntbl_lock_array[idx].l);
923 } 924 }
924 925
925 proc_net_fops_create("ip_vs_conn", 0, &ip_vs_conn_fops); 926 proc_net_fops_create(&init_net, "ip_vs_conn", 0, &ip_vs_conn_fops);
926 927
927 /* calculate the random value for connection hash */ 928 /* calculate the random value for connection hash */
928 get_random_bytes(&ip_vs_conn_rnd, sizeof(ip_vs_conn_rnd)); 929 get_random_bytes(&ip_vs_conn_rnd, sizeof(ip_vs_conn_rnd));
@@ -938,6 +939,6 @@ void ip_vs_conn_cleanup(void)
938 939
939 /* Release the empty cache */ 940 /* Release the empty cache */
940 kmem_cache_destroy(ip_vs_conn_cachep); 941 kmem_cache_destroy(ip_vs_conn_cachep);
941 proc_net_remove("ip_vs_conn"); 942 proc_net_remove(&init_net, "ip_vs_conn");
942 vfree(ip_vs_conn_tab); 943 vfree(ip_vs_conn_tab);
943} 944}
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index f656d41d8d41..61d023d58b5d 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -35,6 +35,7 @@
35#include <linux/netfilter_ipv4.h> 35#include <linux/netfilter_ipv4.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37 37
38#include <net/net_namespace.h>
38#include <net/ip.h> 39#include <net/ip.h>
39#include <net/route.h> 40#include <net/route.h>
40#include <net/sock.h> 41#include <net/sock.h>
@@ -2356,8 +2357,8 @@ int ip_vs_control_init(void)
2356 return ret; 2357 return ret;
2357 } 2358 }
2358 2359
2359 proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops); 2360 proc_net_fops_create(&init_net, "ip_vs", 0, &ip_vs_info_fops);
2360 proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops); 2361 proc_net_fops_create(&init_net, "ip_vs_stats",0, &ip_vs_stats_fops);
2361 2362
2362 sysctl_header = register_sysctl_table(vs_root_table); 2363 sysctl_header = register_sysctl_table(vs_root_table);
2363 2364
@@ -2390,8 +2391,8 @@ void ip_vs_control_cleanup(void)
2390 cancel_work_sync(&defense_work.work); 2391 cancel_work_sync(&defense_work.work);
2391 ip_vs_kill_estimator(&ip_vs_stats); 2392 ip_vs_kill_estimator(&ip_vs_stats);
2392 unregister_sysctl_table(sysctl_header); 2393 unregister_sysctl_table(sysctl_header);
2393 proc_net_remove("ip_vs_stats"); 2394 proc_net_remove(&init_net, "ip_vs_stats");
2394 proc_net_remove("ip_vs"); 2395 proc_net_remove(&init_net, "ip_vs");
2395 nf_unregister_sockopt(&ip_vs_sockopts); 2396 nf_unregister_sockopt(&ip_vs_sockopts);
2396 LeaveFunction(2); 2397 LeaveFunction(2);
2397} 2398}
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 6225acac7a3b..6a1fec416eaf 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -50,6 +50,7 @@
50#include <linux/sysctl.h> 50#include <linux/sysctl.h>
51/* for proc_net_create/proc_net_remove */ 51/* for proc_net_create/proc_net_remove */
52#include <linux/proc_fs.h> 52#include <linux/proc_fs.h>
53#include <net/net_namespace.h>
53 54
54#include <net/ip_vs.h> 55#include <net/ip_vs.h>
55 56
@@ -843,7 +844,7 @@ static int __init ip_vs_lblcr_init(void)
843 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); 844 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
844 sysctl_header = register_sysctl_table(lblcr_root_table); 845 sysctl_header = register_sysctl_table(lblcr_root_table);
845#ifdef CONFIG_IP_VS_LBLCR_DEBUG 846#ifdef CONFIG_IP_VS_LBLCR_DEBUG
846 proc_net_create("ip_vs_lblcr", 0, ip_vs_lblcr_getinfo); 847 proc_net_create(&init_net, "ip_vs_lblcr", 0, ip_vs_lblcr_getinfo);
847#endif 848#endif
848 return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); 849 return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
849} 850}
@@ -852,7 +853,7 @@ static int __init ip_vs_lblcr_init(void)
852static void __exit ip_vs_lblcr_cleanup(void) 853static void __exit ip_vs_lblcr_cleanup(void)
853{ 854{
854#ifdef CONFIG_IP_VS_LBLCR_DEBUG 855#ifdef CONFIG_IP_VS_LBLCR_DEBUG
855 proc_net_remove("ip_vs_lblcr"); 856 proc_net_remove(&init_net, "ip_vs_lblcr");
856#endif 857#endif
857 unregister_sysctl_table(sysctl_header); 858 unregister_sysctl_table(sysctl_header);
858 unregister_ip_vs_scheduler(&ip_vs_lblcr_scheduler); 859 unregister_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 702d94db19b9..cb5e61a1d7ab 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -24,6 +24,7 @@
24#include <linux/proc_fs.h> 24#include <linux/proc_fs.h>
25#include <linux/security.h> 25#include <linux/security.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <net/net_namespace.h>
27#include <net/sock.h> 28#include <net/sock.h>
28#include <net/route.h> 29#include <net/route.h>
29 30
@@ -674,7 +675,7 @@ static int __init ip_queue_init(void)
674 goto cleanup_netlink_notifier; 675 goto cleanup_netlink_notifier;
675 } 676 }
676 677
677 proc = proc_net_create(IPQ_PROC_FS_NAME, 0, ipq_get_info); 678 proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
678 if (proc) 679 if (proc)
679 proc->owner = THIS_MODULE; 680 proc->owner = THIS_MODULE;
680 else { 681 else {
@@ -695,8 +696,7 @@ static int __init ip_queue_init(void)
695cleanup_sysctl: 696cleanup_sysctl:
696 unregister_sysctl_table(ipq_sysctl_header); 697 unregister_sysctl_table(ipq_sysctl_header);
697 unregister_netdevice_notifier(&ipq_dev_notifier); 698 unregister_netdevice_notifier(&ipq_dev_notifier);
698 proc_net_remove(IPQ_PROC_FS_NAME); 699 proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
699
700cleanup_ipqnl: 700cleanup_ipqnl:
701 sock_release(ipqnl->sk_socket); 701 sock_release(ipqnl->sk_socket);
702 mutex_lock(&ipqnl_mutex); 702 mutex_lock(&ipqnl_mutex);
@@ -715,7 +715,7 @@ static void __exit ip_queue_fini(void)
715 715
716 unregister_sysctl_table(ipq_sysctl_header); 716 unregister_sysctl_table(ipq_sysctl_header);
717 unregister_netdevice_notifier(&ipq_dev_notifier); 717 unregister_netdevice_notifier(&ipq_dev_notifier);
718 proc_net_remove(IPQ_PROC_FS_NAME); 718 proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
719 719
720 sock_release(ipqnl->sk_socket); 720 sock_release(ipqnl->sk_socket);
721 mutex_lock(&ipqnl_mutex); 721 mutex_lock(&ipqnl_mutex);
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 69bd362b5fa2..50fc9e009fe4 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -25,6 +25,7 @@
25#include <linux/netfilter_ipv4/ip_tables.h> 25#include <linux/netfilter_ipv4/ip_tables.h>
26#include <linux/netfilter_ipv4/ipt_CLUSTERIP.h> 26#include <linux/netfilter_ipv4/ipt_CLUSTERIP.h>
27#include <net/netfilter/nf_conntrack.h> 27#include <net/netfilter/nf_conntrack.h>
28#include <net/net_namespace.h>
28#include <net/checksum.h> 29#include <net/checksum.h>
29 30
30#define CLUSTERIP_VERSION "0.8" 31#define CLUSTERIP_VERSION "0.8"
@@ -726,7 +727,7 @@ static int __init ipt_clusterip_init(void)
726 goto cleanup_target; 727 goto cleanup_target;
727 728
728#ifdef CONFIG_PROC_FS 729#ifdef CONFIG_PROC_FS
729 clusterip_procdir = proc_mkdir("ipt_CLUSTERIP", proc_net); 730 clusterip_procdir = proc_mkdir("ipt_CLUSTERIP", init_net.proc_net);
730 if (!clusterip_procdir) { 731 if (!clusterip_procdir) {
731 printk(KERN_ERR "CLUSTERIP: Unable to proc dir entry\n"); 732 printk(KERN_ERR "CLUSTERIP: Unable to proc dir entry\n");
732 ret = -ENOMEM; 733 ret = -ENOMEM;
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 6d0c0f7364ad..db2a79889f9a 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -24,6 +24,7 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26#include <linux/inet.h> 26#include <linux/inet.h>
27#include <net/net_namespace.h>
27 28
28#include <linux/netfilter/x_tables.h> 29#include <linux/netfilter/x_tables.h>
29#include <linux/netfilter_ipv4/ipt_recent.h> 30#include <linux/netfilter_ipv4/ipt_recent.h>
@@ -487,7 +488,7 @@ static int __init ipt_recent_init(void)
487#ifdef CONFIG_PROC_FS 488#ifdef CONFIG_PROC_FS
488 if (err) 489 if (err)
489 return err; 490 return err;
490 proc_dir = proc_mkdir("ipt_recent", proc_net); 491 proc_dir = proc_mkdir("ipt_recent", init_net.proc_net);
491 if (proc_dir == NULL) { 492 if (proc_dir == NULL) {
492 xt_unregister_match(&recent_match); 493 xt_unregister_match(&recent_match);
493 err = -ENOMEM; 494 err = -ENOMEM;
@@ -501,7 +502,7 @@ static void __exit ipt_recent_exit(void)
501 BUG_ON(!list_empty(&tables)); 502 BUG_ON(!list_empty(&tables));
502 xt_unregister_match(&recent_match); 503 xt_unregister_match(&recent_match);
503#ifdef CONFIG_PROC_FS 504#ifdef CONFIG_PROC_FS
504 remove_proc_entry("ipt_recent", proc_net); 505 remove_proc_entry("ipt_recent", init_net.proc_net);
505#endif 506#endif
506} 507}
507 508
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
index b3dd5de9a258..a5ae2eabf0f3 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
@@ -11,6 +11,7 @@
11#include <linux/proc_fs.h> 11#include <linux/proc_fs.h>
12#include <linux/seq_file.h> 12#include <linux/seq_file.h>
13#include <linux/percpu.h> 13#include <linux/percpu.h>
14#include <net/net_namespace.h>
14 15
15#include <linux/netfilter.h> 16#include <linux/netfilter.h>
16#include <net/netfilter/nf_conntrack_core.h> 17#include <net/netfilter/nf_conntrack_core.h>
@@ -408,16 +409,16 @@ int __init nf_conntrack_ipv4_compat_init(void)
408{ 409{
409 struct proc_dir_entry *proc, *proc_exp, *proc_stat; 410 struct proc_dir_entry *proc, *proc_exp, *proc_stat;
410 411
411 proc = proc_net_fops_create("ip_conntrack", 0440, &ct_file_ops); 412 proc = proc_net_fops_create(&init_net, "ip_conntrack", 0440, &ct_file_ops);
412 if (!proc) 413 if (!proc)
413 goto err1; 414 goto err1;
414 415
415 proc_exp = proc_net_fops_create("ip_conntrack_expect", 0440, 416 proc_exp = proc_net_fops_create(&init_net, "ip_conntrack_expect", 0440,
416 &ip_exp_file_ops); 417 &ip_exp_file_ops);
417 if (!proc_exp) 418 if (!proc_exp)
418 goto err2; 419 goto err2;
419 420
420 proc_stat = create_proc_entry("ip_conntrack", S_IRUGO, proc_net_stat); 421 proc_stat = create_proc_entry("ip_conntrack", S_IRUGO, init_net.proc_net_stat);
421 if (!proc_stat) 422 if (!proc_stat)
422 goto err3; 423 goto err3;
423 424
@@ -427,16 +428,16 @@ int __init nf_conntrack_ipv4_compat_init(void)
427 return 0; 428 return 0;
428 429
429err3: 430err3:
430 proc_net_remove("ip_conntrack_expect"); 431 proc_net_remove(&init_net, "ip_conntrack_expect");
431err2: 432err2:
432 proc_net_remove("ip_conntrack"); 433 proc_net_remove(&init_net, "ip_conntrack");
433err1: 434err1:
434 return -ENOMEM; 435 return -ENOMEM;
435} 436}
436 437
437void __exit nf_conntrack_ipv4_compat_fini(void) 438void __exit nf_conntrack_ipv4_compat_fini(void)
438{ 439{
439 remove_proc_entry("ip_conntrack", proc_net_stat); 440 remove_proc_entry("ip_conntrack", init_net.proc_net_stat);
440 proc_net_remove("ip_conntrack_expect"); 441 proc_net_remove(&init_net, "ip_conntrack_expect");
441 proc_net_remove("ip_conntrack"); 442 proc_net_remove(&init_net, "ip_conntrack");
442} 443}
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 986d1c83a000..95a8f8f2de71 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -34,6 +34,7 @@
34 * 2 of the License, or (at your option) any later version. 34 * 2 of the License, or (at your option) any later version.
35 */ 35 */
36#include <linux/types.h> 36#include <linux/types.h>
37#include <net/net_namespace.h>
37#include <net/icmp.h> 38#include <net/icmp.h>
38#include <net/protocol.h> 39#include <net/protocol.h>
39#include <net/tcp.h> 40#include <net/tcp.h>
@@ -383,20 +384,20 @@ int __init ip_misc_proc_init(void)
383{ 384{
384 int rc = 0; 385 int rc = 0;
385 386
386 if (!proc_net_fops_create("netstat", S_IRUGO, &netstat_seq_fops)) 387 if (!proc_net_fops_create(&init_net, "netstat", S_IRUGO, &netstat_seq_fops))
387 goto out_netstat; 388 goto out_netstat;
388 389
389 if (!proc_net_fops_create("snmp", S_IRUGO, &snmp_seq_fops)) 390 if (!proc_net_fops_create(&init_net, "snmp", S_IRUGO, &snmp_seq_fops))
390 goto out_snmp; 391 goto out_snmp;
391 392
392 if (!proc_net_fops_create("sockstat", S_IRUGO, &sockstat_seq_fops)) 393 if (!proc_net_fops_create(&init_net, "sockstat", S_IRUGO, &sockstat_seq_fops))
393 goto out_sockstat; 394 goto out_sockstat;
394out: 395out:
395 return rc; 396 return rc;
396out_sockstat: 397out_sockstat:
397 proc_net_remove("snmp"); 398 proc_net_remove(&init_net, "snmp");
398out_snmp: 399out_snmp:
399 proc_net_remove("netstat"); 400 proc_net_remove(&init_net, "netstat");
400out_netstat: 401out_netstat:
401 rc = -ENOMEM; 402 rc = -ENOMEM;
402 goto out; 403 goto out;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index c6d71526f625..216e01b0f44a 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -59,6 +59,7 @@
59#include <linux/in_route.h> 59#include <linux/in_route.h>
60#include <linux/route.h> 60#include <linux/route.h>
61#include <linux/skbuff.h> 61#include <linux/skbuff.h>
62#include <net/net_namespace.h>
62#include <net/dst.h> 63#include <net/dst.h>
63#include <net/sock.h> 64#include <net/sock.h>
64#include <linux/gfp.h> 65#include <linux/gfp.h>
@@ -928,13 +929,13 @@ static const struct file_operations raw_seq_fops = {
928 929
929int __init raw_proc_init(void) 930int __init raw_proc_init(void)
930{ 931{
931 if (!proc_net_fops_create("raw", S_IRUGO, &raw_seq_fops)) 932 if (!proc_net_fops_create(&init_net, "raw", S_IRUGO, &raw_seq_fops))
932 return -ENOMEM; 933 return -ENOMEM;
933 return 0; 934 return 0;
934} 935}
935 936
936void __init raw_proc_exit(void) 937void __init raw_proc_exit(void)
937{ 938{
938 proc_net_remove("raw"); 939 proc_net_remove(&init_net, "raw");
939} 940}
940#endif /* CONFIG_PROC_FS */ 941#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c7ca94bd152c..efd2a9202d68 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -91,6 +91,7 @@
91#include <linux/jhash.h> 91#include <linux/jhash.h>
92#include <linux/rcupdate.h> 92#include <linux/rcupdate.h>
93#include <linux/times.h> 93#include <linux/times.h>
94#include <net/net_namespace.h>
94#include <net/protocol.h> 95#include <net/protocol.h>
95#include <net/ip.h> 96#include <net/ip.h>
96#include <net/route.h> 97#include <net/route.h>
@@ -3011,15 +3012,15 @@ int __init ip_rt_init(void)
3011#ifdef CONFIG_PROC_FS 3012#ifdef CONFIG_PROC_FS
3012 { 3013 {
3013 struct proc_dir_entry *rtstat_pde = NULL; /* keep gcc happy */ 3014 struct proc_dir_entry *rtstat_pde = NULL; /* keep gcc happy */
3014 if (!proc_net_fops_create("rt_cache", S_IRUGO, &rt_cache_seq_fops) || 3015 if (!proc_net_fops_create(&init_net, "rt_cache", S_IRUGO, &rt_cache_seq_fops) ||
3015 !(rtstat_pde = create_proc_entry("rt_cache", S_IRUGO, 3016 !(rtstat_pde = create_proc_entry("rt_cache", S_IRUGO,
3016 proc_net_stat))) { 3017 init_net.proc_net_stat))) {
3017 return -ENOMEM; 3018 return -ENOMEM;
3018 } 3019 }
3019 rtstat_pde->proc_fops = &rt_cpu_seq_fops; 3020 rtstat_pde->proc_fops = &rt_cpu_seq_fops;
3020 } 3021 }
3021#ifdef CONFIG_NET_CLS_ROUTE 3022#ifdef CONFIG_NET_CLS_ROUTE
3022 create_proc_read_entry("rt_acct", 0, proc_net, ip_rt_acct_read, NULL); 3023 create_proc_read_entry("rt_acct", 0, init_net.proc_net, ip_rt_acct_read, NULL);
3023#endif 3024#endif
3024#endif 3025#endif
3025#ifdef CONFIG_XFRM 3026#ifdef CONFIG_XFRM
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index e089a978e128..8855e640e958 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -62,6 +62,7 @@
62#include <linux/init.h> 62#include <linux/init.h>
63#include <linux/times.h> 63#include <linux/times.h>
64 64
65#include <net/net_namespace.h>
65#include <net/icmp.h> 66#include <net/icmp.h>
66#include <net/inet_hashtables.h> 67#include <net/inet_hashtables.h>
67#include <net/tcp.h> 68#include <net/tcp.h>
@@ -2249,7 +2250,7 @@ int tcp_proc_register(struct tcp_seq_afinfo *afinfo)
2249 afinfo->seq_fops->llseek = seq_lseek; 2250 afinfo->seq_fops->llseek = seq_lseek;
2250 afinfo->seq_fops->release = seq_release_private; 2251 afinfo->seq_fops->release = seq_release_private;
2251 2252
2252 p = proc_net_fops_create(afinfo->name, S_IRUGO, afinfo->seq_fops); 2253 p = proc_net_fops_create(&init_net, afinfo->name, S_IRUGO, afinfo->seq_fops);
2253 if (p) 2254 if (p)
2254 p->data = afinfo; 2255 p->data = afinfo;
2255 else 2256 else
@@ -2261,7 +2262,7 @@ void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo)
2261{ 2262{
2262 if (!afinfo) 2263 if (!afinfo)
2263 return; 2264 return;
2264 proc_net_remove(afinfo->name); 2265 proc_net_remove(&init_net, afinfo->name);
2265 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); 2266 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
2266} 2267}
2267 2268
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index b76398d1b454..87dd5bff315f 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -26,6 +26,7 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/ktime.h> 27#include <linux/ktime.h>
28#include <linux/time.h> 28#include <linux/time.h>
29#include <net/net_namespace.h>
29 30
30#include <net/tcp.h> 31#include <net/tcp.h>
31 32
@@ -228,7 +229,7 @@ static __init int tcpprobe_init(void)
228 if (!tcp_probe.log) 229 if (!tcp_probe.log)
229 goto err0; 230 goto err0;
230 231
231 if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops)) 232 if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &tcpprobe_fops))
232 goto err0; 233 goto err0;
233 234
234 ret = register_jprobe(&tcp_jprobe); 235 ret = register_jprobe(&tcp_jprobe);
@@ -238,7 +239,7 @@ static __init int tcpprobe_init(void)
238 pr_info("TCP probe registered (port=%d)\n", port); 239 pr_info("TCP probe registered (port=%d)\n", port);
239 return 0; 240 return 0;
240 err1: 241 err1:
241 proc_net_remove(procname); 242 proc_net_remove(&init_net, procname);
242 err0: 243 err0:
243 kfree(tcp_probe.log); 244 kfree(tcp_probe.log);
244 return ret; 245 return ret;
@@ -247,7 +248,7 @@ module_init(tcpprobe_init);
247 248
248static __exit void tcpprobe_exit(void) 249static __exit void tcpprobe_exit(void)
249{ 250{
250 proc_net_remove(procname); 251 proc_net_remove(&init_net, procname);
251 unregister_jprobe(&tcp_jprobe); 252 unregister_jprobe(&tcp_jprobe);
252 kfree(tcp_probe.log); 253 kfree(tcp_probe.log);
253} 254}
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a581b543bff7..ef4d901ee9ad 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -98,6 +98,7 @@
98#include <linux/skbuff.h> 98#include <linux/skbuff.h>
99#include <linux/proc_fs.h> 99#include <linux/proc_fs.h>
100#include <linux/seq_file.h> 100#include <linux/seq_file.h>
101#include <net/net_namespace.h>
101#include <net/icmp.h> 102#include <net/icmp.h>
102#include <net/route.h> 103#include <net/route.h>
103#include <net/checksum.h> 104#include <net/checksum.h>
@@ -1566,7 +1567,7 @@ int udp_proc_register(struct udp_seq_afinfo *afinfo)
1566 afinfo->seq_fops->llseek = seq_lseek; 1567 afinfo->seq_fops->llseek = seq_lseek;
1567 afinfo->seq_fops->release = seq_release_private; 1568 afinfo->seq_fops->release = seq_release_private;
1568 1569
1569 p = proc_net_fops_create(afinfo->name, S_IRUGO, afinfo->seq_fops); 1570 p = proc_net_fops_create(&init_net, afinfo->name, S_IRUGO, afinfo->seq_fops);
1570 if (p) 1571 if (p)
1571 p->data = afinfo; 1572 p->data = afinfo;
1572 else 1573 else
@@ -1578,7 +1579,7 @@ void udp_proc_unregister(struct udp_seq_afinfo *afinfo)
1578{ 1579{
1579 if (!afinfo) 1580 if (!afinfo)
1580 return; 1581 return;
1581 proc_net_remove(afinfo->name); 1582 proc_net_remove(&init_net, afinfo->name);
1582 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); 1583 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
1583} 1584}
1584 1585
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 45b4c82148a0..cd2db728d183 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -62,6 +62,7 @@
62#include <linux/notifier.h> 62#include <linux/notifier.h>
63#include <linux/string.h> 63#include <linux/string.h>
64 64
65#include <net/net_namespace.h>
65#include <net/sock.h> 66#include <net/sock.h>
66#include <net/snmp.h> 67#include <net/snmp.h>
67 68
@@ -2827,14 +2828,14 @@ static const struct file_operations if6_fops = {
2827 2828
2828int __init if6_proc_init(void) 2829int __init if6_proc_init(void)
2829{ 2830{
2830 if (!proc_net_fops_create("if_inet6", S_IRUGO, &if6_fops)) 2831 if (!proc_net_fops_create(&init_net, "if_inet6", S_IRUGO, &if6_fops))
2831 return -ENOMEM; 2832 return -ENOMEM;
2832 return 0; 2833 return 0;
2833} 2834}
2834 2835
2835void if6_proc_exit(void) 2836void if6_proc_exit(void)
2836{ 2837{
2837 proc_net_remove("if_inet6"); 2838 proc_net_remove(&init_net, "if_inet6");
2838} 2839}
2839#endif /* CONFIG_PROC_FS */ 2840#endif /* CONFIG_PROC_FS */
2840 2841
@@ -4293,6 +4294,6 @@ void __exit addrconf_cleanup(void)
4293 rtnl_unlock(); 4294 rtnl_unlock();
4294 4295
4295#ifdef CONFIG_PROC_FS 4296#ifdef CONFIG_PROC_FS
4296 proc_net_remove("if_inet6"); 4297 proc_net_remove(&init_net, "if_inet6");
4297#endif 4298#endif
4298} 4299}
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index b8c533fbdb63..0bd665498d06 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -30,6 +30,7 @@
30#include <linux/proc_fs.h> 30#include <linux/proc_fs.h>
31#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32 32
33#include <net/net_namespace.h>
33#include <net/sock.h> 34#include <net/sock.h>
34#include <net/snmp.h> 35#include <net/snmp.h>
35 36
@@ -578,7 +579,7 @@ static const struct file_operations ac6_seq_fops = {
578 579
579int __init ac6_proc_init(void) 580int __init ac6_proc_init(void)
580{ 581{
581 if (!proc_net_fops_create("anycast6", S_IRUGO, &ac6_seq_fops)) 582 if (!proc_net_fops_create(&init_net, "anycast6", S_IRUGO, &ac6_seq_fops))
582 return -ENOMEM; 583 return -ENOMEM;
583 584
584 return 0; 585 return 0;
@@ -586,7 +587,7 @@ int __init ac6_proc_init(void)
586 587
587void ac6_proc_exit(void) 588void ac6_proc_exit(void)
588{ 589{
589 proc_net_remove("anycast6"); 590 proc_net_remove(&init_net, "anycast6");
590} 591}
591#endif 592#endif
592 593
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 413a4ebb195c..1791399c7f10 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -21,6 +21,7 @@
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23 23
24#include <net/net_namespace.h>
24#include <net/sock.h> 25#include <net/sock.h>
25 26
26#include <net/ipv6.h> 27#include <net/ipv6.h>
@@ -690,7 +691,7 @@ static const struct file_operations ip6fl_seq_fops = {
690void ip6_flowlabel_init(void) 691void ip6_flowlabel_init(void)
691{ 692{
692#ifdef CONFIG_PROC_FS 693#ifdef CONFIG_PROC_FS
693 proc_net_fops_create("ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops); 694 proc_net_fops_create(&init_net, "ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops);
694#endif 695#endif
695} 696}
696 697
@@ -698,6 +699,6 @@ void ip6_flowlabel_cleanup(void)
698{ 699{
699 del_timer(&ip6_fl_gc_timer); 700 del_timer(&ip6_fl_gc_timer);
700#ifdef CONFIG_PROC_FS 701#ifdef CONFIG_PROC_FS
701 proc_net_remove("ip6_flowlabel"); 702 proc_net_remove(&init_net, "ip6_flowlabel");
702#endif 703#endif
703} 704}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index ae9881832a7e..a41d5a0b50cc 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -49,6 +49,7 @@
49#include <linux/netfilter.h> 49#include <linux/netfilter.h>
50#include <linux/netfilter_ipv6.h> 50#include <linux/netfilter_ipv6.h>
51 51
52#include <net/net_namespace.h>
52#include <net/sock.h> 53#include <net/sock.h>
53#include <net/snmp.h> 54#include <net/snmp.h>
54 55
@@ -2658,8 +2659,8 @@ int __init igmp6_init(struct net_proto_family *ops)
2658 np->hop_limit = 1; 2659 np->hop_limit = 1;
2659 2660
2660#ifdef CONFIG_PROC_FS 2661#ifdef CONFIG_PROC_FS
2661 proc_net_fops_create("igmp6", S_IRUGO, &igmp6_mc_seq_fops); 2662 proc_net_fops_create(&init_net, "igmp6", S_IRUGO, &igmp6_mc_seq_fops);
2662 proc_net_fops_create("mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops); 2663 proc_net_fops_create(&init_net, "mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops);
2663#endif 2664#endif
2664 2665
2665 return 0; 2666 return 0;
@@ -2671,7 +2672,7 @@ void igmp6_cleanup(void)
2671 igmp6_socket = NULL; /* for safety */ 2672 igmp6_socket = NULL; /* for safety */
2672 2673
2673#ifdef CONFIG_PROC_FS 2674#ifdef CONFIG_PROC_FS
2674 proc_net_remove("mcfilter6"); 2675 proc_net_remove(&init_net, "mcfilter6");
2675 proc_net_remove("igmp6"); 2676 proc_net_remove(&init_net, "igmp6");
2676#endif 2677#endif
2677} 2678}
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 0004db38af6d..dfc58fbdb68b 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -24,6 +24,7 @@
24#include <linux/sysctl.h> 24#include <linux/sysctl.h>
25#include <linux/proc_fs.h> 25#include <linux/proc_fs.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <net/net_namespace.h>
27#include <net/sock.h> 28#include <net/sock.h>
28#include <net/ipv6.h> 29#include <net/ipv6.h>
29#include <net/ip6_route.h> 30#include <net/ip6_route.h>
@@ -664,7 +665,7 @@ static int __init ip6_queue_init(void)
664 goto cleanup_netlink_notifier; 665 goto cleanup_netlink_notifier;
665 } 666 }
666 667
667 proc = proc_net_create(IPQ_PROC_FS_NAME, 0, ipq_get_info); 668 proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info);
668 if (proc) 669 if (proc)
669 proc->owner = THIS_MODULE; 670 proc->owner = THIS_MODULE;
670 else { 671 else {
@@ -685,7 +686,7 @@ static int __init ip6_queue_init(void)
685cleanup_sysctl: 686cleanup_sysctl:
686 unregister_sysctl_table(ipq_sysctl_header); 687 unregister_sysctl_table(ipq_sysctl_header);
687 unregister_netdevice_notifier(&ipq_dev_notifier); 688 unregister_netdevice_notifier(&ipq_dev_notifier);
688 proc_net_remove(IPQ_PROC_FS_NAME); 689 proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
689 690
690cleanup_ipqnl: 691cleanup_ipqnl:
691 sock_release(ipqnl->sk_socket); 692 sock_release(ipqnl->sk_socket);
@@ -705,7 +706,7 @@ static void __exit ip6_queue_fini(void)
705 706
706 unregister_sysctl_table(ipq_sysctl_header); 707 unregister_sysctl_table(ipq_sysctl_header);
707 unregister_netdevice_notifier(&ipq_dev_notifier); 708 unregister_netdevice_notifier(&ipq_dev_notifier);
708 proc_net_remove(IPQ_PROC_FS_NAME); 709 proc_net_remove(&init_net, IPQ_PROC_FS_NAME);
709 710
710 sock_release(ipqnl->sk_socket); 711 sock_release(ipqnl->sk_socket);
711 mutex_lock(&ipqnl_mutex); 712 mutex_lock(&ipqnl_mutex);
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 920dc9cf6a84..a712a2289484 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -23,6 +23,7 @@
23#include <linux/proc_fs.h> 23#include <linux/proc_fs.h>
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/stddef.h> 25#include <linux/stddef.h>
26#include <net/net_namespace.h>
26#include <net/ip.h> 27#include <net/ip.h>
27#include <net/sock.h> 28#include <net/sock.h>
28#include <net/tcp.h> 29#include <net/tcp.h>
@@ -231,22 +232,22 @@ int __init ipv6_misc_proc_init(void)
231{ 232{
232 int rc = 0; 233 int rc = 0;
233 234
234 if (!proc_net_fops_create("snmp6", S_IRUGO, &snmp6_seq_fops)) 235 if (!proc_net_fops_create(&init_net, "snmp6", S_IRUGO, &snmp6_seq_fops))
235 goto proc_snmp6_fail; 236 goto proc_snmp6_fail;
236 237
237 proc_net_devsnmp6 = proc_mkdir("dev_snmp6", proc_net); 238 proc_net_devsnmp6 = proc_mkdir("dev_snmp6", init_net.proc_net);
238 if (!proc_net_devsnmp6) 239 if (!proc_net_devsnmp6)
239 goto proc_dev_snmp6_fail; 240 goto proc_dev_snmp6_fail;
240 241
241 if (!proc_net_fops_create("sockstat6", S_IRUGO, &sockstat6_seq_fops)) 242 if (!proc_net_fops_create(&init_net, "sockstat6", S_IRUGO, &sockstat6_seq_fops))
242 goto proc_sockstat6_fail; 243 goto proc_sockstat6_fail;
243out: 244out:
244 return rc; 245 return rc;
245 246
246proc_sockstat6_fail: 247proc_sockstat6_fail:
247 proc_net_remove("dev_snmp6"); 248 proc_net_remove(&init_net, "dev_snmp6");
248proc_dev_snmp6_fail: 249proc_dev_snmp6_fail:
249 proc_net_remove("snmp6"); 250 proc_net_remove(&init_net, "snmp6");
250proc_snmp6_fail: 251proc_snmp6_fail:
251 rc = -ENOMEM; 252 rc = -ENOMEM;
252 goto out; 253 goto out;
@@ -254,8 +255,8 @@ proc_snmp6_fail:
254 255
255void ipv6_misc_proc_exit(void) 256void ipv6_misc_proc_exit(void)
256{ 257{
257 proc_net_remove("sockstat6"); 258 proc_net_remove(&init_net, "sockstat6");
258 proc_net_remove("dev_snmp6"); 259 proc_net_remove(&init_net, "dev_snmp6");
259 proc_net_remove("snmp6"); 260 proc_net_remove(&init_net, "snmp6");
260} 261}
261 262
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 77167afa3455..38a3d21c2585 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -35,6 +35,7 @@
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/ioctls.h> 36#include <asm/ioctls.h>
37 37
38#include <net/net_namespace.h>
38#include <net/ip.h> 39#include <net/ip.h>
39#include <net/sock.h> 40#include <net/sock.h>
40#include <net/snmp.h> 41#include <net/snmp.h>
@@ -1315,13 +1316,13 @@ static const struct file_operations raw6_seq_fops = {
1315 1316
1316int __init raw6_proc_init(void) 1317int __init raw6_proc_init(void)
1317{ 1318{
1318 if (!proc_net_fops_create("raw6", S_IRUGO, &raw6_seq_fops)) 1319 if (!proc_net_fops_create(&init_net, "raw6", S_IRUGO, &raw6_seq_fops))
1319 return -ENOMEM; 1320 return -ENOMEM;
1320 return 0; 1321 return 0;
1321} 1322}
1322 1323
1323void raw6_proc_exit(void) 1324void raw6_proc_exit(void)
1324{ 1325{
1325 proc_net_remove("raw6"); 1326 proc_net_remove(&init_net, "raw6");
1326} 1327}
1327#endif /* CONFIG_PROC_FS */ 1328#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 55ea80fac601..f4f0c341e5c8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -44,6 +44,7 @@
44#include <linux/seq_file.h> 44#include <linux/seq_file.h>
45#endif 45#endif
46 46
47#include <net/net_namespace.h>
47#include <net/snmp.h> 48#include <net/snmp.h>
48#include <net/ipv6.h> 49#include <net/ipv6.h>
49#include <net/ip6_fib.h> 50#include <net/ip6_fib.h>
@@ -2561,11 +2562,11 @@ void __init ip6_route_init(void)
2561 2562
2562 fib6_init(); 2563 fib6_init();
2563#ifdef CONFIG_PROC_FS 2564#ifdef CONFIG_PROC_FS
2564 p = proc_net_create("ipv6_route", 0, rt6_proc_info); 2565 p = proc_net_create(&init_net, "ipv6_route", 0, rt6_proc_info);
2565 if (p) 2566 if (p)
2566 p->owner = THIS_MODULE; 2567 p->owner = THIS_MODULE;
2567 2568
2568 proc_net_fops_create("rt6_stats", S_IRUGO, &rt6_stats_seq_fops); 2569 proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2569#endif 2570#endif
2570#ifdef CONFIG_XFRM 2571#ifdef CONFIG_XFRM
2571 xfrm6_init(); 2572 xfrm6_init();
@@ -2585,8 +2586,8 @@ void ip6_route_cleanup(void)
2585 fib6_rules_cleanup(); 2586 fib6_rules_cleanup();
2586#endif 2587#endif
2587#ifdef CONFIG_PROC_FS 2588#ifdef CONFIG_PROC_FS
2588 proc_net_remove("ipv6_route"); 2589 proc_net_remove(&init_net, "ipv6_route");
2589 proc_net_remove("rt6_stats"); 2590 proc_net_remove(&init_net, "rt6_stats");
2590#endif 2591#endif
2591#ifdef CONFIG_XFRM 2592#ifdef CONFIG_XFRM
2592 xfrm6_fini(); 2593 xfrm6_fini();
diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
index 4226e71ae1e3..d483a00dc427 100644
--- a/net/ipx/ipx_proc.c
+++ b/net/ipx/ipx_proc.c
@@ -9,6 +9,7 @@
9#include <linux/proc_fs.h> 9#include <linux/proc_fs.h>
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <linux/seq_file.h> 11#include <linux/seq_file.h>
12#include <net/net_namespace.h>
12#include <net/tcp_states.h> 13#include <net/tcp_states.h>
13#include <net/ipx.h> 14#include <net/ipx.h>
14 15
@@ -353,7 +354,7 @@ int __init ipx_proc_init(void)
353 struct proc_dir_entry *p; 354 struct proc_dir_entry *p;
354 int rc = -ENOMEM; 355 int rc = -ENOMEM;
355 356
356 ipx_proc_dir = proc_mkdir("ipx", proc_net); 357 ipx_proc_dir = proc_mkdir("ipx", init_net.proc_net);
357 358
358 if (!ipx_proc_dir) 359 if (!ipx_proc_dir)
359 goto out; 360 goto out;
@@ -381,7 +382,7 @@ out_socket:
381out_route: 382out_route:
382 remove_proc_entry("interface", ipx_proc_dir); 383 remove_proc_entry("interface", ipx_proc_dir);
383out_interface: 384out_interface:
384 remove_proc_entry("ipx", proc_net); 385 remove_proc_entry("ipx", init_net.proc_net);
385 goto out; 386 goto out;
386} 387}
387 388
@@ -390,7 +391,7 @@ void __exit ipx_proc_exit(void)
390 remove_proc_entry("interface", ipx_proc_dir); 391 remove_proc_entry("interface", ipx_proc_dir);
391 remove_proc_entry("route", ipx_proc_dir); 392 remove_proc_entry("route", ipx_proc_dir);
392 remove_proc_entry("socket", ipx_proc_dir); 393 remove_proc_entry("socket", ipx_proc_dir);
393 remove_proc_entry("ipx", proc_net); 394 remove_proc_entry("ipx", init_net.proc_net);
394} 395}
395 396
396#else /* CONFIG_PROC_FS */ 397#else /* CONFIG_PROC_FS */
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index 181cb51b48a8..cae24fbda966 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -28,6 +28,7 @@
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <net/net_namespace.h>
31 32
32#include <net/irda/irda.h> 33#include <net/irda/irda.h>
33#include <net/irda/irlap.h> 34#include <net/irda/irlap.h>
@@ -66,7 +67,7 @@ void __init irda_proc_register(void)
66 int i; 67 int i;
67 struct proc_dir_entry *d; 68 struct proc_dir_entry *d;
68 69
69 proc_irda = proc_mkdir("irda", proc_net); 70 proc_irda = proc_mkdir("irda", init_net.proc_net);
70 if (proc_irda == NULL) 71 if (proc_irda == NULL)
71 return; 72 return;
72 proc_irda->owner = THIS_MODULE; 73 proc_irda->owner = THIS_MODULE;
@@ -92,7 +93,7 @@ void irda_proc_unregister(void)
92 for (i=0; i<ARRAY_SIZE(irda_dirs); i++) 93 for (i=0; i<ARRAY_SIZE(irda_dirs); i++)
93 remove_proc_entry(irda_dirs[i].name, proc_irda); 94 remove_proc_entry(irda_dirs[i].name, proc_irda);
94 95
95 remove_proc_entry("irda", proc_net); 96 remove_proc_entry("irda", init_net.proc_net);
96 proc_irda = NULL; 97 proc_irda = NULL;
97 } 98 }
98} 99}
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 0241fff95137..5b802bbb856e 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -26,6 +26,7 @@
26#include <linux/in6.h> 26#include <linux/in6.h>
27#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <net/net_namespace.h>
29#include <net/xfrm.h> 30#include <net/xfrm.h>
30 31
31#include <net/sock.h> 32#include <net/sock.h>
@@ -3776,7 +3777,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
3776static void __exit ipsec_pfkey_exit(void) 3777static void __exit ipsec_pfkey_exit(void)
3777{ 3778{
3778 xfrm_unregister_km(&pfkeyv2_mgr); 3779 xfrm_unregister_km(&pfkeyv2_mgr);
3779 remove_proc_entry("net/pfkey", NULL); 3780 remove_proc_entry("pfkey", init_net.proc_net);
3780 sock_unregister(PF_KEY); 3781 sock_unregister(PF_KEY);
3781 proto_unregister(&key_proto); 3782 proto_unregister(&key_proto);
3782} 3783}
@@ -3793,7 +3794,7 @@ static int __init ipsec_pfkey_init(void)
3793 goto out_unregister_key_proto; 3794 goto out_unregister_key_proto;
3794#ifdef CONFIG_PROC_FS 3795#ifdef CONFIG_PROC_FS
3795 err = -ENOMEM; 3796 err = -ENOMEM;
3796 if (create_proc_read_entry("net/pfkey", 0, NULL, pfkey_read_proc, NULL) == NULL) 3797 if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL)
3797 goto out_sock_unregister; 3798 goto out_sock_unregister;
3798#endif 3799#endif
3799 err = xfrm_register_km(&pfkeyv2_mgr); 3800 err = xfrm_register_km(&pfkeyv2_mgr);
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 49be6c902c83..4865d82896b1 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -17,6 +17,7 @@
17#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <net/net_namespace.h>
20#include <net/sock.h> 21#include <net/sock.h>
21#include <net/llc.h> 22#include <net/llc.h>
22#include <net/llc_c_ac.h> 23#include <net/llc_c_ac.h>
@@ -231,7 +232,7 @@ int __init llc_proc_init(void)
231 int rc = -ENOMEM; 232 int rc = -ENOMEM;
232 struct proc_dir_entry *p; 233 struct proc_dir_entry *p;
233 234
234 llc_proc_dir = proc_mkdir("llc", proc_net); 235 llc_proc_dir = proc_mkdir("llc", init_net.proc_net);
235 if (!llc_proc_dir) 236 if (!llc_proc_dir)
236 goto out; 237 goto out;
237 llc_proc_dir->owner = THIS_MODULE; 238 llc_proc_dir->owner = THIS_MODULE;
@@ -254,7 +255,7 @@ out:
254out_core: 255out_core:
255 remove_proc_entry("socket", llc_proc_dir); 256 remove_proc_entry("socket", llc_proc_dir);
256out_socket: 257out_socket:
257 remove_proc_entry("llc", proc_net); 258 remove_proc_entry("llc", init_net.proc_net);
258 goto out; 259 goto out;
259} 260}
260 261
@@ -262,5 +263,5 @@ void llc_proc_exit(void)
262{ 263{
263 remove_proc_entry("socket", llc_proc_dir); 264 remove_proc_entry("socket", llc_proc_dir);
264 remove_proc_entry("core", llc_proc_dir); 265 remove_proc_entry("core", llc_proc_dir);
265 remove_proc_entry("llc", proc_net); 266 remove_proc_entry("llc", init_net.proc_net);
266} 267}
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 381a77cf0c9e..a523fa4136ed 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -19,6 +19,7 @@
19#include <linux/inetdevice.h> 19#include <linux/inetdevice.h>
20#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <net/net_namespace.h>
22#include <net/sock.h> 23#include <net/sock.h>
23 24
24#include "nf_internals.h" 25#include "nf_internals.h"
@@ -293,7 +294,7 @@ void __init netfilter_init(void)
293 } 294 }
294 295
295#ifdef CONFIG_PROC_FS 296#ifdef CONFIG_PROC_FS
296 proc_net_netfilter = proc_mkdir("netfilter", proc_net); 297 proc_net_netfilter = proc_mkdir("netfilter", init_net.proc_net);
297 if (!proc_net_netfilter) 298 if (!proc_net_netfilter)
298 panic("cannot create netfilter proc entry"); 299 panic("cannot create netfilter proc entry");
299#endif 300#endif
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 3ac64e25f10c..8a3e3af656bf 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -20,6 +20,7 @@
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/jhash.h> 22#include <linux/jhash.h>
23#include <net/net_namespace.h>
23 24
24#include <net/netfilter/nf_conntrack.h> 25#include <net/netfilter/nf_conntrack.h>
25#include <net/netfilter/nf_conntrack_core.h> 26#include <net/netfilter/nf_conntrack_core.h>
@@ -505,7 +506,7 @@ static int __init exp_proc_init(void)
505#ifdef CONFIG_PROC_FS 506#ifdef CONFIG_PROC_FS
506 struct proc_dir_entry *proc; 507 struct proc_dir_entry *proc;
507 508
508 proc = proc_net_fops_create("nf_conntrack_expect", 0440, &exp_file_ops); 509 proc = proc_net_fops_create(&init_net, "nf_conntrack_expect", 0440, &exp_file_ops);
509 if (!proc) 510 if (!proc)
510 return -ENOMEM; 511 return -ENOMEM;
511#endif /* CONFIG_PROC_FS */ 512#endif /* CONFIG_PROC_FS */
@@ -515,7 +516,7 @@ static int __init exp_proc_init(void)
515static void exp_proc_remove(void) 516static void exp_proc_remove(void)
516{ 517{
517#ifdef CONFIG_PROC_FS 518#ifdef CONFIG_PROC_FS
518 proc_net_remove("nf_conntrack_expect"); 519 proc_net_remove(&init_net, "nf_conntrack_expect");
519#endif /* CONFIG_PROC_FS */ 520#endif /* CONFIG_PROC_FS */
520} 521}
521 522
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index a4ce5e887997..2a19c5f1240f 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -14,6 +14,7 @@
14#include <linux/seq_file.h> 14#include <linux/seq_file.h>
15#include <linux/percpu.h> 15#include <linux/percpu.h>
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <net/net_namespace.h>
17#ifdef CONFIG_SYSCTL 18#ifdef CONFIG_SYSCTL
18#include <linux/sysctl.h> 19#include <linux/sysctl.h>
19#endif 20#endif
@@ -420,10 +421,10 @@ static int __init nf_conntrack_standalone_init(void)
420 return ret; 421 return ret;
421 422
422#ifdef CONFIG_PROC_FS 423#ifdef CONFIG_PROC_FS
423 proc = proc_net_fops_create("nf_conntrack", 0440, &ct_file_ops); 424 proc = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops);
424 if (!proc) goto cleanup_init; 425 if (!proc) goto cleanup_init;
425 426
426 proc_stat = create_proc_entry("nf_conntrack", S_IRUGO, proc_net_stat); 427 proc_stat = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat);
427 if (!proc_stat) 428 if (!proc_stat)
428 goto cleanup_proc; 429 goto cleanup_proc;
429 430
@@ -444,9 +445,9 @@ static int __init nf_conntrack_standalone_init(void)
444 cleanup_proc_stat: 445 cleanup_proc_stat:
445#endif 446#endif
446#ifdef CONFIG_PROC_FS 447#ifdef CONFIG_PROC_FS
447 remove_proc_entry("nf_conntrack", proc_net_stat); 448 remove_proc_entry("nf_conntrack", init_net. proc_net_stat);
448 cleanup_proc: 449 cleanup_proc:
449 proc_net_remove("nf_conntrack"); 450 proc_net_remove(&init_net, "nf_conntrack");
450 cleanup_init: 451 cleanup_init:
451#endif /* CNFIG_PROC_FS */ 452#endif /* CNFIG_PROC_FS */
452 nf_conntrack_cleanup(); 453 nf_conntrack_cleanup();
@@ -459,8 +460,8 @@ static void __exit nf_conntrack_standalone_fini(void)
459 unregister_sysctl_table(nf_ct_sysctl_header); 460 unregister_sysctl_table(nf_ct_sysctl_header);
460#endif 461#endif
461#ifdef CONFIG_PROC_FS 462#ifdef CONFIG_PROC_FS
462 remove_proc_entry("nf_conntrack", proc_net_stat); 463 remove_proc_entry("nf_conntrack", init_net.proc_net_stat);
463 proc_net_remove("nf_conntrack"); 464 proc_net_remove(&init_net, "nf_conntrack");
464#endif /* CNFIG_PROC_FS */ 465#endif /* CNFIG_PROC_FS */
465 nf_conntrack_cleanup(); 466 nf_conntrack_cleanup();
466} 467}
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index cc2baa6d5a7a..d9a3bded0d00 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -22,6 +22,7 @@
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <net/net_namespace.h>
25 26
26#include <linux/netfilter/x_tables.h> 27#include <linux/netfilter/x_tables.h>
27#include <linux/netfilter_arp.h> 28#include <linux/netfilter_arp.h>
@@ -795,7 +796,7 @@ int xt_proto_init(int af)
795#ifdef CONFIG_PROC_FS 796#ifdef CONFIG_PROC_FS
796 strlcpy(buf, xt_prefix[af], sizeof(buf)); 797 strlcpy(buf, xt_prefix[af], sizeof(buf));
797 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 798 strlcat(buf, FORMAT_TABLES, sizeof(buf));
798 proc = proc_net_fops_create(buf, 0440, &xt_file_ops); 799 proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
799 if (!proc) 800 if (!proc)
800 goto out; 801 goto out;
801 proc->data = (void *) ((unsigned long) af | (TABLE << 16)); 802 proc->data = (void *) ((unsigned long) af | (TABLE << 16));
@@ -803,14 +804,14 @@ int xt_proto_init(int af)
803 804
804 strlcpy(buf, xt_prefix[af], sizeof(buf)); 805 strlcpy(buf, xt_prefix[af], sizeof(buf));
805 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 806 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
806 proc = proc_net_fops_create(buf, 0440, &xt_file_ops); 807 proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
807 if (!proc) 808 if (!proc)
808 goto out_remove_tables; 809 goto out_remove_tables;
809 proc->data = (void *) ((unsigned long) af | (MATCH << 16)); 810 proc->data = (void *) ((unsigned long) af | (MATCH << 16));
810 811
811 strlcpy(buf, xt_prefix[af], sizeof(buf)); 812 strlcpy(buf, xt_prefix[af], sizeof(buf));
812 strlcat(buf, FORMAT_TARGETS, sizeof(buf)); 813 strlcat(buf, FORMAT_TARGETS, sizeof(buf));
813 proc = proc_net_fops_create(buf, 0440, &xt_file_ops); 814 proc = proc_net_fops_create(&init_net, buf, 0440, &xt_file_ops);
814 if (!proc) 815 if (!proc)
815 goto out_remove_matches; 816 goto out_remove_matches;
816 proc->data = (void *) ((unsigned long) af | (TARGET << 16)); 817 proc->data = (void *) ((unsigned long) af | (TARGET << 16));
@@ -822,12 +823,12 @@ int xt_proto_init(int af)
822out_remove_matches: 823out_remove_matches:
823 strlcpy(buf, xt_prefix[af], sizeof(buf)); 824 strlcpy(buf, xt_prefix[af], sizeof(buf));
824 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 825 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
825 proc_net_remove(buf); 826 proc_net_remove(&init_net, buf);
826 827
827out_remove_tables: 828out_remove_tables:
828 strlcpy(buf, xt_prefix[af], sizeof(buf)); 829 strlcpy(buf, xt_prefix[af], sizeof(buf));
829 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 830 strlcat(buf, FORMAT_TABLES, sizeof(buf));
830 proc_net_remove(buf); 831 proc_net_remove(&init_net, buf);
831out: 832out:
832 return -1; 833 return -1;
833#endif 834#endif
@@ -841,15 +842,15 @@ void xt_proto_fini(int af)
841 842
842 strlcpy(buf, xt_prefix[af], sizeof(buf)); 843 strlcpy(buf, xt_prefix[af], sizeof(buf));
843 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 844 strlcat(buf, FORMAT_TABLES, sizeof(buf));
844 proc_net_remove(buf); 845 proc_net_remove(&init_net, buf);
845 846
846 strlcpy(buf, xt_prefix[af], sizeof(buf)); 847 strlcpy(buf, xt_prefix[af], sizeof(buf));
847 strlcat(buf, FORMAT_TARGETS, sizeof(buf)); 848 strlcat(buf, FORMAT_TARGETS, sizeof(buf));
848 proc_net_remove(buf); 849 proc_net_remove(&init_net, buf);
849 850
850 strlcpy(buf, xt_prefix[af], sizeof(buf)); 851 strlcpy(buf, xt_prefix[af], sizeof(buf));
851 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 852 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
852 proc_net_remove(buf); 853 proc_net_remove(&init_net, buf);
853#endif /*CONFIG_PROC_FS*/ 854#endif /*CONFIG_PROC_FS*/
854} 855}
855EXPORT_SYMBOL_GPL(xt_proto_fini); 856EXPORT_SYMBOL_GPL(xt_proto_fini);
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index bd45f9d3f7d0..19103678bf20 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -21,6 +21,7 @@
21#include <linux/in.h> 21#include <linux/in.h>
22#include <linux/ip.h> 22#include <linux/ip.h>
23#include <linux/ipv6.h> 23#include <linux/ipv6.h>
24#include <net/net_namespace.h>
24 25
25#include <linux/netfilter/x_tables.h> 26#include <linux/netfilter/x_tables.h>
26#include <linux/netfilter_ipv4/ip_tables.h> 27#include <linux/netfilter_ipv4/ip_tables.h>
@@ -743,13 +744,13 @@ static int __init xt_hashlimit_init(void)
743 printk(KERN_ERR "xt_hashlimit: unable to create slab cache\n"); 744 printk(KERN_ERR "xt_hashlimit: unable to create slab cache\n");
744 goto err2; 745 goto err2;
745 } 746 }
746 hashlimit_procdir4 = proc_mkdir("ipt_hashlimit", proc_net); 747 hashlimit_procdir4 = proc_mkdir("ipt_hashlimit", init_net.proc_net);
747 if (!hashlimit_procdir4) { 748 if (!hashlimit_procdir4) {
748 printk(KERN_ERR "xt_hashlimit: unable to create proc dir " 749 printk(KERN_ERR "xt_hashlimit: unable to create proc dir "
749 "entry\n"); 750 "entry\n");
750 goto err3; 751 goto err3;
751 } 752 }
752 hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", proc_net); 753 hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", init_net.proc_net);
753 if (!hashlimit_procdir6) { 754 if (!hashlimit_procdir6) {
754 printk(KERN_ERR "xt_hashlimit: unable to create proc dir " 755 printk(KERN_ERR "xt_hashlimit: unable to create proc dir "
755 "entry\n"); 756 "entry\n");
@@ -757,7 +758,7 @@ static int __init xt_hashlimit_init(void)
757 } 758 }
758 return 0; 759 return 0;
759err4: 760err4:
760 remove_proc_entry("ipt_hashlimit", proc_net); 761 remove_proc_entry("ipt_hashlimit", init_net.proc_net);
761err3: 762err3:
762 kmem_cache_destroy(hashlimit_cachep); 763 kmem_cache_destroy(hashlimit_cachep);
763err2: 764err2:
@@ -769,8 +770,8 @@ err1:
769 770
770static void __exit xt_hashlimit_fini(void) 771static void __exit xt_hashlimit_fini(void)
771{ 772{
772 remove_proc_entry("ipt_hashlimit", proc_net); 773 remove_proc_entry("ipt_hashlimit", init_net.proc_net);
773 remove_proc_entry("ip6t_hashlimit", proc_net); 774 remove_proc_entry("ip6t_hashlimit", init_net.proc_net);
774 kmem_cache_destroy(hashlimit_cachep); 775 kmem_cache_destroy(hashlimit_cachep);
775 xt_unregister_matches(xt_hashlimit, ARRAY_SIZE(xt_hashlimit)); 776 xt_unregister_matches(xt_hashlimit, ARRAY_SIZE(xt_hashlimit));
776} 777}
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a78d962e2c70..3982f13dab17 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -57,6 +57,7 @@
57#include <linux/selinux.h> 57#include <linux/selinux.h>
58#include <linux/mutex.h> 58#include <linux/mutex.h>
59 59
60#include <net/net_namespace.h>
60#include <net/sock.h> 61#include <net/sock.h>
61#include <net/scm.h> 62#include <net/scm.h>
62#include <net/netlink.h> 63#include <net/netlink.h>
@@ -1927,7 +1928,7 @@ static int __init netlink_proto_init(void)
1927 1928
1928 sock_register(&netlink_family_ops); 1929 sock_register(&netlink_family_ops);
1929#ifdef CONFIG_PROC_FS 1930#ifdef CONFIG_PROC_FS
1930 proc_net_fops_create("netlink", 0, &netlink_seq_fops); 1931 proc_net_fops_create(&init_net, "netlink", 0, &netlink_seq_fops);
1931#endif 1932#endif
1932 /* The netlink device handler may be needed early. */ 1933 /* The netlink device handler may be needed early. */
1933 rtnetlink_init(); 1934 rtnetlink_init();
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index dc9273295a38..15c8a92bd719 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -27,6 +27,7 @@
27#include <linux/netdevice.h> 27#include <linux/netdevice.h>
28#include <linux/if_arp.h> 28#include <linux/if_arp.h>
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <net/net_namespace.h>
30#include <net/sock.h> 31#include <net/sock.h>
31#include <asm/uaccess.h> 32#include <asm/uaccess.h>
32#include <asm/system.h> 33#include <asm/system.h>
@@ -1447,9 +1448,9 @@ static int __init nr_proto_init(void)
1447 1448
1448 nr_loopback_init(); 1449 nr_loopback_init();
1449 1450
1450 proc_net_fops_create("nr", S_IRUGO, &nr_info_fops); 1451 proc_net_fops_create(&init_net, "nr", S_IRUGO, &nr_info_fops);
1451 proc_net_fops_create("nr_neigh", S_IRUGO, &nr_neigh_fops); 1452 proc_net_fops_create(&init_net, "nr_neigh", S_IRUGO, &nr_neigh_fops);
1452 proc_net_fops_create("nr_nodes", S_IRUGO, &nr_nodes_fops); 1453 proc_net_fops_create(&init_net, "nr_nodes", S_IRUGO, &nr_nodes_fops);
1453out: 1454out:
1454 return rc; 1455 return rc;
1455fail: 1456fail:
@@ -1477,9 +1478,9 @@ static void __exit nr_exit(void)
1477{ 1478{
1478 int i; 1479 int i;
1479 1480
1480 proc_net_remove("nr"); 1481 proc_net_remove(&init_net, "nr");
1481 proc_net_remove("nr_neigh"); 1482 proc_net_remove(&init_net, "nr_neigh");
1482 proc_net_remove("nr_nodes"); 1483 proc_net_remove(&init_net, "nr_nodes");
1483 nr_loopback_clear(); 1484 nr_loopback_clear();
1484 1485
1485 nr_rt_free(); 1486 nr_rt_free();
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 9c26dd9ee649..56502292f24c 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -61,6 +61,7 @@
61#include <linux/wireless.h> 61#include <linux/wireless.h>
62#include <linux/kernel.h> 62#include <linux/kernel.h>
63#include <linux/kmod.h> 63#include <linux/kmod.h>
64#include <net/net_namespace.h>
64#include <net/ip.h> 65#include <net/ip.h>
65#include <net/protocol.h> 66#include <net/protocol.h>
66#include <linux/skbuff.h> 67#include <linux/skbuff.h>
@@ -1951,7 +1952,7 @@ static const struct file_operations packet_seq_fops = {
1951 1952
1952static void __exit packet_exit(void) 1953static void __exit packet_exit(void)
1953{ 1954{
1954 proc_net_remove("packet"); 1955 proc_net_remove(&init_net, "packet");
1955 unregister_netdevice_notifier(&packet_netdev_notifier); 1956 unregister_netdevice_notifier(&packet_netdev_notifier);
1956 sock_unregister(PF_PACKET); 1957 sock_unregister(PF_PACKET);
1957 proto_unregister(&packet_proto); 1958 proto_unregister(&packet_proto);
@@ -1966,7 +1967,7 @@ static int __init packet_init(void)
1966 1967
1967 sock_register(&packet_family_ops); 1968 sock_register(&packet_family_ops);
1968 register_netdevice_notifier(&packet_netdev_notifier); 1969 register_netdevice_notifier(&packet_netdev_notifier);
1969 proc_net_fops_create("packet", 0, &packet_seq_fops); 1970 proc_net_fops_create(&init_net, "packet", 0, &packet_seq_fops);
1970out: 1971out:
1971 return rc; 1972 return rc;
1972} 1973}
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 976c3cc86a29..48319f7991ac 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -26,6 +26,7 @@
26#include <linux/sockios.h> 26#include <linux/sockios.h>
27#include <linux/net.h> 27#include <linux/net.h>
28#include <linux/stat.h> 28#include <linux/stat.h>
29#include <net/net_namespace.h>
29#include <net/ax25.h> 30#include <net/ax25.h>
30#include <linux/inet.h> 31#include <linux/inet.h>
31#include <linux/netdevice.h> 32#include <linux/netdevice.h>
@@ -1576,10 +1577,10 @@ static int __init rose_proto_init(void)
1576 1577
1577 rose_add_loopback_neigh(); 1578 rose_add_loopback_neigh();
1578 1579
1579 proc_net_fops_create("rose", S_IRUGO, &rose_info_fops); 1580 proc_net_fops_create(&init_net, "rose", S_IRUGO, &rose_info_fops);
1580 proc_net_fops_create("rose_neigh", S_IRUGO, &rose_neigh_fops); 1581 proc_net_fops_create(&init_net, "rose_neigh", S_IRUGO, &rose_neigh_fops);
1581 proc_net_fops_create("rose_nodes", S_IRUGO, &rose_nodes_fops); 1582 proc_net_fops_create(&init_net, "rose_nodes", S_IRUGO, &rose_nodes_fops);
1582 proc_net_fops_create("rose_routes", S_IRUGO, &rose_routes_fops); 1583 proc_net_fops_create(&init_net, "rose_routes", S_IRUGO, &rose_routes_fops);
1583out: 1584out:
1584 return rc; 1585 return rc;
1585fail: 1586fail:
@@ -1606,10 +1607,10 @@ static void __exit rose_exit(void)
1606{ 1607{
1607 int i; 1608 int i;
1608 1609
1609 proc_net_remove("rose"); 1610 proc_net_remove(&init_net, "rose");
1610 proc_net_remove("rose_neigh"); 1611 proc_net_remove(&init_net, "rose_neigh");
1611 proc_net_remove("rose_nodes"); 1612 proc_net_remove(&init_net, "rose_nodes");
1612 proc_net_remove("rose_routes"); 1613 proc_net_remove(&init_net, "rose_routes");
1613 rose_loopback_clear(); 1614 rose_loopback_clear();
1614 1615
1615 rose_rt_free(); 1616 rose_rt_free();
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index c58fa0d1be26..122d55d992e1 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -14,6 +14,7 @@
14#include <linux/skbuff.h> 14#include <linux/skbuff.h>
15#include <linux/poll.h> 15#include <linux/poll.h>
16#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
17#include <net/net_namespace.h>
17#include <net/sock.h> 18#include <net/sock.h>
18#include <net/af_rxrpc.h> 19#include <net/af_rxrpc.h>
19#include "ar-internal.h" 20#include "ar-internal.h"
@@ -829,8 +830,8 @@ static int __init af_rxrpc_init(void)
829 } 830 }
830 831
831#ifdef CONFIG_PROC_FS 832#ifdef CONFIG_PROC_FS
832 proc_net_fops_create("rxrpc_calls", 0, &rxrpc_call_seq_fops); 833 proc_net_fops_create(&init_net, "rxrpc_calls", 0, &rxrpc_call_seq_fops);
833 proc_net_fops_create("rxrpc_conns", 0, &rxrpc_connection_seq_fops); 834 proc_net_fops_create(&init_net, "rxrpc_conns", 0, &rxrpc_connection_seq_fops);
834#endif 835#endif
835 return 0; 836 return 0;
836 837
@@ -868,8 +869,8 @@ static void __exit af_rxrpc_exit(void)
868 869
869 _debug("flush scheduled work"); 870 _debug("flush scheduled work");
870 flush_workqueue(rxrpc_workqueue); 871 flush_workqueue(rxrpc_workqueue);
871 proc_net_remove("rxrpc_conns"); 872 proc_net_remove(&init_net, "rxrpc_conns");
872 proc_net_remove("rxrpc_calls"); 873 proc_net_remove(&init_net, "rxrpc_calls");
873 destroy_workqueue(rxrpc_workqueue); 874 destroy_workqueue(rxrpc_workqueue);
874 kmem_cache_destroy(rxrpc_call_jar); 875 kmem_cache_destroy(rxrpc_call_jar);
875 _leave(""); 876 _leave("");
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index dee0d5fb39c5..efc383c58f1e 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -28,6 +28,7 @@
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/hrtimer.h> 29#include <linux/hrtimer.h>
30 30
31#include <net/net_namespace.h>
31#include <net/netlink.h> 32#include <net/netlink.h>
32#include <net/pkt_sched.h> 33#include <net/pkt_sched.h>
33 34
@@ -1251,7 +1252,7 @@ static int __init pktsched_init(void)
1251{ 1252{
1252 register_qdisc(&pfifo_qdisc_ops); 1253 register_qdisc(&pfifo_qdisc_ops);
1253 register_qdisc(&bfifo_qdisc_ops); 1254 register_qdisc(&bfifo_qdisc_ops);
1254 proc_net_fops_create("psched", 0, &psched_fops); 1255 proc_net_fops_create(&init_net, "psched", 0, &psched_fops);
1255 1256
1256 rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL); 1257 rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
1257 rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL); 1258 rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 957c118a6068..30929e3ca05a 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -52,6 +52,7 @@
52#include <linux/inetdevice.h> 52#include <linux/inetdevice.h>
53#include <linux/seq_file.h> 53#include <linux/seq_file.h>
54#include <linux/bootmem.h> 54#include <linux/bootmem.h>
55#include <net/net_namespace.h>
55#include <net/protocol.h> 56#include <net/protocol.h>
56#include <net/ip.h> 57#include <net/ip.h>
57#include <net/ipv6.h> 58#include <net/ipv6.h>
@@ -98,7 +99,7 @@ static __init int sctp_proc_init(void)
98{ 99{
99 if (!proc_net_sctp) { 100 if (!proc_net_sctp) {
100 struct proc_dir_entry *ent; 101 struct proc_dir_entry *ent;
101 ent = proc_mkdir("net/sctp", NULL); 102 ent = proc_mkdir("sctp", init_net.proc_net);
102 if (ent) { 103 if (ent) {
103 ent->owner = THIS_MODULE; 104 ent->owner = THIS_MODULE;
104 proc_net_sctp = ent; 105 proc_net_sctp = ent;
@@ -131,7 +132,7 @@ static void sctp_proc_exit(void)
131 132
132 if (proc_net_sctp) { 133 if (proc_net_sctp) {
133 proc_net_sctp = NULL; 134 proc_net_sctp = NULL;
134 remove_proc_entry("net/sctp", NULL); 135 remove_proc_entry("sctp", init_net.proc_net);
135 } 136 }
136} 137}
137 138
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 74ba7d443dfc..4d4f3738b688 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -21,6 +21,7 @@
21#include <linux/sunrpc/clnt.h> 21#include <linux/sunrpc/clnt.h>
22#include <linux/sunrpc/svcsock.h> 22#include <linux/sunrpc/svcsock.h>
23#include <linux/sunrpc/metrics.h> 23#include <linux/sunrpc/metrics.h>
24#include <net/net_namespace.h>
24 25
25#define RPCDBG_FACILITY RPCDBG_MISC 26#define RPCDBG_FACILITY RPCDBG_MISC
26 27
@@ -265,7 +266,7 @@ rpc_proc_init(void)
265 dprintk("RPC: registering /proc/net/rpc\n"); 266 dprintk("RPC: registering /proc/net/rpc\n");
266 if (!proc_net_rpc) { 267 if (!proc_net_rpc) {
267 struct proc_dir_entry *ent; 268 struct proc_dir_entry *ent;
268 ent = proc_mkdir("rpc", proc_net); 269 ent = proc_mkdir("rpc", init_net.proc_net);
269 if (ent) { 270 if (ent) {
270 ent->owner = THIS_MODULE; 271 ent->owner = THIS_MODULE;
271 proc_net_rpc = ent; 272 proc_net_rpc = ent;
@@ -279,7 +280,7 @@ rpc_proc_exit(void)
279 dprintk("RPC: unregistering /proc/net/rpc\n"); 280 dprintk("RPC: unregistering /proc/net/rpc\n");
280 if (proc_net_rpc) { 281 if (proc_net_rpc) {
281 proc_net_rpc = NULL; 282 proc_net_rpc = NULL;
282 remove_proc_entry("net/rpc", NULL); 283 remove_proc_entry("rpc", init_net.proc_net);
283 } 284 }
284} 285}
285 286
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index a05c34260e70..2386090c3a16 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -103,6 +103,7 @@
103#include <asm/uaccess.h> 103#include <asm/uaccess.h>
104#include <linux/skbuff.h> 104#include <linux/skbuff.h>
105#include <linux/netdevice.h> 105#include <linux/netdevice.h>
106#include <net/net_namespace.h>
106#include <net/sock.h> 107#include <net/sock.h>
107#include <net/tcp_states.h> 108#include <net/tcp_states.h>
108#include <net/af_unix.h> 109#include <net/af_unix.h>
@@ -2135,7 +2136,7 @@ static int __init af_unix_init(void)
2135 2136
2136 sock_register(&unix_family_ops); 2137 sock_register(&unix_family_ops);
2137#ifdef CONFIG_PROC_FS 2138#ifdef CONFIG_PROC_FS
2138 proc_net_fops_create("unix", 0, &unix_seq_fops); 2139 proc_net_fops_create(&init_net, "unix", 0, &unix_seq_fops);
2139#endif 2140#endif
2140 unix_sysctl_register(); 2141 unix_sysctl_register();
2141out: 2142out:
@@ -2146,7 +2147,7 @@ static void __exit af_unix_exit(void)
2146{ 2147{
2147 sock_unregister(PF_UNIX); 2148 sock_unregister(PF_UNIX);
2148 unix_sysctl_unregister(); 2149 unix_sysctl_unregister();
2149 proc_net_remove("unix"); 2150 proc_net_remove(&init_net, "unix");
2150 proto_unregister(&unix_proto); 2151 proto_unregister(&unix_proto);
2151} 2152}
2152 2153
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index 236e7eaf1b7f..f2e54c3f064e 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -29,6 +29,7 @@
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
30#include <linux/smp_lock.h> 30#include <linux/smp_lock.h>
31 31
32#include <net/net_namespace.h>
32#include <asm/io.h> 33#include <asm/io.h>
33 34
34#define PROC_STATS_FORMAT "%30s: %12lu\n" 35#define PROC_STATS_FORMAT "%30s: %12lu\n"
@@ -287,7 +288,7 @@ static const struct file_operations wandev_fops = {
287int __init wanrouter_proc_init(void) 288int __init wanrouter_proc_init(void)
288{ 289{
289 struct proc_dir_entry *p; 290 struct proc_dir_entry *p;
290 proc_router = proc_mkdir(ROUTER_NAME, proc_net); 291 proc_router = proc_mkdir(ROUTER_NAME, init_net.proc_net);
291 if (!proc_router) 292 if (!proc_router)
292 goto fail; 293 goto fail;
293 294
@@ -303,7 +304,7 @@ int __init wanrouter_proc_init(void)
303fail_stat: 304fail_stat:
304 remove_proc_entry("config", proc_router); 305 remove_proc_entry("config", proc_router);
305fail_config: 306fail_config:
306 remove_proc_entry(ROUTER_NAME, proc_net); 307 remove_proc_entry(ROUTER_NAME, init_net.proc_net);
307fail: 308fail:
308 return -ENOMEM; 309 return -ENOMEM;
309} 310}
@@ -316,7 +317,7 @@ void wanrouter_proc_cleanup(void)
316{ 317{
317 remove_proc_entry("config", proc_router); 318 remove_proc_entry("config", proc_router);
318 remove_proc_entry("status", proc_router); 319 remove_proc_entry("status", proc_router);
319 remove_proc_entry(ROUTER_NAME, proc_net); 320 remove_proc_entry(ROUTER_NAME, init_net.proc_net);
320} 321}
321 322
322/* 323/*
diff --git a/net/wireless/wext.c b/net/wireless/wext.c
index debf5191a128..b8069afe0410 100644
--- a/net/wireless/wext.c
+++ b/net/wireless/wext.c
@@ -93,6 +93,7 @@
93#include <linux/if_arp.h> /* ARPHRD_ETHER */ 93#include <linux/if_arp.h> /* ARPHRD_ETHER */
94#include <linux/etherdevice.h> /* compare_ether_addr */ 94#include <linux/etherdevice.h> /* compare_ether_addr */
95#include <linux/interrupt.h> 95#include <linux/interrupt.h>
96#include <net/net_namespace.h>
96 97
97#include <linux/wireless.h> /* Pretty obvious */ 98#include <linux/wireless.h> /* Pretty obvious */
98#include <net/iw_handler.h> /* New driver API */ 99#include <net/iw_handler.h> /* New driver API */
@@ -686,7 +687,7 @@ static const struct file_operations wireless_seq_fops = {
686int __init wext_proc_init(void) 687int __init wext_proc_init(void)
687{ 688{
688 /* Create /proc/net/wireless entry */ 689 /* Create /proc/net/wireless entry */
689 if (!proc_net_fops_create("wireless", S_IRUGO, &wireless_seq_fops)) 690 if (!proc_net_fops_create(&init_net, "wireless", S_IRUGO, &wireless_seq_fops))
690 return -ENOMEM; 691 return -ENOMEM;
691 692
692 return 0; 693 return 0;
diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c
index 7405b9c5b7f2..7d55e50c936f 100644
--- a/net/x25/x25_proc.c
+++ b/net/x25/x25_proc.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <net/net_namespace.h>
23#include <net/sock.h> 24#include <net/sock.h>
24#include <net/x25.h> 25#include <net/x25.h>
25 26
@@ -301,7 +302,7 @@ int __init x25_proc_init(void)
301 struct proc_dir_entry *p; 302 struct proc_dir_entry *p;
302 int rc = -ENOMEM; 303 int rc = -ENOMEM;
303 304
304 x25_proc_dir = proc_mkdir("x25", proc_net); 305 x25_proc_dir = proc_mkdir("x25", init_net.proc_net);
305 if (!x25_proc_dir) 306 if (!x25_proc_dir)
306 goto out; 307 goto out;
307 308
@@ -328,7 +329,7 @@ out_forward:
328out_socket: 329out_socket:
329 remove_proc_entry("route", x25_proc_dir); 330 remove_proc_entry("route", x25_proc_dir);
330out_route: 331out_route:
331 remove_proc_entry("x25", proc_net); 332 remove_proc_entry("x25", init_net.proc_net);
332 goto out; 333 goto out;
333} 334}
334 335
@@ -337,7 +338,7 @@ void __exit x25_proc_exit(void)
337 remove_proc_entry("forward", x25_proc_dir); 338 remove_proc_entry("forward", x25_proc_dir);
338 remove_proc_entry("route", x25_proc_dir); 339 remove_proc_entry("route", x25_proc_dir);
339 remove_proc_entry("socket", x25_proc_dir); 340 remove_proc_entry("socket", x25_proc_dir);
340 remove_proc_entry("x25", proc_net); 341 remove_proc_entry("x25", init_net.proc_net);
341} 342}
342 343
343#else /* CONFIG_PROC_FS */ 344#else /* CONFIG_PROC_FS */