summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorVeaceslav Falico2014-05-15 21:39:54 +0200
committerDavid S. Miller2014-05-16 22:34:32 +0200
commitec0865a94991d1819d4f99866a2492af8df5c882 (patch)
tree8b2e1a5987776e063e8a7dc1431e65394a7eef76 /drivers/net/bonding/bonding.h
parentbonding: make BOND_NO_USES_ARP an inline function (diff)
downloadkernel-qcow2-linux-ec0865a94991d1819d4f99866a2492af8df5c882.tar.gz
kernel-qcow2-linux-ec0865a94991d1819d4f99866a2492af8df5c882.tar.xz
kernel-qcow2-linux-ec0865a94991d1819d4f99866a2492af8df5c882.zip
bonding: make USES_PRIMARY inline functions
Change the name a bit to better reflect its scope, and update some comments. Two functions added - one which takes bond as a param and the other which takes the mode. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 105c552f96d8..1a27c18be21c 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -54,12 +54,6 @@
((slave)->link == BOND_LINK_UP) && \
bond_is_active_slave(slave))
-
-#define USES_PRIMARY(mode) \
- (((mode) == BOND_MODE_ACTIVEBACKUP) || \
- ((mode) == BOND_MODE_TLB) || \
- ((mode) == BOND_MODE_ALB))
-
#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \
((htonl(INADDR_BROADCAST) == a) || \
ipv4_is_zeronet(a))
@@ -293,6 +287,17 @@ static inline bool bond_mode_uses_arp(int mode)
mode != BOND_MODE_ALB;
}
+static inline bool bond_mode_uses_primary(int mode)
+{
+ return mode == BOND_MODE_ACTIVEBACKUP || mode == BOND_MODE_TLB ||
+ mode == BOND_MODE_ALB;
+}
+
+static inline bool bond_uses_primary(struct bonding *bond)
+{
+ return bond_mode_uses_primary(bond->params.mode);
+}
+
static inline void bond_set_active_slave(struct slave *slave)
{
if (slave->backup) {