summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-06-14 23:54:27 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 22:00:57 -0700
commit8dac046fb727995aca517cceadcc5c59efc8c3f2 (patch)
tree7c419aeea8a52dd0fe11fe5672dfeb61d3d32721 /xlators
parenta87555181d47522e985325c67b7d17c49dbd38de (diff)
features/marker-quota: performance optimization.
- abort updation process if delta is zero. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2697 (Quota: add-brick creates the size go awkward, though it was perfect earlier) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2697
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/src/marker-quota.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index 0a82cb5fe2a..355ea1d10fe 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -945,7 +945,8 @@ quota_inodelk_cbk (call_frame_t *frame, void *cookie,
gf_log (this->name, GF_LOG_DEBUG,
"inodelk released on %s", local->parent_loc.path);
- if (strcmp (local->parent_loc.path, "/") == 0) {
+ if ((strcmp (local->parent_loc.path, "/") == 0)
+ || (local->delta == 0)) {
xattr_updation_done (frame, NULL, this, 0, 0, NULL);
} else {
ret = get_parent_inode_local (this, local);
@@ -1219,14 +1220,20 @@ unlock:
gf_log (this->name, GF_LOG_DEBUG, "%s %"PRId64 "%"PRId64,
local->loc.path, ctx->size, contribution->contribution);
+
+ local->delta = ctx->size - contribution->contribution;
+
+ if (local->delta == 0) {
+ quota_mark_undirty (frame, NULL, this, 0, 0, NULL);
+ return 0;
+ }
+
newdict = dict_new ();
if (newdict == NULL) {
ret = -1;
goto err;
}
- local->delta = ctx->size - contribution->contribution;
-
QUOTA_ALLOC_OR_GOTO (delta, int64_t, ret, err);
*delta = hton64 (local->delta);