Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103060
b: refs/heads/master
c: b8a9787
h: refs/heads/master
v: v3
  • Loading branch information
Jay Vosburgh authored and Jeff Garzik committed Jun 18, 2008
1 parent 8777a67 commit 38ee1fc
Show file tree
Hide file tree
Showing 6 changed files with 25 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: b59f9f74c4c0a569398f08c34a877f1b7b457496
refs/heads/master: b8a9787eddb0e4665f31dd1d64584732b2b5d051
3 changes: 2 additions & 1 deletion trunk/Documentation/networking/bonding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ max_bonds
Specifies the number of bonding devices to create for this
instance of the bonding driver. E.g., if max_bonds is 3, and
the bonding driver is not already loaded, then bond0, bond1
and bond2 will be created. The default value is 1.
and bond2 will be created. The default value is 1. Specifying
a value of 0 will load bonding, but will not create any devices.

miimon

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4750,11 +4750,11 @@ static int bond_check_params(struct bond_params *params)
}
}

if (max_bonds < 1 || max_bonds > INT_MAX) {
if (max_bonds < 0 || max_bonds > INT_MAX) {
printk(KERN_WARNING DRV_NAME
": Warning: max_bonds (%d) not in range %d-%d, so it "
"was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);
max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
max_bonds = BOND_DEFAULT_MAX_BONDS;
}

Expand Down Expand Up @@ -4953,7 +4953,7 @@ static int bond_check_params(struct bond_params *params)

printk("\n");

} else {
} else if (max_bonds) {
/* miimon and arp_interval not set, we need one so things
* work as expected, see bonding.txt for details
*/
Expand Down
22 changes: 3 additions & 19 deletions trunk/drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ extern struct bond_parm_tbl arp_validate_tbl[];
extern struct bond_parm_tbl fail_over_mac_tbl[];

static int expected_refcount = -1;
static struct class *netdev_class;
/*--------------------------- Data Structures -----------------------------*/

/* Bonding sysfs lock. Why can't we just use the subsystem lock?
Expand Down Expand Up @@ -1447,19 +1446,9 @@ static struct attribute_group bonding_group = {
*/
int bond_create_sysfs(void)
{
int ret = 0;
struct bonding *firstbond;

/* get the netdev class pointer */
firstbond = container_of(bond_dev_list.next, struct bonding, bond_list);
if (!firstbond)
return -ENODEV;

netdev_class = firstbond->dev->dev.class;
if (!netdev_class)
return -ENODEV;
int ret;

ret = class_create_file(netdev_class, &class_attr_bonding_masters);
ret = netdev_class_create_file(&class_attr_bonding_masters);
/*
* Permit multiple loads of the module by ignoring failures to
* create the bonding_masters sysfs file. Bonding devices
Expand All @@ -1478,10 +1467,6 @@ int bond_create_sysfs(void)
printk(KERN_ERR
"network device named %s already exists in sysfs",
class_attr_bonding_masters.attr.name);
else {
netdev_class = NULL;
return 0;
}
}

return ret;
Expand All @@ -1493,8 +1478,7 @@ int bond_create_sysfs(void)
*/
void bond_destroy_sysfs(void)
{
if (netdev_class)
class_remove_file(netdev_class, &class_attr_bonding_masters);
netdev_class_remove_file(&class_attr_bonding_masters);
}

/*
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,9 @@ extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos);
extern void dev_seq_stop(struct seq_file *seq, void *v);
#endif

extern int netdev_class_create_file(struct class_attribute *class_attr);
extern void netdev_class_remove_file(struct class_attribute *class_attr);

extern void linkwatch_run_queue(void);

extern int netdev_compute_features(unsigned long all, unsigned long one);
Expand Down
13 changes: 13 additions & 0 deletions trunk/net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,19 @@ int netdev_register_kobject(struct net_device *net)
return device_add(dev);
}

int netdev_class_create_file(struct class_attribute *class_attr)
{
return class_create_file(&net_class, class_attr);
}

void netdev_class_remove_file(struct class_attribute *class_attr)
{
class_remove_file(&net_class, class_attr);
}

EXPORT_SYMBOL(netdev_class_create_file);
EXPORT_SYMBOL(netdev_class_remove_file);

void netdev_initialize_kobject(struct net_device *net)
{
struct device *device = &(net->dev);
Expand Down

0 comments on commit 38ee1fc

Please sign in to comment.