diff options
author | Michael Adam <obnox@samba.org> | 2011-02-22 22:47:30 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-02-24 10:35:24 +0100 |
commit | e0502666904dac951bf1eb40c0688951b06b612c (patch) | |
tree | 42250918deeaef21f7639044c6d13c7304736766 /ctdb/server/ctdb_persistent.c | |
parent | 033ba0b466942349295f17e0f3d7b84aabb2c39f (diff) | |
download | samba-e0502666904dac951bf1eb40c0688951b06b612c.tar.gz samba-e0502666904dac951bf1eb40c0688951b06b612c.tar.xz samba-e0502666904dac951bf1eb40c0688951b06b612c.zip |
persistent: reduce indentation for the finishing moves in ctdb_persistent_callback
(This used to be ctdb commit 2c2d1646eb753ea9561f085bcb101153267b052b)
Diffstat (limited to 'ctdb/server/ctdb_persistent.c')
-rw-r--r-- | ctdb/server/ctdb_persistent.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c index 5733290852..e49eac493c 100644 --- a/ctdb/server/ctdb_persistent.c +++ b/ctdb/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); } /* |