diff options
author | Amar Tumballi <amar@gluster.com> | 2011-11-12 22:02:37 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-16 01:46:50 -0800 |
commit | deac165b27d09e762743b180044c33ce90bbeaef (patch) | |
tree | 5a62ee9abd7e80dce99742b03aa51abd9830f201 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c | |
parent | a29ab15988f46fbe98151c37676185de970fb187 (diff) |
mgmt/glusterd: delete volume to have dictionary as context
earlier only DELETE_VOLUME was having volume name as context, where
as all other OPs used to have dictionary
Change-Id: I5bfcc458bff3295374eb4f0b0a31f6134745debd
BUG: 3158
Reviewed-on: http://review.gluster.com/718
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 6c3da47ea24..33b9c7f3e26 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -358,12 +358,11 @@ out: int glusterd_handle_cli_delete_volume (rpcsvc_request_t *req) { - int32_t ret = -1; - gf_cli_req cli_req = {{0,}}; - glusterd_op_delete_volume_ctx_t *ctx = NULL; - glusterd_op_t cli_op = GD_OP_DELETE_VOLUME; - char *volname = NULL; - dict_t *dict = NULL; + int32_t ret = -1; + gf_cli_req cli_req = {{0,},}; + glusterd_op_t cli_op = GD_OP_DELETE_VOLUME; + dict_t *dict = NULL; + char *volname = NULL; GF_ASSERT (req); @@ -402,14 +401,7 @@ glusterd_handle_cli_delete_volume (rpcsvc_request_t *req) gf_log ("glusterd", GF_LOG_INFO, "Received delete vol req" "for volume %s", volname); - - ctx = GF_CALLOC (1, sizeof (*ctx), gf_gld_mt_delete_volume_ctx_t); - if (!ctx) - goto out; - - strncpy (ctx->volume_name, volname, GD_VOLUME_NAME_MAX); - - ret = glusterd_op_begin (req, GD_OP_DELETE_VOLUME, ctx); + ret = glusterd_op_begin (req, GD_OP_DELETE_VOLUME, dict); gf_cmd_log ("Volume delete", "on volname: %s %s", volname, ((ret) ? "FAILED" : "SUCCESS")); @@ -423,9 +415,6 @@ out: glusterd_op_sm (); if (ret) { - if (ctx) - GF_FREE (ctx); - ret = glusterd_op_send_cli_response (cli_op, ret, 0, req, NULL, "operation failed"); } |