From: Michael Adam Date: Tue, 22 Feb 2011 21:47:30 +0000 (+0100) Subject: persistent: reduce indentation for the finishing moves in ctdb_persistent_callback X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=d674158a16ab45f3b2cab2486daf0c6357b2ae34;hp=c596633c74a8b6ca370f069184a3ab02ee87fba1;p=sahlberg%2Fctdb.git persistent: reduce indentation for the finishing moves in ctdb_persistent_callback --- diff --git a/server/ctdb_persistent.c b/server/ctdb_persistent.c index 57332908..e49eac49 100644 --- a/server/ctdb_persistent.c +++ b/server/ctdb_persistent.c @@ -52,6 +52,7 @@ static void ctdb_persistent_callback(struct ctdb_context *ctdb, { struct ctdb_persistent_state *state = talloc_get_type(private_data, struct ctdb_persistent_state); + enum ctdb_trans2_commit_error etype; if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) { DEBUG(DEBUG_INFO, ("ctdb_persistent_callback: ignoring reply " @@ -78,18 +79,21 @@ static void ctdb_persistent_callback(struct ctdb_context *ctdb, } state->num_pending--; - if (state->num_pending == 0) { - enum ctdb_trans2_commit_error etype; - if (state->num_failed == state->num_sent) { - etype = CTDB_TRANS2_COMMIT_ALLFAIL; - } else if (state->num_failed != 0) { - etype = CTDB_TRANS2_COMMIT_SOMEFAIL; - } else { - etype = CTDB_TRANS2_COMMIT_SUCCESS; - } - ctdb_request_control_reply(state->ctdb, state->c, NULL, etype, state->errormsg); - talloc_free(state); + + if (state->num_pending != 0) { + return; } + + if (state->num_failed == state->num_sent) { + etype = CTDB_TRANS2_COMMIT_ALLFAIL; + } else if (state->num_failed != 0) { + etype = CTDB_TRANS2_COMMIT_SOMEFAIL; + } else { + etype = CTDB_TRANS2_COMMIT_SUCCESS; + } + + ctdb_request_control_reply(state->ctdb, state->c, NULL, etype, state->errormsg); + talloc_free(state); } /*