Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172039
b: refs/heads/master
c: 1544974
h: refs/heads/master
i:
  172037: 985087f
  172035: 871c678
  172031: 34ad129
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Dec 2, 2009
1 parent 057f67b commit 8d76023
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 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: e008b5fc8dc7f46d9904001c7a2155eb1e7d35ab
refs/heads/master: 15449745e5d181ae214ceaf0880350bb4e63512a
32 changes: 9 additions & 23 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5103,42 +5103,28 @@ int bond_create(struct net *net, const char *name)

static int bond_net_init(struct net *net)
{
struct bond_net *bn;
int err;

err = -ENOMEM;
bn = kzalloc(sizeof(struct bond_net), GFP_KERNEL);
if (bn == NULL)
goto out;
struct bond_net *bn = net_generic(net, bond_net_id);

bn->net = net;
INIT_LIST_HEAD(&bn->dev_list);

err = net_assign_generic(net, bond_net_id, bn);
if (err)
goto out_free;

bond_create_proc_dir(bn);
out:
return err;
out_free:
kfree(bn);
goto out;

return 0;
}

static void bond_net_exit(struct net *net)
{
struct bond_net *bn;

bn = net_generic(net, bond_net_id);
struct bond_net *bn = net_generic(net, bond_net_id);

bond_destroy_proc_dir(bn);
kfree(bn);
}

static struct pernet_operations bond_net_ops = {
.init = bond_net_init,
.exit = bond_net_exit,
.id = &bond_net_id,
.size = sizeof(struct bond_net),
};

static int __init bonding_init(void)
Expand All @@ -5152,7 +5138,7 @@ static int __init bonding_init(void)
if (res)
goto out;

res = register_pernet_gen_subsys(&bond_net_id, &bond_net_ops);
res = register_pernet_subsys(&bond_net_ops);
if (res)
goto out;

Expand All @@ -5178,7 +5164,7 @@ static int __init bonding_init(void)
err:
rtnl_link_unregister(&bond_link_ops);
err_link:
unregister_pernet_gen_subsys(bond_net_id, &bond_net_ops);
unregister_pernet_subsys(&bond_net_ops);
goto out;

}
Expand All @@ -5192,7 +5178,7 @@ static void __exit bonding_exit(void)
bond_destroy_sysfs();

rtnl_link_unregister(&bond_link_ops);
unregister_pernet_gen_subsys(bond_net_id, &bond_net_ops);
unregister_pernet_subsys(&bond_net_ops);
}

module_init(bonding_init);
Expand Down

0 comments on commit 8d76023

Please sign in to comment.