summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2011-03-15 05:36:18 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-16 00:04:50 -0700
commitc5d93456dcd17ddeb189c3e1390e58f95e30b851 (patch)
treed958423709ab10af2a7ff98591a5164dea106e4a /cli/src/cli-cmd-volume.c
parent8221c3cae1ce5c2f7d897e5637591c5437aeea69 (diff)
cli: QUOTA cli related changes.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index f53db3d8..f7f33300 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 <VOLNAME> <enable|disable|limit-usage|list|remove> [args] [path]",
+ cli_cmd_quota_cbk,
+ "quota translator specific operations"},
+
{ NULL, NULL, NULL }
};