diff options
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3d76686dcec..99610f358c4 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1002,6 +1002,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct static void bond_do_fail_over_mac(struct bonding *bond, struct slave *new_active, struct slave *old_active) + __releases(&bond->curr_slave_lock) + __releases(&bond->lock) + __acquires(&bond->lock) + __acquires(&bond->curr_slave_lock) { u8 tmp_mac[ETH_ALEN]; struct sockaddr saddr; @@ -1710,6 +1714,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) case BOND_MODE_ALB: new_slave->state = BOND_STATE_ACTIVE; bond_set_slave_inactive_flags(new_slave); + bond_select_active_slave(bond); break; default: pr_debug("This slave is always active in trunk mode\n"); @@ -3193,6 +3198,8 @@ out: #ifdef CONFIG_PROC_FS static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(&dev_base_lock) + __acquires(&bond->lock) { struct bonding *bond = seq->private; loff_t off = 0; @@ -3232,6 +3239,8 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) } static void bond_info_seq_stop(struct seq_file *seq, void *v) + __releases(&bond->lock) + __releases(&dev_base_lock) { struct bonding *bond = seq->private; @@ -3369,7 +3378,7 @@ static int bond_info_seq_show(struct seq_file *seq, void *v) return 0; } -static struct seq_operations bond_info_seq_ops = { +static const struct seq_operations bond_info_seq_ops = { .start = bond_info_seq_start, .next = bond_info_seq_next, .stop = bond_info_seq_stop, @@ -3435,25 +3444,12 @@ static void bond_remove_proc_entry(struct bonding *bond) */ static void bond_create_proc_dir(void) { - int len = strlen(DRV_NAME); - - for (bond_proc_dir = init_net.proc_net->subdir; bond_proc_dir; - bond_proc_dir = bond_proc_dir->next) { - if ((bond_proc_dir->namelen == len) && - !memcmp(bond_proc_dir->name, DRV_NAME, len)) { - break; - } - } - if (!bond_proc_dir) { bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net); - if (bond_proc_dir) { - bond_proc_dir->owner = THIS_MODULE; - } else { + if (!bond_proc_dir) printk(KERN_WARNING DRV_NAME ": Warning: cannot create /proc/net/%s\n", DRV_NAME); - } } } @@ -3462,25 +3458,7 @@ static void bond_create_proc_dir(void) */ static void bond_destroy_proc_dir(void) { - struct proc_dir_entry *de; - - if (!bond_proc_dir) { - return; - } - - /* verify that the /proc dir is empty */ - for (de = bond_proc_dir->subdir; de; de = de->next) { - /* ignore . and .. */ - if (*(de->name) != '.') { - break; - } - } - - if (de) { - if (bond_proc_dir->owner == THIS_MODULE) { - bond_proc_dir->owner = NULL; - } - } else { + if (bond_proc_dir) { remove_proc_entry(DRV_NAME, init_net.proc_net); bond_proc_dir = NULL; } @@ -4739,7 +4717,7 @@ static void bond_free_all(void) */ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl) { - int mode = -1, i, rv; + int modeint = -1, i, rv; char *p, modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, }; for (p = (char *)buf; *p; p++) @@ -4749,13 +4727,13 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl) if (*p) rv = sscanf(buf, "%20s", modestr); else - rv = sscanf(buf, "%d", &mode); + rv = sscanf(buf, "%d", &modeint); if (!rv) return -1; for (i = 0; tbl[i].modename; i++) { - if (mode == tbl[i].mode) + if (modeint == tbl[i].mode) return tbl[i].mode; if (strcmp(modestr, tbl[i].modename) == 0) return tbl[i].mode; |