Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171095
b: refs/heads/master
c: c67dfb2
h: refs/heads/master
i:
  171093: 97fb7c7
  171091: 92310e5
  171087: fd0a191
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Oct 30, 2009
1 parent 29dcd56 commit 3eff1f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 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: 30c15ba9936a17d743f90eb3e2f6fa82acddc5f3
refs/heads/master: c67dfb299e05a132154b9bfaae4a83de478ffaa9
45 changes: 16 additions & 29 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ struct bond_parm_tbl ad_select_tbl[] = {

static void bond_send_gratuitous_arp(struct bonding *bond);
static int bond_init(struct net_device *bond_dev);
static void bond_deinit(struct net_device *bond_dev);
static void bond_uninit(struct net_device *bond_dev);

/*---------------------------- General routines -----------------------------*/

Expand Down Expand Up @@ -2002,24 +2002,6 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
return 0; /* deletion OK */
}

/*
* Destroy a bonding device.
* Must be under rtnl_lock when this function is called.
*/
static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);

bond_deinit(bond_dev);

if (bond->wq)
destroy_workqueue(bond->wq);

netif_addr_lock_bh(bond_dev);
bond_mc_list_destroy(bond);
netif_addr_unlock_bh(bond_dev);
}

/*
* First release a slave and than destroy the bond if no more slaves are left.
* Must be under rtnl_lock when this function is called.
Expand Down Expand Up @@ -3467,9 +3449,6 @@ static int bond_master_netdev_event(unsigned long event,
switch (event) {
case NETDEV_CHANGENAME:
return bond_event_changename(event_bond);
case NETDEV_UNREGISTER:
bond_release_all(event_bond->dev);
break;
default:
break;
}
Expand Down Expand Up @@ -4608,18 +4587,29 @@ static void bond_work_cancel_all(struct bonding *bond)
cancel_delayed_work(&bond->ad_work);
}

/* De-initialize device specific data.
* Caller must hold rtnl_lock.
*/
static void bond_deinit(struct net_device *bond_dev)
/*
* Destroy a bonding device.
* Must be under rtnl_lock when this function is called.
*/
static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);

/* Release the bonded slaves */
bond_release_all(bond_dev);

list_del(&bond->bond_list);

bond_work_cancel_all(bond);

bond_remove_proc_entry(bond);

if (bond->wq)
destroy_workqueue(bond->wq);

netif_addr_lock_bh(bond_dev);
bond_mc_list_destroy(bond);
netif_addr_unlock_bh(bond_dev);
}

/* Unregister and free all bond devices.
Expand All @@ -4632,9 +4622,6 @@ static void bond_free_all(void)
list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) {
struct net_device *bond_dev = bond->dev;

bond_work_cancel_all(bond);
/* Release the bonded slaves */
bond_release_all(bond_dev);
unregister_netdevice(bond_dev);
}

Expand Down

0 comments on commit 3eff1f4

Please sign in to comment.