summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.h
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2016-04-02 09:50:11 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-04-29 03:11:35 -0700
commitc2865e83d414e375443adac0791887c8adf444f2 (patch)
tree705e653a6938ef6270762224a6add1e4c54f30a6 /xlators/mgmt/glusterd/src/glusterd.h
parent72f048ae1ab893e81abff377a46570b5a12b7561 (diff)
quota/glusterd: enhance quota enable and disable process
Previously quota crawl was done from the single mount point, this is very slow process if there are huge number of files exists in the volume This RFE will now spawn crawl process for each brick in the volume, and files are looked in parallel independently for each brick. This improves the speed of crawling process for entire files-system This patch also fixes below problem * Previously, mountdir was created under '/tmp'. If someone tries to cleanup '/tmp'/ directory then it is very dangerous that we loose volume data So create a mount point under /var/run/gluster/tmp instead * Previously, file-system crawl is performed from all the nodes, which is a redundant operation and performance will degrade The problem is fixed with this patch Change-Id: Icabedeb44182139ace9c8106793803122388cab8 BUG: 1290766 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12952 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> Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 587c2e82774..65ab156e41b 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -595,6 +595,11 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
snprintf (abspath, sizeof (abspath)-1, \
DEFAULT_VAR_RUN_DIRECTORY"/%s%s", volname, path);
+#define GLUSTERD_GET_TMP_PATH(abspath, path) do { \
+ snprintf (abspath, sizeof (abspath)-1, \
+ DEFAULT_VAR_RUN_DIRECTORY"/tmp%s", path); \
+ } while (0)
+
#define GLUSTERD_REMOVE_SLASH_FROM_PATH(path,string) do { \
int i = 0; \
for (i = 1; i < strlen (path); i++) { \
@@ -623,6 +628,18 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
quotadpath); \
}
+#define GLUSTERD_GET_QUOTA_CRAWL_PIDDIR(piddir, volinfo, type) do { \
+ char _volpath[PATH_MAX] = {0,}; \
+ GLUSTERD_GET_VOLUME_DIR (_volpath, volinfo, priv); \
+ if (type == GF_QUOTA_OPTION_TYPE_ENABLE || \
+ type == GF_QUOTA_OPTION_TYPE_ENABLE_OBJECTS) \
+ snprintf (piddir, PATH_MAX, "%s/run/quota/enable", \
+ _volpath); \
+ else \
+ snprintf (piddir, PATH_MAX, "%s/run/quota/disable", \
+ _volpath); \
+ } while (0)
+
#define GLUSTERD_STACK_DESTROY(frame) do {\
frame->local = NULL; \
STACK_DESTROY (frame->root); \