aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/x25_proc.c
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 /net/x25/x25_proc.c
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>
Diffstat (limited to 'net/x25/x25_proc.c')
-rw-r--r--net/x25/x25_proc.c7
1 files changed, 4 insertions, 3 deletions
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 */