From 6be13228c45188b104ffde22cee36fb24db8484d Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Thu, 11 Oct 2012 22:43:17 +0530 Subject: glusterd: volume-start, add-brick and remove-brick to use synctask framework - Added volume-id validation to glusterd-syncop code. - All daemons are restarted using synctasks in init(). - glusterd_brick_start has wait/nowait variants to support volume commands using synctask framework and those that aren't. Change-Id: Ieec26fe1ea7e5faac88cc7798d93e4cc2b399d34 BUG: 862834 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/3969 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index d0a97b138..5e93c061d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -514,7 +514,7 @@ brick_val: "failed to set the new type in dict"); } - ret = glusterd_op_begin (req, GD_OP_ADD_BRICK, dict); + ret = glusterd_op_begin_synctask (req, GD_OP_ADD_BRICK, dict); out: if (ret) { @@ -531,9 +531,6 @@ out: ret = 0; //sent error to cli, prevent second reply } - glusterd_friend_sm (); - glusterd_op_sm (); - free (cli_req.dict.dict_val); //its malloced by xdr return ret; @@ -806,7 +803,7 @@ glusterd_handle_remove_brick (rpcsvc_request_t *req) } } - ret = glusterd_op_begin (req, GD_OP_REMOVE_BRICK, dict); + ret = glusterd_op_begin_synctask (req, GD_OP_REMOVE_BRICK, dict); out: if (ret) { @@ -828,9 +825,6 @@ out: GF_FREE (brick_list); free (cli_req.dict.dict_val); //its malloced by xdr - glusterd_friend_sm (); - glusterd_op_sm (); - return ret; } @@ -938,7 +932,8 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, if (ret) goto out; - ret = glusterd_brick_start (volinfo, brickinfo); + ret = glusterd_brick_start (volinfo, brickinfo, + _gf_true); if (ret) goto out; i++; -- cgit