summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-03-24 11:27:52 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-03-26 00:10:45 -0700
commit087ad8a001c77ec9703a0a74256819cf99cc31d4 (patch)
treeb5feadc3a57573fa15d052150286b5475b7c1597 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parentf64666f113e7f0d3f7061dfed7e6e24928e85161 (diff)
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 <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9972 Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c22
1 files changed, 12 insertions, 10 deletions
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) {