提交 8d2ada77 编写于 作者: N nikolay@redhat.com 提交者: David S. Miller

bonding: remove unnecessary setup_by_slave member

We have a member called setup_by_slave in struct bonding to denote if the
bond dev has different type than ARPHRD_ETHER, but that is already denoted
in bond's netdev type variable if it was setup by the slave, so use that
instead of the member.
Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3a36515f
...@@ -1382,8 +1382,6 @@ static void bond_compute_features(struct bonding *bond) ...@@ -1382,8 +1382,6 @@ static void bond_compute_features(struct bonding *bond)
static void bond_setup_by_slave(struct net_device *bond_dev, static void bond_setup_by_slave(struct net_device *bond_dev,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
struct bonding *bond = netdev_priv(bond_dev);
bond_dev->header_ops = slave_dev->header_ops; bond_dev->header_ops = slave_dev->header_ops;
bond_dev->type = slave_dev->type; bond_dev->type = slave_dev->type;
...@@ -1392,7 +1390,6 @@ static void bond_setup_by_slave(struct net_device *bond_dev, ...@@ -1392,7 +1390,6 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
memcpy(bond_dev->broadcast, slave_dev->broadcast, memcpy(bond_dev->broadcast, slave_dev->broadcast,
slave_dev->addr_len); slave_dev->addr_len);
bond->setup_by_slave = 1;
} }
/* On bonding slaves other than the currently active slave, suppress /* On bonding slaves other than the currently active slave, suppress
...@@ -3187,7 +3184,7 @@ static int bond_slave_netdev_event(unsigned long event, ...@@ -3187,7 +3184,7 @@ static int bond_slave_netdev_event(unsigned long event,
switch (event) { switch (event) {
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
if (bond->setup_by_slave) if (bond_dev->type != ARPHRD_ETHER)
bond_release_and_destroy(bond_dev, slave_dev); bond_release_and_destroy(bond_dev, slave_dev);
else else
bond_release(bond_dev, slave_dev); bond_release(bond_dev, slave_dev);
......
...@@ -226,7 +226,6 @@ struct bonding { ...@@ -226,7 +226,6 @@ struct bonding {
rwlock_t lock; rwlock_t lock;
rwlock_t curr_slave_lock; rwlock_t curr_slave_lock;
u8 send_peer_notif; u8 send_peer_notif;
s8 setup_by_slave;
u8 igmp_retrans; u8 igmp_retrans;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_entry; struct proc_dir_entry *proc_entry;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册