summaryrefslogtreecommitdiff
path: root/net/8021q/vlanproc.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-16 00:51:12 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-16 00:51:12 -0700
commitcd1c701432fbf84ad5ea1d8012ddd398a560bccc (patch)
tree008bd395be444f5dc70b11a56e99ed86c186108e /net/8021q/vlanproc.c
parentd9ed0f0e2dba45eec79ffbdd841757f87712349b (diff)
[VLAN]: Add a net argument to proc init and cleanup calls.
All proc files will be created in each net, so prepare them for this change now, not to mess it with real creation patch. The net != &init_net checks in them are for git-bisect sanity, but I will drop them soon. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r--net/8021q/vlanproc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 24cd96ee8109..4d13aeb88584 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -138,8 +138,11 @@ static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = {
* Clean up /proc/net/vlan entries
*/
-void vlan_proc_cleanup(void)
+void vlan_proc_cleanup(struct net *net)
{
+ if (net != &init_net)
+ return;
+
if (proc_vlan_conf)
remove_proc_entry(name_conf, proc_vlan_dir);
@@ -155,8 +158,11 @@ void vlan_proc_cleanup(void)
* Create /proc/net/vlan entries
*/
-int __init vlan_proc_init(void)
+int vlan_proc_init(struct net *net)
{
+ if (net != &init_net)
+ return 0;
+
proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net);
if (!proc_vlan_dir)
goto err;
@@ -169,7 +175,7 @@ int __init vlan_proc_init(void)
err:
pr_err("%s: can't create entry in proc filesystem!\n", __func__);
- vlan_proc_cleanup();
+ vlan_proc_cleanup(net);
return -ENOBUFS;
}