From: Martin Schwenke Date: Sun, 29 Mar 2015 06:49:02 +0000 (+1100) Subject: ctdb-recoverd: Make num_lmasters a local variable X-Git-Tag: tevent-0.9.25~536 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=1fd2d3886c41b0dd12cd1bebc3add75bd71b05bc ctdb-recoverd: Make num_lmasters a local variable It isn't used anywhere else and is always re-initialised to 0. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 49d69f09c74..391890677bc 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -225,7 +225,6 @@ struct ctdb_banning_state { struct ctdb_recoverd { struct ctdb_context *ctdb; uint32_t recmaster; - uint32_t num_lmasters; uint32_t last_culprit_node; struct ctdb_node_map *nodemap; struct timeval priority_time; @@ -3407,6 +3406,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, struct ctdb_node_map **remote_nodemaps=NULL; struct ctdb_vnn_map *vnnmap=NULL; struct ctdb_vnn_map *remote_vnnmap=NULL; + uint32_t num_lmasters; int32_t debug_level; int i, j, ret; bool self_ban; @@ -3589,13 +3589,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, } /* count how many active nodes there are */ - rec->num_lmasters = 0; + num_lmasters = 0; for (i=0; inum; i++) { if (!(nodemap->nodes[i].flags & NODE_FLAGS_INACTIVE)) { if (ctdb_node_has_capabilities(rec->caps, ctdb->nodes[i]->pnn, CTDB_CAP_LMASTER)) { - rec->num_lmasters++; + num_lmasters++; } } } @@ -3852,9 +3852,9 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, * there are active nodes with the lmaster capability... or * do a recovery. */ - if (vnnmap->size != rec->num_lmasters) { + if (vnnmap->size != num_lmasters) { DEBUG(DEBUG_ERR, (__location__ " The vnnmap count is different from the number of active lmaster nodes: %u vs %u\n", - vnnmap->size, rec->num_lmasters)); + vnnmap->size, num_lmasters)); ctdb_set_culprit(rec, ctdb->pnn); do_recovery(rec, mem_ctx, pnn, nodemap, vnnmap); return;