summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-04-15 17:35:07 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-07 23:54:33 -0700
commitffbe47e0ec8411313b666a8705f31a67d3862763 (patch)
treea161fdbec2678aea5329fae1dcb932cefe4d8395 /cli/src/cli-rpc-ops.c
parent753a603ce3259f3c6667a48ff4001512941f9128 (diff)
quota: support for inode quota in quota.conf
Currently when quota limit is set, corresponding gfid is set in quota.conf. This patch supports storing inode-quota limits in quota.conf and also stores additional byte for each gfid to differentiate between usage quota limit and inode quota limit. Change-Id: I444d7399407594edd280e640681679a784d4c46a BUG: 1218170 Signed-off-by: vmallika <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/10069 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/10524
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 3c32e6d8a09..080c225e64d 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -2587,7 +2587,7 @@ print_quota_list_object_output (cli_local_t *local, char *path, int64_t avail,
goto out;
}
- cli_out ("%-40s %9"PRIu64" %9s %15"PRIu64" %10"PRIu64" %7"PRIu64
+ cli_out ("%-40s %9"PRIu64" %9s %10"PRIu64" %10"PRIu64" %11"PRIu64
" %15s %20s", path, limits->hl, sl_str,
used_space->file_count, used_space->dir_count,
avail, sl ? "Yes" : "No", hl ? "Yes" : "No");
@@ -2759,12 +2759,20 @@ gf_cli_print_limit_list_from_dict (cli_local_t *local, char *volname,
if (!dict|| count <= 0)
goto out;
+ ret = dict_get_int32 (dict, "type", &type);
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR, "Failed to get quota type");
+ goto out;
+ }
+
/* Need to check if any quota limits are set on the volume before trying
* to list them
*/
- if (!_limits_set_on_volume (volname)) {
- snprintf (err_str, sizeof (err_str), "No quota configured on "
- "volume %s", volname);
+ if (!_limits_set_on_volume (volname, type)) {
+ snprintf (err_str, sizeof (err_str), "No%s quota configured on "
+ "volume %s",
+ (type == GF_QUOTA_OPTION_TYPE_LIST) ? "" : " inode",
+ volname);
if (global_state->mode & GLUSTER_MODE_XML) {
xml_err_flag = _gf_true;
} else {
@@ -2780,12 +2788,6 @@ gf_cli_print_limit_list_from_dict (cli_local_t *local, char *volname,
goto out;
}
- ret = dict_get_int32 (dict, "type", &type);
- if (ret) {
- gf_log ("cli", GF_LOG_ERROR, "Failed to get quota type");
- goto out;
- }
-
if (global_state->mode & GLUSTER_MODE_XML) {
ret = cli_xml_output_vol_quota_limit_list_begin
(local, op_ret, op_errno, op_errstr);