From ea86a09143c5c59349ca82ddcbc2178a84cccde7 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 2 Sep 2010 04:03:12 +0000 Subject: cli: Changes for GET_NEXT volume info Signed-off-by: Vijay Bellur Signed-off-by: Vijay Bellur BUG: 1255 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1255 --- cli/src/cli-cmd-volume.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 3bbccc900..399d146d1 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -69,9 +69,11 @@ int cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { - int ret = -1; - rpc_clnt_procedure_t *proc = NULL; - call_frame_t *frame = NULL; + int ret = -1; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + cli_cmd_volume_get_ctx_t ctx = {0,}; + cli_local_t *local = NULL; proc = &cli_rpc_prog->proctable[GF1_CLI_GET_VOLUME]; @@ -79,8 +81,23 @@ cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word, if (!frame) goto out; + if ((wordcount == 2) || (wordcount == 3 && + !strcmp (words[2], "all"))) { + ctx.flags = GF_CLI_GET_NEXT_VOLUME; + proc = &cli_rpc_prog->proctable[GF1_CLI_GET_NEXT_VOLUME]; + } + + local = cli_local_get (); + + if (!local) + goto out; + + local->u.get_vol.flags = ctx.flags; + + frame->local = local; + if (proc->fn) { - ret = proc->fn (frame, THIS, NULL); + ret = proc->fn (frame, THIS, &ctx); } out: @@ -131,7 +148,7 @@ out: } } if (options) - dict_destroy (options); + dict_unref (options); return ret; } -- cgit