summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-03-24 11:27:52 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-05-28 02:06:43 -0700
commitc395ef6539f877cde96d13b66613a1746e628cf7 (patch)
treeecaae65063896dfc0fcc252579635fe9973ec735 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentd0f62e8b4fc605c522f7971a82cbbf027e06960e (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. Backport of http://review.gluster.org/#/c/9972/ Change-Id: Idd8484463fed196b3b18c2df7f550a3302c6e138 BUG: 1206429 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> Reviewed-on: http://review.gluster.org/10023 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 7ac6cf37134..54daa1addeb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -13798,3 +13798,22 @@ out:
GF_FREE (dup_val);
return exists;
}
+
+void
+gd_cleanup_local_xaction_peers_list (struct list_head *xact_peers)
+{
+ glusterd_local_peers_t *local_peers = NULL;
+ glusterd_local_peers_t *tmp = NULL;
+
+ GF_ASSERT (xact_peers);
+
+ if (list_empty (xact_peers))
+ return;
+
+ list_for_each_entry_safe (local_peers, tmp, xact_peers,
+ op_peers_list) {
+ GF_FREE (local_peers);
+ /* local_peers->peerinfo need not be freed because it does not
+ * ownership of peerinfo, but merely refer it */
+ }
+}