From c5d93456dcd17ddeb189c3e1390e58f95e30b851 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Tue, 15 Mar 2011 05:36:18 +0000 Subject: cli: QUOTA cli related changes. Signed-off-by: Junaid Signed-off-by: Vijay Bellur BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473 --- cli/src/cli-cmd-volume.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (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 f53db3d80..f7f333001 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -701,6 +701,49 @@ out: return ret; } +int +cli_cmd_quota_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + + int ret = 0; + int parse_err = 0; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + dict_t *options = NULL; + + proc = &cli_rpc_prog->proctable[GLUSTER_CLI_QUOTA]; + if (proc == NULL) { + ret = -1; + goto out; + } + + frame = create_frame (THIS, THIS->ctx->pool); + if (!frame) { + ret = -1; + goto out; + } + + ret = cli_cmd_quota_parse (words, wordcount, &options); + if (ret) { + cli_usage_out (word->pattern); + parse_err = 1; + goto out; + } + + if (proc->fn) + ret = proc->fn (frame, THIS, options); + +out: + if (options) + dict_unref (options); + + if (ret && parse_err == 0) + cli_out ("Quota command failed"); + + return ret; + +} int cli_cmd_volume_remove_brick_cbk (struct cli_state *state, @@ -1072,6 +1115,10 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_profile_cbk, "volume profile operations"}, + { "volume quota [args] [path]", + cli_cmd_quota_cbk, + "quota translator specific operations"}, + { NULL, NULL, NULL } }; -- cgit