From 64361d9778ffbb971b149fbf619452201a2e9c17 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 21 Jun 2016 16:34:44 +1000 Subject: ctdb-ipalloc: Make no_ip_failback a boolean No need to expose tunable values that far down. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/server/ctdb_takeover.c | 2 +- ctdb/server/ipalloc.h | 2 +- ctdb/server/ipalloc_deterministic.c | 2 +- ctdb/server/ipalloc_lcp2.c | 2 +- ctdb/server/ipalloc_nondeterministic.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ctdb/server') diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index efa466a77a0..fe94c09eea1 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -1428,7 +1428,7 @@ static struct ipalloc_state * ipalloc_state_init(struct ctdb_context *ctdb, ipalloc_state->algorithm = IPALLOC_NONDETERMINISTIC; } - ipalloc_state->no_ip_failback = ctdb->tunable.no_ip_failback; + ipalloc_state->no_ip_failback = (ctdb->tunable.no_ip_failback != 0); return ipalloc_state; fail: diff --git a/ctdb/server/ipalloc.h b/ctdb/server/ipalloc.h index 3d7d783d887..990fca46d1c 100644 --- a/ctdb/server/ipalloc.h +++ b/ctdb/server/ipalloc.h @@ -51,7 +51,7 @@ struct ipalloc_state { struct public_ip_list *all_ips; enum ipalloc_algorithm algorithm; - uint32_t no_ip_failback; + bool no_ip_failback; uint32_t *force_rebalance_nodes; }; diff --git a/ctdb/server/ipalloc_deterministic.c b/ctdb/server/ipalloc_deterministic.c index 2801bf6c25e..c11d5f9dc71 100644 --- a/ctdb/server/ipalloc_deterministic.c +++ b/ctdb/server/ipalloc_deterministic.c @@ -48,7 +48,7 @@ bool ipalloc_deterministic(struct ipalloc_state *ipalloc_state) * IPs, since the modulo step above implicitly fails * back IPs to their "home" node. */ - if (1 == ipalloc_state->no_ip_failback) { + if (ipalloc_state->no_ip_failback) { DEBUG(DEBUG_WARNING, ("WARNING: 'NoIPFailback' set but ignored - incompatible with 'DeterministicIPs\n")); } diff --git a/ctdb/server/ipalloc_lcp2.c b/ctdb/server/ipalloc_lcp2.c index a4b3bdb028e..48e0d0218e8 100644 --- a/ctdb/server/ipalloc_lcp2.c +++ b/ctdb/server/ipalloc_lcp2.c @@ -487,7 +487,7 @@ bool ipalloc_lcp2(struct ipalloc_state *ipalloc_state) lcp2_allocate_unassigned(ipalloc_state, lcp2_imbalances); /* If we don't want IPs to fail back then don't rebalance IPs. */ - if (1 == ipalloc_state->no_ip_failback) { + if (ipalloc_state->no_ip_failback) { goto finished; } diff --git a/ctdb/server/ipalloc_nondeterministic.c b/ctdb/server/ipalloc_nondeterministic.c index 300d8f1982f..9951aaac91c 100644 --- a/ctdb/server/ipalloc_nondeterministic.c +++ b/ctdb/server/ipalloc_nondeterministic.c @@ -134,7 +134,7 @@ bool ipalloc_nondeterministic(struct ipalloc_state *ipalloc_state) basic_allocate_unassigned(ipalloc_state); /* If we don't want IPs to fail back then don't rebalance IPs. */ - if (1 == ipalloc_state->no_ip_failback) { + if (ipalloc_state->no_ip_failback) { return true; } -- cgit v1.2.1