From bccb4b7a63eaa5e32b34c90dfdd5efa5c99b546a Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sat, 13 Oct 2012 12:06:14 +0530 Subject: mgmt/glusterd: avoid directly using conf->uuid Change-Id: I398c8741b02aa2f34d428c948e93f422e520a9ab BUG: 862834 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4084 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-handler.c | 8 ++++---- xlators/mgmt/glusterd/src/glusterd-syncop.c | 12 ++++++------ xlators/mgmt/glusterd/src/glusterd-utils.c | 8 ++++---- xlators/mgmt/glusterd/src/glusterd.h | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index ae4138ebe7a..a3106342d6c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -1777,7 +1777,7 @@ glusterd_handle_probe_query (rpcsvc_request_t *req) } respond: - uuid_copy (rsp.uuid, conf->uuid); + uuid_copy (rsp.uuid, MY_UUID); rsp.hostname = probe_req.hostname; @@ -2341,7 +2341,7 @@ glusterd_xfer_friend_remove_resp (rpcsvc_request_t *req, char *hostname, int por conf = this->private; - uuid_copy (rsp.uuid, conf->uuid); + uuid_copy (rsp.uuid, MY_UUID); rsp.hostname = hostname; rsp.port = port; ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, @@ -2369,7 +2369,7 @@ glusterd_xfer_friend_add_resp (rpcsvc_request_t *req, char *hostname, int port, conf = this->private; - uuid_copy (rsp.uuid, conf->uuid); + uuid_copy (rsp.uuid, MY_UUID); rsp.op_ret = op_ret; rsp.op_errno = op_errno; rsp.hostname = gf_strdup (hostname); @@ -2900,7 +2900,7 @@ glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata, if (peerinfo->connected) { glusterd_get_lock_owner (&owner); - if (!uuid_compare (conf->uuid, owner)) { + if (!uuid_compare (MY_UUID, owner)) { ret = glusterd_op_sm_inject_event (GD_OP_EVENT_START_UNLOCK, NULL); if (ret) diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 7c4ae8903cc..6c7bccf9539 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -497,7 +497,7 @@ gd_sync_task_begin (dict_t *op_ctx, char **op_errstr) goto out; /* Lock everything */ - ret = glusterd_lock (conf->uuid); + ret = glusterd_lock (MY_UUID); if (ret) goto out; /* successful lock in local node */ @@ -505,7 +505,7 @@ gd_sync_task_begin (dict_t *op_ctx, char **op_errstr) list_for_each_entry (peerinfo, &conf->peers, uuid_list) { ret = gd_syncop_mgmt_lock (peerinfo->rpc, - conf->uuid, tmp_uuid); + MY_UUID, tmp_uuid); if (ret) goto out; /* TODO: Only on lock successful nodes it should unlock */ @@ -522,7 +522,7 @@ gd_sync_task_begin (dict_t *op_ctx, char **op_errstr) list_for_each_entry (peerinfo, &conf->peers, uuid_list) { ret = gd_syncop_mgmt_stage_op (peerinfo->rpc, - conf->uuid, tmp_uuid, + MY_UUID, tmp_uuid, op, req_dict, &rsp_dict, op_errstr); if (ret) { @@ -550,7 +550,7 @@ gd_sync_task_begin (dict_t *op_ctx, char **op_errstr) list_for_each_entry (peerinfo, &conf->peers, uuid_list) { ret = gd_syncop_mgmt_commit_op (peerinfo->rpc, - conf->uuid, tmp_uuid, + MY_UUID, tmp_uuid, op, req_dict, &rsp_dict, op_errstr); if (ret) { @@ -577,12 +577,12 @@ out: here, and unlock would fail on nodes where lock never was sent */ gd_syncop_mgmt_unlock (peerinfo->rpc, - conf->uuid, tmp_uuid); + MY_UUID, tmp_uuid); } /* Local node should be the one to be locked first, unlocked last to prevent races */ - glusterd_unlock (conf->uuid); + glusterd_unlock (MY_UUID); } if (req_dict) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 72c9f393d1e..d9f589b20e9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -3490,7 +3490,7 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo, } } - if (uuid_compare (brickinfo->uuid, conf->uuid)) { + if (uuid_compare (brickinfo->uuid, MY_UUID)) { ret = 0; goto out; } @@ -4298,7 +4298,7 @@ glusterd_brick_stop (glusterd_volinfo_t *volinfo, } } - if (uuid_compare (brickinfo->uuid, conf->uuid)) { + if (uuid_compare (brickinfo->uuid, MY_UUID)) { ret = 0; goto out; } @@ -5180,7 +5180,7 @@ glusterd_brick_statedump (glusterd_volinfo_t *volinfo, } } - if (uuid_compare (brickinfo->uuid, conf->uuid)) { + if (uuid_compare (brickinfo->uuid, MY_UUID)) { ret = 0; goto out; } @@ -5527,7 +5527,7 @@ glusterd_is_local_brick (xlator_t *this, glusterd_volinfo_t *volinfo, goto out; } conf = this->private; - local = !uuid_compare (brickinfo->uuid, conf->uuid); + local = !uuid_compare (brickinfo->uuid, MY_UUID); out: return local; } diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 0abe80e25ba..b3fe1400aaa 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -342,14 +342,14 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); char defrag_path[PATH_MAX]; \ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \ snprintf (path, PATH_MAX, "%s/%s.sock", defrag_path, \ - uuid_utoa(priv->uuid)); \ + uuid_utoa(MY_UUID)); \ } while (0) #define GLUSTERD_GET_DEFRAG_PID_FILE(path, volinfo, priv) do { \ char defrag_path[PATH_MAX]; \ GLUSTERD_GET_DEFRAG_DIR(defrag_path, volinfo, priv); \ snprintf (path, PATH_MAX, "%s/%s.pid", defrag_path, \ - uuid_utoa(priv->uuid)); \ + uuid_utoa(MY_UUID)); \ } while (0) -- cgit