From 82890b0a753af50eb64271ba633e8da5527eb097 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 17 Jul 2013 18:29:43 +0530 Subject: glusterd, cli: Provide status of quotad in 'volume status' Change-Id: I5e90376ecfe11ae5a3bca936d9d9acdd54c337d7 BUG: 969461 Signed-off-by: Krutika Dhananjay --- cli/src/cli-cmd-parser.c | 13 +++++++++++++ cli/src/cli-cmd-volume.c | 2 +- cli/src/cli-rpc-ops.c | 6 ++++-- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 78f680da..98ed0fdd 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2263,6 +2263,8 @@ cli_cmd_volume_status_parse (const char **words, int wordcount, cmd |= GF_CLI_STATUS_NFS; } else if (!strcmp (words[3], "shd")) { cmd |= GF_CLI_STATUS_SHD; + } else if (!strcmp (words[3], "quotad")) { + cmd |= GF_CLI_STATUS_QUOTAD; } else { cmd = GF_CLI_STATUS_BRICK; ret = dict_set_str (dict, "brick", @@ -2316,6 +2318,17 @@ cli_cmd_volume_status_parse (const char **words, int wordcount, goto out; } cmd |= GF_CLI_STATUS_SHD; + } else if (!strcmp (words[3], "quotad")) { + if (cmd == GF_CLI_STATUS_FD || + cmd == GF_CLI_STATUS_CLIENTS || + cmd == GF_CLI_STATUS_DETAIL || + cmd == GF_CLI_STATUS_INODE) { + cli_err ("Detail/FD/Clients/Inode status not " + "available for Quota Daemon"); + ret = -1; + goto out; + } + cmd |= GF_CLI_STATUS_QUOTAD; } else { cmd |= GF_CLI_STATUS_BRICK; ret = dict_set_str (dict, "brick", (char *)words[3]); diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 6465d577..f10df335 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1908,7 +1908,7 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_top_cbk, "volume top operations"}, - { "volume status [all | [nfs|shd|]]" + { "volume status [all | [nfs|shd||quotad]]" " [detail|clients|mem|inode|fd|callpool]", cli_cmd_volume_status_cbk, "display status of all or specified volume(s)/brick"}, diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 05f2e957..008b74c4 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -5987,7 +5987,8 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - if ((cmd & GF_CLI_STATUS_NFS) || (cmd & GF_CLI_STATUS_SHD)) + if ((cmd & GF_CLI_STATUS_NFS) || (cmd & GF_CLI_STATUS_SHD) || + (cmd & GF_CLI_STATUS_QUOTAD)) notbrick = _gf_true; ret = dict_get_int32 (dict, "count", &count); @@ -6094,7 +6095,8 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov, */ memset (status.brick, 0, PATH_MAX + 255); if (!strcmp (hostname, "NFS Server") || - !strcmp (hostname, "Self-heal Daemon")) + !strcmp (hostname, "Self-heal Daemon") || + !strcmp (hostname, "Quota Daemon")) snprintf (status.brick, PATH_MAX + 255, "%s on %s", hostname, path); else -- cgit