summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quota.h
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2014-03-23 13:28:36 +0530
committerRaghavendra G <rgowdapp@redhat.com>2014-05-22 08:50:42 -0700
commite9a1a7135b9927fbdefd2921b38e10bdbb694b97 (patch)
treed3451296539a27a72a977a046f50e4f422c586f7 /xlators/features/quota/src/quota.h
parent15f698833de54793880505a1f8e549b956eca137 (diff)
features/quota: Send the immediate parent with limit in quota statfs adjustment
Problem: Assume the directory structure /quota_limit_dir/subdir and quota_limit_dir is set with some limit. When quota-deem-statfs is enabled the output of 'df /quota_limit_dir' would display quota modified values wrt to quota_limit_dir where as 'df /quota_limit_subdir/subdir' would display the quota modified values wrt volume root (/). This behaviour is not expected since, when mounted with subdirectory admin doesn't want users to know information above the subdirectory mounted. Solution: Any subdirectory within a quota_limit_dir would show the modified values as in the /quota_limit_dir. It searches for the nearest parent that has quota limit set and modifies the statvfs wrt that. Change-Id: Ie10fae8999bddbb766b1dbeb881723ed80dce688 BUG: 1080296 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7330 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/quota/src/quota.h')
-rw-r--r--xlators/features/quota/src/quota.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h
index 84c3257feec..5a4bcb2b1e0 100644
--- a/xlators/features/quota/src/quota.h
+++ b/xlators/features/quota/src/quota.h
@@ -80,6 +80,23 @@
} \
} while (0);
+#define QUOTA_STACK_WIND_TAIL(frame, params...) \
+ do { \
+ quota_local_t *_local = NULL; \
+ xlator_t *_this = NULL; \
+ \
+ if (frame) { \
+ _local = frame->local; \
+ _this = frame->this; \
+ frame->local = NULL; \
+ } \
+ \
+ STACK_WIND_TAIL (frame, params); \
+ \
+ if (_local) \
+ quota_local_cleanup (_this, _local); \
+ } while (0)
+
#define QUOTA_STACK_UNWIND(fop, frame, params...) \
do { \
quota_local_t *_local = NULL; \
@@ -186,6 +203,7 @@ struct quota_local {
int64_t space_available;
quota_ancestry_built_t ancestry_cbk;
void *ancestry_data;
+ dict_t *xdata;
};
typedef struct quota_local quota_local_t;