summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.h
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-05-15 16:03:00 +0530
committerKaushal M <kaushal@redhat.com>2015-05-28 07:03:19 -0700
commitffc15b7ef0631b571be00cdb7d091cac84e314f5 (patch)
tree4cd8bd859525120a811443f3b125bd5de4914911 /xlators/mgmt/glusterd/src/glusterd.h
parent05566baee6b5f0b2a3b083def4fe9bbdd0f63551 (diff)
tiering/rebalance: Use separate pid/socket file for tiering
When promotion/demotion daemon starts, it uses the same pidfile as rebalance. This patch will introduce a different pid file for the same. Change-Id: Ic484c53f51e00ae6b2d697748a9600b14829e23b BUG: 1221970 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/10792 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 384b6f4186e..bca76970c3a 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -597,10 +597,19 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
STACK_DESTROY (frame->root); \
} while (0)
+#define GLUSTERD_GET_DEFRAG_PROCESS(path, volinfo) do { \
+ if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) \
+ snprintf (path, PATH_MAX, "tier"); \
+ else \
+ snprintf (path, PATH_MAX, "rebalance"); \
+ } while (0)
+
#define GLUSTERD_GET_DEFRAG_DIR(path, volinfo, priv) do { \
char vol_path[PATH_MAX]; \
+ char operation[NAME_MAX]; \
GLUSTERD_GET_VOLUME_DIR(vol_path, volinfo, priv); \
- snprintf (path, PATH_MAX, "%s/rebalance",vol_path); \
+ GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
+ snprintf (path, PATH_MAX, "%s/%s", vol_path, operation);\
} while (0)
#define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) do { \
@@ -611,8 +620,10 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
} while (0)
#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) do { \
+ char operation[NAME_MAX]; \
+ GLUSTERD_GET_DEFRAG_PROCESS(operation, volinfo); \
snprintf (path, UNIX_PATH_MAX, DEFAULT_VAR_RUN_DIRECTORY \
- "/gluster-rebalance-%s.sock", \
+ "/gluster-%s-%s.sock", operation, \
uuid_utoa(volinfo->volume_id)); \
} while (0)