git.samba.org
/
sahlberg
/
ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c596633
)
persistent: reduce indentation for the finishing moves in ctdb_persistent_callback
author
Michael Adam
<obnox@samba.org>
Tue, 22 Feb 2011 21:47:30 +0000
(22:47 +0100)
committer
Michael Adam
<obnox@samba.org>
Thu, 24 Feb 2011 09:31:59 +0000
(10:31 +0100)
server/ctdb_persistent.c
patch
|
blob
|
history
diff --git
a/server/ctdb_persistent.c
b/server/ctdb_persistent.c
index 573329085298a2e76f616750c6d20db339cf384c..e49eac493c8c42b320064d4da495b15fad69f70b 100644
(file)
--- 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);
{
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 "
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--;
}
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);
}
/*
}
/*