From 8dac046fb727995aca517cceadcc5c59efc8c3f2 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 14 Jun 2011 23:54:27 +0000 Subject: features/marker-quota: performance optimization. - abort updation process if delta is zero. Signed-off-by: Raghavendra G Signed-off-by: Anand Avati 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 --- xlators/features/marker/src/marker-quota.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 0a82cb5fe..355ea1d10 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); -- cgit