Commit 46bb4807 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

bonding: modify bond_get_slave_by_dev() to use neighbours

It should be used under rtnl/bonding lock, so use the non-RCU version.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1f718f0f
...@@ -276,13 +276,7 @@ struct bonding { ...@@ -276,13 +276,7 @@ struct bonding {
static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
struct slave *slave = NULL; return netdev_lower_dev_get_private(bond->dev, slave_dev);
bond_for_each_slave(bond, slave)
if (slave->dev == slave_dev)
return slave;
return NULL;
} }
static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment