summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2016-04-02 08:57:00 +0530
committerVijaikumar Mallikarjuna <vmallika@redhat.com>2016-04-06 05:23:52 -0700
commit4fb5a2af7b9fe926782ea6139349eeb63be86920 (patch)
tree4eee720e79dbd74c943da2de566e2f863178ec26 /libglusterfs
parentb9c37234e0933c836e1bfdb72607b592ea5080c4 (diff)
marker: optimize mq_update_dirty_inode_task
This is a backport of http://review.gluster.org/#/c/13892/ In function mq_update_dirty_inode_task we do readdirp on a dirty directory and for entry we again do lookup to fecth the contribution xattr. We can fetch this contribution as part of readdirp > Change-Id: I766593c0dba793f1ab3b43625acce1c7d9af8d7f > BUG: 1320818 > Signed-off-by: vmallika <vmallika@redhat.com> Change-Id: Id826a09a72529f7435372ea7f04068dd10da5fcb BUG: 1324040 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13908 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/quota-common-utils.c11
-rw-r--r--libglusterfs/src/quota-common-utils.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/quota-common-utils.c b/libglusterfs/src/quota-common-utils.c
index 5e688e5..ad7e4dc 100644
--- a/libglusterfs/src/quota-common-utils.c
+++ b/libglusterfs/src/quota-common-utils.c
@@ -16,6 +16,17 @@
#include "common-utils.h"
#include "libglusterfs-messages.h"
+gf_boolean_t
+quota_meta_is_null (const quota_meta_t *meta)
+{
+ if (meta->size == 0 &&
+ meta->file_count == 0 &&
+ meta->dir_count == 0)
+ return _gf_true;
+
+ return _gf_false;
+}
+
int32_t
quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta)
{
diff --git a/libglusterfs/src/quota-common-utils.h b/libglusterfs/src/quota-common-utils.h
index c930db8..e479398 100644
--- a/libglusterfs/src/quota-common-utils.h
+++ b/libglusterfs/src/quota-common-utils.h
@@ -37,6 +37,9 @@ struct _quota_meta {
} __attribute__ ((__packed__));
typedef struct _quota_meta quota_meta_t;
+gf_boolean_t
+quota_meta_is_null (const quota_meta_t *meta);
+
int32_t
quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta);