From 087ad8a001c77ec9703a0a74256819cf99cc31d4 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 24 Mar 2015 11:27:52 +0530 Subject: glusterd: Maintain local xaction_peer list for op-sm http://review.gluster.org/9269 addresses maintaining local xaction_peers in syncop and mgmt_v3 framework. This patch is to maintain local xaction_peers list for op-sm framework as well. Change-Id: Idd8484463fed196b3b18c2df7f550a3302c6e138 BUG: 1204727 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/9972 Reviewed-by: Anand Nekkunti Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c5fcb7698e5..8407c57c4cd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -313,6 +313,9 @@ glusterd_clear_txn_opinfo (uuid_t *txn_id) dict_del(priv->glusterd_txn_opinfo, uuid_utoa (*txn_id)); + if (txn_op_info.local_xaction_peers) + GF_FREE (txn_op_info.local_xaction_peers); + gf_log ("", GF_LOG_DEBUG, "Successfully cleared opinfo for transaction ID : %s", uuid_utoa (*txn_id)); @@ -2915,8 +2918,8 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx) priv = this->private; GF_ASSERT (priv); - cds_list_for_each_entry (peerinfo, &priv->xaction_peers, - op_peers_list) { + list_for_each_local_xaction_peers (peerinfo, + opinfo.local_xaction_peers) { GF_ASSERT (peerinfo); if (!peerinfo->connected || !peerinfo->mgmt) @@ -3005,8 +3008,8 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx) priv = this->private; GF_ASSERT (priv); - cds_list_for_each_entry (peerinfo, &priv->xaction_peers, - op_peers_list) { + list_for_each_local_xaction_peers (peerinfo, + opinfo.local_xaction_peers) { GF_ASSERT (peerinfo); if (!peerinfo->connected || !peerinfo->mgmt || @@ -3558,8 +3561,8 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) if (op == GD_OP_REPLACE_BRICK) glusterd_rb_use_rsp_dict (NULL, rsp_dict); - cds_list_for_each_entry (peerinfo, &priv->xaction_peers, - op_peers_list) { + list_for_each_local_xaction_peers (peerinfo, + opinfo.local_xaction_peers) { GF_ASSERT (peerinfo); if (!peerinfo->connected || !peerinfo->mgmt) @@ -4208,9 +4211,8 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx) goto out; } - - cds_list_for_each_entry (peerinfo, &priv->xaction_peers, - op_peers_list) { + list_for_each_local_xaction_peers (peerinfo, + opinfo.local_xaction_peers) { GF_ASSERT (peerinfo); if (!peerinfo->connected || !peerinfo->mgmt) @@ -4525,7 +4527,7 @@ glusterd_op_txn_complete (uuid_t *txn_id) glusterd_op_clear_op (); glusterd_op_reset_ctx (); glusterd_op_clear_errstr (); - glusterd_op_clear_xaction_peers (); + gd_cleanup_local_xaction_peers_list (opinfo.local_xaction_peers); /* Based on the op-version, we release the cluster or mgmt_v3 lock */ if (priv->op_version < GD_OP_VERSION_3_6_0) { -- cgit