summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-09-02 04:03:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-02 03:28:39 -0700
commitea86a09143c5c59349ca82ddcbc2178a84cccde7 (patch)
tree7352001356f468407036e35f991a1d9ca2b4ee67 /cli/src/cli-cmd-volume.c
parent232d32ca93bf974734bc4bc4802f1430bb4b0c95 (diff)
cli: Changes for GET_NEXT volume info
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1255 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1255
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 3bbccc900cf..399d146d108 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;
}