summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-04-12 12:03:06 +0000
committerAnand Avati <avati@gluster.com>2011-04-13 00:38:51 -0700
commit4b6a08fba53d895c84676d8c3ae6a5ef45fa2286 (patch)
tree2f5703880578219a5e9f32a1f36fe03dc7a0b6b1 /xlators/features
parentba365f725a91bcd3dcfae1d8311f9f148ce69055 (diff)
features/marker: Call update txn when the directory size and its contribution are not same.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand Avati <avati@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 'xlators/features')
-rw-r--r--xlators/features/marker/src/marker-quota.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index e2cb6ba67be..87eae1dbfe9 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -1475,6 +1475,7 @@ inspect_directory_xattr (xlator_t *this,
int64_t *contri = NULL;
char contri_key [512] = {0, };
marker_conf_t *priv = NULL;
+ gf_boolean_t not_root = _gf_false;
quota_inode_ctx_t *ctx = NULL;
inode_contribution_t *contribution = NULL;
@@ -1500,6 +1501,8 @@ inspect_directory_xattr (xlator_t *this,
goto out;
if (strcmp (loc->path, "/") != 0) {
+ not_root = _gf_true;
+
contribution = add_new_contribution_node (this, ctx, loc);
if (contribution == NULL) {
gf_log (this->name, GF_LOG_DEBUG,
@@ -1525,8 +1528,12 @@ inspect_directory_xattr (xlator_t *this,
contribution?contribution->contribution:0);
ctx->dirty = dirty;
- if (ctx->dirty == 1)
+ if (ctx->dirty == 1) {
update_dirty_inode (this, loc, ctx, contribution);
+ } else if (not_root == _gf_true &&
+ ctx->size != contribution->contribution) {
+ initiate_quota_txn (this, loc);
+ }
ret = 0;
out: