summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2014-03-31 07:50:45 +0200
committerMichael Adam <obnox@samba.org>2014-04-01 00:55:45 +0200
commitdd56afc7df1149e809486bc0f1c336a42bc7c0aa (patch)
treeac379dfcf761e6ae3227d16a95ec87ef17ca9130
parentd550acf24a8ec20e3e32891ed702c6cc42bc3dee (diff)
downloadsamba-dd56afc7df1149e809486bc0f1c336a42bc7c0aa.tar.gz
samba-dd56afc7df1149e809486bc0f1c336a42bc7c0aa.tar.xz
samba-dd56afc7df1149e809486bc0f1c336a42bc7c0aa.zip
ctdb:daemon take a shortcut in all_nodes_are_disabled()
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--ctdb/server/ctdb_takeover.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index bbb0226368..b9bba4abe2 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -2204,17 +2204,16 @@ finished:
static bool all_nodes_are_disabled(struct ctdb_node_map *nodemap)
{
- int i, num_healthy;
+ int i;
- /* Count how many completely healthy nodes we have */
- num_healthy = 0;
for (i=0;i<nodemap->num;i++) {
if (!(nodemap->nodes[i].flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED))) {
- num_healthy++;
+ /* Found one completely healthy node */
+ return false;
}
}
- return num_healthy == 0;
+ return true;
}
/* The calculation part of the IP allocation algorithm. */