Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172040
b: refs/heads/master
c: 946d1a9
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Dec 2, 2009
1 parent 8d76023 commit da3f823
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15449745e5d181ae214ceaf0880350bb4e63512a
refs/heads/master: 946d1a9298c9e592b189a168326603c92d782b5f
33 changes: 7 additions & 26 deletions trunk/net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,47 +686,28 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)

static int vlan_init_net(struct net *net)
{
struct vlan_net *vn = net_generic(net, vlan_net_id);
int err;
struct vlan_net *vn;

err = -ENOMEM;
vn = kzalloc(sizeof(struct vlan_net), GFP_KERNEL);
if (vn == NULL)
goto err_alloc;

err = net_assign_generic(net, vlan_net_id, vn);
if (err < 0)
goto err_assign;

vn->name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD;

err = vlan_proc_init(net);
if (err < 0)
goto err_proc;

return 0;

err_proc:
/* nothing */
err_assign:
kfree(vn);
err_alloc:
return err;
}

static void vlan_exit_net(struct net *net)
{
struct vlan_net *vn;

vn = net_generic(net, vlan_net_id);
rtnl_kill_links(net, &vlan_link_ops);

vlan_proc_cleanup(net);
kfree(vn);
}

static struct pernet_operations vlan_net_ops = {
.init = vlan_init_net,
.exit = vlan_exit_net,
.id = &vlan_net_id,
.size = sizeof(struct vlan_net),
};

static int __init vlan_proto_init(void)
Expand All @@ -736,7 +717,7 @@ static int __init vlan_proto_init(void)
pr_info("%s v%s %s\n", vlan_fullname, vlan_version, vlan_copyright);
pr_info("All bugs added by %s\n", vlan_buggyright);

err = register_pernet_gen_device(&vlan_net_id, &vlan_net_ops);
err = register_pernet_device(&vlan_net_ops);
if (err < 0)
goto err0;

Expand All @@ -761,7 +742,7 @@ static int __init vlan_proto_init(void)
err3:
unregister_netdevice_notifier(&vlan_notifier_block);
err2:
unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
unregister_pernet_device(&vlan_net_ops);
err0:
return err;
}
Expand All @@ -781,7 +762,7 @@ static void __exit vlan_cleanup_module(void)
for (i = 0; i < VLAN_GRP_HASH_SIZE; i++)
BUG_ON(!hlist_empty(&vlan_group_hash[i]));

unregister_pernet_gen_device(vlan_net_id, &vlan_net_ops);
unregister_pernet_device(&vlan_net_ops);
rcu_barrier(); /* Wait for completion of call_rcu()'s */

vlan_gvrp_uninit();
Expand Down

0 comments on commit da3f823

Please sign in to comment.