diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-03-24 11:27:52 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-05-28 02:06:43 -0700 |
commit | c395ef6539f877cde96d13b66613a1746e628cf7 (patch) | |
tree | ecaae65063896dfc0fcc252579635fe9973ec735 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | d0f62e8b4fc605c522f7971a82cbbf027e06960e (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-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 5541852f044..d3d4a91909b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -518,6 +518,7 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx, char *err_str, size_t err_len) { int32_t ret = -1; + int npeers = 0; dict_t *dict = NULL; xlator_t *this = NULL; glusterd_conf_t *priv = NULL; @@ -605,6 +606,21 @@ glusterd_op_txn_begin (rpcsvc_request_t *req, glusterd_op_t op, void *ctx, gf_log (this->name, GF_LOG_DEBUG, "Acquired lock on localhost"); local_locking_done: + txn_op_info.local_xaction_peers = + GF_CALLOC (1, sizeof (struct list_head), + gf_common_mt_list_head_t); + if (!txn_op_info.local_xaction_peers) { + ret = -1; + gf_log (this->name, GF_LOG_ERROR, "Out of memory"); + goto out; + } + INIT_LIST_HEAD (txn_op_info.local_xaction_peers); + + /* Maintain xaction_peers on per transaction basis */ + npeers = gd_build_local_xaction_peers_list + (&priv->peers, + txn_op_info.local_xaction_peers, + op); /* If no volname is given as a part of the command, locks will * not be held, hence sending stage event. */ |