From 0628c77f9069e93c49993722ac577becfcf902db Mon Sep 17 00:00:00 2001 From: Dan Lambright Date: Fri, 21 Aug 2015 06:45:46 -0400 Subject: cluster/tier: add gluster v tier This is a backport of 11984. > Currently the tier feature piggy backs off the rebalance command > syntax to obtain status and this is clumsy. Introduce a new > tier command that can do tier specific operations, starting > with volume status to display counters. > Old commands: > gluster volume attach-tier [replica count] {bricklist..} > gluster volume detach-tier {start|stop|commit} > New commands: > gluster volume tier attach [replica count] {bricklist} | > detach {start|stop|commit} | > status > Change-Id: Ic07b3c6260588162de7d34380f8cbd3d8a7f35d3 > BUG: 1255693 > Signed-off-by: Dan Lambright > Reviewed-on: http://review.gluster.org/11984 > Reviewed-by: Gaurav Kumar Garg > Tested-by: Gluster Build System Signed-off-by: Dan Lambright Change-Id: Id45bd0fa6b8606dd47863de83a694908da393229 BUG: 1261664 Signed-off-by: Dan Lambright Reviewed-on: http://review.gluster.org/12143 Tested-by: Gluster Build System Reviewed-by: Gaurav Kumar Garg --- cli/src/cli-rpc-ops.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-rpc-ops.c') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 9d5d6976543..4991d3a92ba 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -4355,6 +4355,39 @@ out: return ret; } +int32_t +gf_cli_tier (call_frame_t *frame, xlator_t *this, + void *data) +{ + int ret = 0; + int32_t command = 0; + int32_t cmd = 0; + gf_cli_req req = { {0,} }; + gf_cli_req status_req = { {0,} }; + dict_t *dict = NULL; + char *volname = NULL; + + if (!frame || !this || !data) { + ret = -1; + goto out; + } + dict = data; + + ret = cli_to_glusterd (&req, frame, gf_cli_defrag_volume_cbk, + (xdrproc_t) xdr_gf_cli_req, dict, + GLUSTER_CLI_DEFRAG_VOLUME, this, cli_rpc_prog, + NULL); + +out: + gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret); + + GF_FREE (req.dict.dict_val); + + GF_FREE (status_req.dict.dict_val); + + return ret; +} + int32_t gf_cli_detach_tier (call_frame_t *frame, xlator_t *this, void *data) @@ -10731,7 +10764,8 @@ struct rpc_clnt_procedure gluster_cli_actors[GLUSTER_CLI_MAXVALUE] = { [GLUSTER_CLI_GET_VOL_OPT] = {"GET_VOL_OPT", gf_cli_get_vol_opt}, [GLUSTER_CLI_BITROT] = {"BITROT", gf_cli_bitrot}, [GLUSTER_CLI_ATTACH_TIER] = {"ATTACH_TIER", gf_cli_attach_tier}, - [GLUSTER_CLI_DETACH_TIER] = {"DETACH_TIER", gf_cli_detach_tier} + [GLUSTER_CLI_DETACH_TIER] = {"DETACH_TIER", gf_cli_detach_tier}, + [GLUSTER_CLI_TIER] = {"TIER", gf_cli_tier} }; struct rpc_clnt_program cli_prog = { -- cgit