Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15721
b: refs/heads/master
c: b76cdba
h: refs/heads/master
i:
  15719: 8add5c4
v: v3
  • Loading branch information
Mitch Williams authored and John W. Linville committed Nov 13, 2005
1 parent 71a2b98 commit 755fa46
Show file tree
Hide file tree
Showing 5 changed files with 1,430 additions and 3 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: 4756b02f558cbbbef5ae278fd3bbed778458c124
refs/heads/master: b76cdba9cdb29b091cacb4c11534ffb2eac02f64
2 changes: 1 addition & 1 deletion trunk/drivers/net/bonding/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

obj-$(CONFIG_BONDING) += bonding.o

bonding-objs := bond_main.o bond_3ad.o bond_alb.o
bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o

23 changes: 22 additions & 1 deletion trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ LIST_HEAD(bond_dev_list);
static struct proc_dir_entry *bond_proc_dir = NULL;
#endif

extern struct rw_semaphore bonding_rwsem;
static u32 arp_target[BOND_MAX_ARP_TARGETS] = { 0, } ;
static int arp_ip_count = 0;
static int bond_mode = BOND_MODE_ROUNDROBIN;
Expand Down Expand Up @@ -1960,6 +1961,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)

write_unlock_bh(&bond->lock);

res = bond_create_slave_symlinks(bond_dev, slave_dev);
if (res)
goto err_unset_master;

printk(KERN_INFO DRV_NAME
": %s: enslaving %s as a%s interface with a%s link.\n",
bond_dev->name, slave_dev->name,
Expand Down Expand Up @@ -2133,6 +2138,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)

write_unlock_bh(&bond->lock);

/* must do this from outside any spinlocks */
bond_destroy_slave_symlinks(bond_dev, slave_dev);

bond_del_vlans_from_slave(bond, slave_dev);

/* If the mode USES_PRIMARY, then we should only remove its
Expand Down Expand Up @@ -2224,6 +2232,7 @@ static int bond_release_all(struct net_device *bond_dev)
*/
write_unlock_bh(&bond->lock);

bond_destroy_slave_symlinks(bond_dev, slave_dev);
bond_del_vlans_from_slave(bond, slave_dev);

/* If the mode USES_PRIMARY, then we should only remove its
Expand Down Expand Up @@ -3518,7 +3527,10 @@ static int bond_event_changename(struct bonding *bond)
bond_remove_proc_entry(bond);
bond_create_proc_entry(bond);
#endif

down_write(&(bonding_rwsem));
bond_destroy_sysfs_entry(bond);
bond_create_sysfs_entry(bond);
up_write(&(bonding_rwsem));
return NOTIFY_DONE;
}

Expand Down Expand Up @@ -3995,6 +4007,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
return -EPERM;
}

down_write(&(bonding_rwsem));
slave_dev = dev_get_by_name(ifr->ifr_slave);

dprintk("slave_dev=%p: \n", slave_dev);
Expand Down Expand Up @@ -4027,6 +4040,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
dev_put(slave_dev);
}

up_write(&(bonding_rwsem));
return res;
}

Expand Down Expand Up @@ -4962,6 +4976,7 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
*newbond = bond_dev->priv;

rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(bond_dev->priv);
goto done;
out_bond:
bond_deinit(bond_dev);
Expand Down Expand Up @@ -4996,13 +5011,18 @@ static int __init bonding_init(void)
goto err;
}

res = bond_create_sysfs();
if (res)
goto err;

register_netdevice_notifier(&bond_netdev_notifier);
register_inetaddr_notifier(&bond_inetaddr_notifier);

goto out;
err:
rtnl_lock();
bond_free_all();
bond_destroy_sysfs();
rtnl_unlock();
out:
return res;
Expand All @@ -5016,6 +5036,7 @@ static void __exit bonding_exit(void)

rtnl_lock();
bond_free_all();
bond_destroy_sysfs();
rtnl_unlock();
}

Expand Down
Loading

0 comments on commit 755fa46

Please sign in to comment.