summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rebalance.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-06-13 16:22:44 +0300
committerAtin Mukherjee <amukherj@redhat.com>2019-06-25 06:44:12 +0000
commitfa804f13f3c1a2e8701327a3746b979f04ce09dd (patch)
tree6a9b130b0c8eb064cfc1fa37acb1f909e2047a48 /xlators/mgmt/glusterd/src/glusterd-rebalance.c
parent283b77805cca3027e333a11c9b00ac611662c9ee (diff)
glusterd.h: remove unneeded macros or move them to their users.
Some macros were not used, so removed. Some macros were quite local, so moved to the respective users. Some macros simplified (removed an allocation here and there) Change-Id: Ifaf1aff15a78f105b1549ab8053378933b35df43 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 74105a6..ca40885 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -34,6 +34,31 @@
#include "cli1-xdr.h"
#include "xdr-generic.h"
+#define GLUSTERD_GET_DEFRAG_SOCK_FILE_OLD(path, volinfo, priv) \
+ do { \
+ char defrag_path[PATH_MAX]; \
+ int32_t _sockfile_old_len; \
+ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \
+ _sockfile_old_len = snprintf(path, PATH_MAX, "%s/%s.sock", \
+ defrag_path, uuid_utoa(MY_UUID)); \
+ if ((_sockfile_old_len < 0) || (_sockfile_old_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
+#define GLUSTERD_GET_DEFRAG_SOCK_FILE(path, volinfo) \
+ do { \
+ int32_t _defrag_sockfile_len; \
+ _defrag_sockfile_len = snprintf( \
+ path, UNIX_PATH_MAX, \
+ DEFAULT_VAR_RUN_DIRECTORY "/gluster-%s-%s.sock", "rebalance", \
+ uuid_utoa(volinfo->volume_id)); \
+ if ((_defrag_sockfile_len < 0) || \
+ (_defrag_sockfile_len >= PATH_MAX)) { \
+ path[0] = 0; \
+ } \
+ } while (0)
+
int32_t
glusterd_brick_op_cbk(struct rpc_req *req, struct iovec *iov, int count,
void *myframe);