From fa804f13f3c1a2e8701327a3746b979f04ce09dd Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 13 Jun 2019 16:22:44 +0300 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-rebalance.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-rebalance.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index 74105a60df5..ca408856c23 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); -- cgit