summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-09-25 11:20:11 +0400
committerDavid S. Miller <davem@davemloft.net>2013-09-27 00:02:04 +0400
commit46bb4807b5d95a049b008efd639ff8942970d815 (patch)
treefabad7b75392d05ce3547779ec83dad83b49b962 /drivers
parent1f718f0f4f97145f4072d2d72dcf85069ca7226d (diff)
downloadlinux-46bb4807b5d95a049b008efd639ff8942970d815.tar.xz
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: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bonding.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 03cf3fd14490..90f4847b264b 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -276,13 +276,7 @@ struct bonding {
static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
struct net_device *slave_dev)
{
- struct slave *slave = NULL;
-
- bond_for_each_slave(bond, slave)
- if (slave->dev == slave_dev)
- return slave;
-
- return NULL;
+ return netdev_lower_dev_get_private(bond->dev, slave_dev);
}
static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)