From b070c7be6f687e197260a764abe4357d419b205c Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 12 Dec 2012 15:11:35 +0530 Subject: glusterd: Made volume-status use synctask framework Change-Id: Id4062799104e5831467ced65a43bfe377b6163f4 BUG: 852147 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/4297 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 8c632ffbf01..fcccf480598 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1932,11 +1932,8 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr, if (ret) goto out; - if (!rsp_dict) { - //this should happen only on source + if (is_origin_glusterd ()) { ret = 0; - rsp_dict = glusterd_op_get_ctx (); - if ((cmd & GF_CLI_STATUS_ALL)) { ret = glusterd_get_all_volnames (rsp_dict); if (ret) @@ -2868,7 +2865,7 @@ out: * hostnames etc. */ void -glusterd_op_modify_op_ctx (glusterd_op_t op) +glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx) { int ret = -1; dict_t *op_ctx = NULL; @@ -2881,7 +2878,11 @@ glusterd_op_modify_op_ctx (glusterd_op_t op) this = THIS; GF_ASSERT (this); - op_ctx = glusterd_op_get_ctx(); + if (ctx) + op_ctx = ctx; + else + op_ctx = glusterd_op_get_ctx(); + if (!op_ctx) { gf_log (this->name, GF_LOG_CRITICAL, "Operation context is not present."); @@ -3129,7 +3130,7 @@ out: ret = glusterd_op_start_rb_timer (op_dict); } else { - glusterd_op_modify_op_ctx (op); + glusterd_op_modify_op_ctx (op, NULL); ret = glusterd_op_sm_inject_all_acc (); } goto err; @@ -3299,7 +3300,7 @@ out: if (ret) ret = glusterd_op_sm_inject_event (GD_OP_EVENT_RCVD_RJT, NULL); else if (!opinfo.pending_count) { - glusterd_op_modify_op_ctx (op); + glusterd_op_modify_op_ctx (op, NULL); ret = glusterd_op_sm_inject_event (GD_OP_EVENT_COMMIT_ACC, NULL); } /*else do nothing*/ -- cgit