diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2014-03-04 14:42:40 +0000 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2014-03-04 14:42:40 +0000 |
commit | 0de07f4189cbd191a765c60ed3d7c72f72112e68 (patch) | |
tree | 83781a0df06c9110c6f3db12caad23ea00832b53 /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | |
parent | c28972ea53cc7cdb91c7aac01754dd7f0b66e1a7 (diff) | |
parent | 9f45d0f6212d6d5c96dafc4aba73d9d12b39c3d6 (diff) |
Merge branch 'upstream' into merge
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Conflicts:
api/src/glfs-fops.c
libglusterfs/src/syncop.c
libglusterfs/src/syncop.h
Change-Id: I8c3fa7a20fb167d9e6bc2749e177c0c8b366827b
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index 9af26cfab..18f37c190 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -575,12 +575,17 @@ __glusterd_cluster_lock_cbk (struct rpc_req *req, struct iovec *iov, glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; xlator_t *this = NULL; - uuid_t *txn_id = &global_txn_id; + uuid_t *txn_id = NULL; + glusterd_conf_t *priv = NULL; this = THIS; GF_ASSERT (this); + priv = this->private; + GF_ASSERT (priv); GF_ASSERT (req); + txn_id = &priv->global_txn_id; + if (-1 == req->rpc_status) { rsp.op_ret = -1; rsp.op_errno = EINVAL; @@ -811,12 +816,17 @@ __glusterd_cluster_unlock_cbk (struct rpc_req *req, struct iovec *iov, glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE; glusterd_peerinfo_t *peerinfo = NULL; xlator_t *this = NULL; - uuid_t *txn_id = &global_txn_id; + uuid_t *txn_id = NULL; + glusterd_conf_t *priv = NULL; this = THIS; GF_ASSERT (this); + priv = this->private; + GF_ASSERT (priv); GF_ASSERT (req); + txn_id = &priv->global_txn_id; + if (-1 == req->rpc_status) { rsp.op_ret = -1; rsp.op_errno = EINVAL; @@ -1403,6 +1413,7 @@ glusterd_vol_lock (call_frame_t *frame, xlator_t *this, glusterd_conf_t *priv = NULL; call_frame_t *dummy_frame = NULL; dict_t *dict = NULL; + uuid_t *txn_id = NULL; if (!this) goto out; @@ -1429,9 +1440,23 @@ glusterd_vol_lock (call_frame_t *frame, xlator_t *this, goto out; } + ret = dict_get_bin (dict, "transaction_id", + (void **)&txn_id); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to get transaction id."); + goto out; + } else { + gf_log (this->name, GF_LOG_DEBUG, + "Transaction_id = %s", uuid_utoa (*txn_id)); + uuid_copy (req.txn_id, *txn_id); + } + dummy_frame = create_frame (this, this->ctx->pool); - if (!dummy_frame) + if (!dummy_frame) { + ret = -1; goto out; + } ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt_v3, @@ -1453,6 +1478,7 @@ glusterd_vol_unlock (call_frame_t *frame, xlator_t *this, glusterd_conf_t *priv = NULL; call_frame_t *dummy_frame = NULL; dict_t *dict = NULL; + uuid_t *txn_id = NULL; if (!this) goto out; @@ -1479,9 +1505,23 @@ glusterd_vol_unlock (call_frame_t *frame, xlator_t *this, goto out; } + ret = dict_get_bin (dict, "transaction_id", + (void **)&txn_id); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to get transaction id."); + goto out; + } else { + gf_log (this->name, GF_LOG_DEBUG, + "Transaction_id = %s", uuid_utoa (*txn_id)); + uuid_copy (req.txn_id, *txn_id); + } + dummy_frame = create_frame (this, this->ctx->pool); - if (!dummy_frame) + if (!dummy_frame) { + ret = -1; goto out; + } ret = glusterd_submit_request (peerinfo->rpc, &req, dummy_frame, peerinfo->mgmt_v3, @@ -1657,12 +1697,16 @@ __glusterd_brick_op_cbk (struct rpc_req *req, struct iovec *iov, glusterd_req_ctx_t *req_ctx = NULL; glusterd_pending_node_t *node = NULL; xlator_t *this = NULL; - uuid_t *txn_id = &global_txn_id; + uuid_t *txn_id = NULL; + glusterd_conf_t *priv = NULL; this = THIS; GF_ASSERT (this); - + priv = this->private; + GF_ASSERT (priv); GF_ASSERT (req); + + txn_id = &priv->global_txn_id; frame = myframe; req_ctx = frame->local; @@ -1760,7 +1804,7 @@ glusterd_brick_op_cbk (struct rpc_req *req, struct iovec *iov, int32_t glusterd_brick_op (call_frame_t *frame, xlator_t *this, - void *data) + void *data) { gd1_mgmt_brick_op_req *req = NULL; @@ -1773,7 +1817,7 @@ glusterd_brick_op (call_frame_t *frame, xlator_t *this, glusterd_req_ctx_t *req_ctx = NULL; struct rpc_clnt *rpc = NULL; dict_t *op_ctx = NULL; - uuid_t *txn_id = &global_txn_id; + uuid_t *txn_id = NULL; if (!this) { ret = -1; @@ -1782,6 +1826,8 @@ glusterd_brick_op (call_frame_t *frame, xlator_t *this, priv = this->private; GF_ASSERT (priv); + txn_id = &priv->global_txn_id; + req_ctx = data; GF_ASSERT (req_ctx); INIT_LIST_HEAD (&opinfo.pending_bricks); |