From 1218854afa6f659be90b748cf1bc7badee954a35 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Wed, 26 Mar 2008 02:36:06 +0900 Subject: [NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS. Without CONFIG_NET_NS, no namespace other than &init_net exists, no need to store net in seq_net_private. Signed-off-by: YOSHIFUJI Hideaki --- fs/proc/proc_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs') diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 4caa5f774fb..13cd7835d0d 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -44,7 +44,9 @@ int seq_open_net(struct inode *ino, struct file *f, put_net(net); return -ENOMEM; } +#ifdef CONFIG_NET_NS p->net = net; +#endif return 0; } EXPORT_SYMBOL_GPL(seq_open_net); @@ -52,12 +54,10 @@ EXPORT_SYMBOL_GPL(seq_open_net); int seq_release_net(struct inode *ino, struct file *f) { struct seq_file *seq; - struct seq_net_private *p; seq = f->private_data; - p = seq->private; - put_net(p->net); + put_net(seq_file_net(seq)); seq_release_private(ino, f); return 0; } -- cgit v1.2.3 From 0e5f8be1388093edc324a78ebf241170b258eba3 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Thu, 27 Mar 2008 14:25:53 -0700 Subject: [NETNS]: Compile NET /proc support only if CONFIG_NET is set. This fix broken compilation for 'allnoconfig'. This was introduced by Introduced by commit 1218854afa6f659be90b748cf1bc7badee954a35 ("[NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.") Signed-off-by: Denis V. Lunev Acked-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- fs/proc/proc_net.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs') diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 13cd7835d0d..7034facf8b8 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -51,6 +51,7 @@ int seq_open_net(struct inode *ino, struct file *f, } EXPORT_SYMBOL_GPL(seq_open_net); +#ifdef CONFIG_NET int seq_release_net(struct inode *ino, struct file *f) { struct seq_file *seq; @@ -218,3 +219,4 @@ int __init proc_net_init(void) return register_pernet_subsys(&proc_net_ns_ops); } +#endif /* CONFIG_NET */ -- cgit v1.2.3 From 856f6ff7a3132c8e412b23a7b9157b68ac9a2baf Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Wed, 2 Apr 2008 00:10:04 -0700 Subject: [NETNS]: Remove ifdef CONFIG_NET braces in fs/proc/proc_net.c. They are redundant as this file is linked in iff CONFIG_NET is turned on. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- fs/proc/proc_net.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'fs') diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 7034facf8b8..13cd7835d0d 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -51,7 +51,6 @@ int seq_open_net(struct inode *ino, struct file *f, } EXPORT_SYMBOL_GPL(seq_open_net); -#ifdef CONFIG_NET int seq_release_net(struct inode *ino, struct file *f) { struct seq_file *seq; @@ -219,4 +218,3 @@ int __init proc_net_init(void) return register_pernet_subsys(&proc_net_ns_ops); } -#endif /* CONFIG_NET */ -- cgit v1.2.3