Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171093
b: refs/heads/master
c: 6151b3d
h: refs/heads/master
i:
  171091: 92310e5
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Oct 30, 2009
1 parent 4ca25ed commit 97fb7c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 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: 0c509a6c9393b27a8c5a01acd4a72616206cfc24
refs/heads/master: 6151b3d435feeeae7487032fcd5c8c7f281ba05c
11 changes: 1 addition & 10 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,6 @@ static void bond_uninit(struct net_device *bond_dev)
struct bonding *bond = netdev_priv(bond_dev);

bond_deinit(bond_dev);
bond_destroy_sysfs_entry(bond);

if (bond->wq)
destroy_workqueue(bond->wq);
Expand Down Expand Up @@ -3457,9 +3456,6 @@ static int bond_event_changename(struct bonding *bond)
bond_remove_proc_entry(bond);
bond_create_proc_entry(bond);

bond_destroy_sysfs_entry(bond);
bond_create_sysfs_entry(bond);

return NOTIFY_DONE;
}

Expand Down Expand Up @@ -5078,6 +5074,7 @@ static int bond_init(struct net_device *bond_dev)
bond_create_proc_entry(bond);
list_add_tail(&bond->bond_list, &bond_dev_list);

bond_prepare_sysfs_group(bond);
return 0;
}

Expand Down Expand Up @@ -5120,15 +5117,9 @@ int bond_create(const char *name)
if (res < 0)
goto out_bond;

res = bond_create_sysfs_entry(netdev_priv(bond_dev));
if (res < 0)
goto out_unreg;

rtnl_unlock();
return 0;

out_unreg:
unregister_netdevice(bond_dev);
out_bond:
bond_deinit(bond_dev);
out_netdev:
Expand Down
20 changes: 2 additions & 18 deletions trunk/drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,24 +1616,8 @@ void bond_destroy_sysfs(void)
* Initialize sysfs for each bond. This sets up and registers
* the 'bondctl' directory for each individual bond under /sys/class/net.
*/
int bond_create_sysfs_entry(struct bonding *bond)
void bond_prepare_sysfs_group(struct bonding *bond)
{
struct net_device *dev = bond->dev;
int err;

err = sysfs_create_group(&(dev->dev.kobj), &bonding_group);
if (err)
pr_emerg("eek! didn't create group!\n");

return err;
}
/*
* Remove sysfs entries for each bond.
*/
void bond_destroy_sysfs_entry(struct bonding *bond)
{
struct net_device *dev = bond->dev;

sysfs_remove_group(&(dev->dev.kobj), &bonding_group);
bond->dev->sysfs_groups[0] = &bonding_group;
}

3 changes: 1 addition & 2 deletions trunk/drivers/net/bonding/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ int bond_create(const char *name);
int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *slave_dev);
int bond_create_sysfs(void);
void bond_destroy_sysfs(void);
void bond_destroy_sysfs_entry(struct bonding *bond);
int bond_create_sysfs_entry(struct bonding *bond);
void bond_prepare_sysfs_group(struct bonding *bond);
int bond_create_slave_symlinks(struct net_device *master, struct net_device *slave);
void bond_destroy_slave_symlinks(struct net_device *master, struct net_device *slave);
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev);
Expand Down

0 comments on commit 97fb7c7

Please sign in to comment.