mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-07 13:53:24 +00:00
net: remove netdev_bonding_change()
I don't see any benifits to use netdev_bonding_change() than using call_netdevice_notifiers() directly. Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee89bab14e
commit
b7bc2a5b5b
@ -1120,10 +1120,10 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
|
|||||||
write_unlock_bh(&bond->curr_slave_lock);
|
write_unlock_bh(&bond->curr_slave_lock);
|
||||||
read_unlock(&bond->lock);
|
read_unlock(&bond->lock);
|
||||||
|
|
||||||
netdev_bonding_change(bond->dev, NETDEV_BONDING_FAILOVER);
|
call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev);
|
||||||
if (should_notify_peers)
|
if (should_notify_peers)
|
||||||
netdev_bonding_change(bond->dev,
|
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
|
||||||
NETDEV_NOTIFY_PEERS);
|
bond->dev);
|
||||||
|
|
||||||
read_lock(&bond->lock);
|
read_lock(&bond->lock);
|
||||||
write_lock_bh(&bond->curr_slave_lock);
|
write_lock_bh(&bond->curr_slave_lock);
|
||||||
@ -1560,8 +1560,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
|||||||
bond_dev->name,
|
bond_dev->name,
|
||||||
bond_dev->type, slave_dev->type);
|
bond_dev->type, slave_dev->type);
|
||||||
|
|
||||||
res = netdev_bonding_change(bond_dev,
|
res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
|
||||||
NETDEV_PRE_TYPE_CHANGE);
|
bond_dev);
|
||||||
res = notifier_to_errno(res);
|
res = notifier_to_errno(res);
|
||||||
if (res) {
|
if (res) {
|
||||||
pr_err("%s: refused to change device type\n",
|
pr_err("%s: refused to change device type\n",
|
||||||
@ -1581,8 +1581,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
|||||||
bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
|
bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
|
||||||
}
|
}
|
||||||
|
|
||||||
netdev_bonding_change(bond_dev,
|
call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE,
|
||||||
NETDEV_POST_TYPE_CHANGE);
|
bond_dev);
|
||||||
}
|
}
|
||||||
} else if (bond_dev->type != slave_dev->type) {
|
} else if (bond_dev->type != slave_dev->type) {
|
||||||
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
|
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
|
||||||
@ -1943,7 +1943,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
block_netpoll_tx();
|
block_netpoll_tx();
|
||||||
netdev_bonding_change(bond_dev, NETDEV_RELEASE);
|
call_netdevice_notifiers(NETDEV_RELEASE, bond_dev);
|
||||||
write_lock_bh(&bond->lock);
|
write_lock_bh(&bond->lock);
|
||||||
|
|
||||||
slave = bond_get_slave_by_dev(bond, slave_dev);
|
slave = bond_get_slave_by_dev(bond, slave_dev);
|
||||||
@ -2586,7 +2586,7 @@ void bond_mii_monitor(struct work_struct *work)
|
|||||||
read_unlock(&bond->lock);
|
read_unlock(&bond->lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
netdev_bonding_change(bond->dev, NETDEV_NOTIFY_PEERS);
|
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3205,7 +3205,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
|
|||||||
read_unlock(&bond->lock);
|
read_unlock(&bond->lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
netdev_bonding_change(bond->dev, NETDEV_NOTIFY_PEERS);
|
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2595,8 +2595,6 @@ extern int dev_set_promiscuity(struct net_device *dev, int inc);
|
|||||||
extern int dev_set_allmulti(struct net_device *dev, int inc);
|
extern int dev_set_allmulti(struct net_device *dev, int inc);
|
||||||
extern void netdev_state_change(struct net_device *dev);
|
extern void netdev_state_change(struct net_device *dev);
|
||||||
extern void netdev_notify_peers(struct net_device *dev);
|
extern void netdev_notify_peers(struct net_device *dev);
|
||||||
extern int netdev_bonding_change(struct net_device *dev,
|
|
||||||
unsigned long event);
|
|
||||||
extern void netdev_features_change(struct net_device *dev);
|
extern void netdev_features_change(struct net_device *dev);
|
||||||
/* Load a device via the kmod */
|
/* Load a device via the kmod */
|
||||||
extern void dev_load(struct net *net, const char *name);
|
extern void dev_load(struct net *net, const char *name);
|
||||||
|
@ -1124,12 +1124,6 @@ void netdev_notify_peers(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(netdev_notify_peers);
|
EXPORT_SYMBOL(netdev_notify_peers);
|
||||||
|
|
||||||
int netdev_bonding_change(struct net_device *dev, unsigned long event)
|
|
||||||
{
|
|
||||||
return call_netdevice_notifiers(event, dev);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(netdev_bonding_change);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dev_load - load a network module
|
* dev_load - load a network module
|
||||||
* @net: the applicable net namespace
|
* @net: the applicable net namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user