summaryrefslogtreecommitdiff
path: root/net/8021q/vlan.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/vlan.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/vlan.c')
-rw-r--r--net/8021q/vlan.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 92966016a221..541542e2a2c1 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -642,8 +642,14 @@ static int vlan_init_net(struct net *net)
if (err < 0)
goto err_assign;
+ err = vlan_proc_init(net);
+ if (err < 0)
+ goto err_proc;
+
return 0;
+err_proc:
+ /* nothing */
err_assign:
kfree(vn);
err_alloc:
@@ -655,6 +661,7 @@ static void vlan_exit_net(struct net *net)
struct vlan_net *vn;
vn = net_generic(net, vlan_net_id);
+ vlan_proc_cleanup(net);
kfree(vn);
}
@@ -674,10 +681,6 @@ static int __init vlan_proto_init(void)
if (err < 0)
goto err0;
- err = vlan_proc_init();
- if (err < 0)
- goto err1;
-
err = register_netdevice_notifier(&vlan_notifier_block);
if (err < 0)
goto err2;
@@ -693,8 +696,6 @@ static int __init vlan_proto_init(void)
err3:
unregister_netdevice_notifier(&vlan_notifier_block);
err2:
- vlan_proc_cleanup();
-err1:
unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
err0:
return err;
@@ -715,8 +716,6 @@ static void __exit vlan_cleanup_module(void)
for (i = 0; i < VLAN_GRP_HASH_SIZE; i++)
BUG_ON(!hlist_empty(&vlan_group_hash[i]));
- vlan_proc_cleanup();
-
unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
synchronize_net();