summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-syncop.h
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-05-20 14:33:41 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-06-01 02:23:26 -0700
commit823da7104b4725469a597920d0171a21ff9ff707 (patch)
treef7e7c7136b5bcb4c7560b3f9f36d4528904fa1fd /xlators/mgmt/glusterd/src/glusterd-syncop.h
parent99ab3637b2b457c866a46a7d109b09e2d4a23e5d (diff)
glusterd : allocate peerid to store in frame->cookie
Backport of http://review.gluster.org/10842 commit a1de3b05 was using peerid from the stack and storing it in the frame->cookie and in the subsequent callback it was referred. The existance of this variable is not guranteed in the cbk since its not dynamically allocated. Fix is to dynmacially manage peerid in the frame cookie. This patch also fixes one problem in gd_sync_task_begin () where unlock is not triggered if the cluster is running with lesser than 3.6 op-version resulting into commands failing with another transaction is in progress. Change-Id: I0d22cf663df53ef3769585703944577461061312 BUG: 1223215 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/10842 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> (cherry picked from commit 37f365843bed87728048da1f56de22290f5cb70f) Reviewed-on: http://review.gluster.org/10959 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h
index 87a3c76f9fb..c8303a04d5e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.h
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h
@@ -36,6 +36,16 @@
synclock_lock (&conf->big_lock); \
} while (0)
+#define GD_ALLOC_COPY_UUID(dst_ptr, uuid, ret) do { \
+ dst_ptr = GF_CALLOC (1, sizeof (*dst_ptr), gf_common_mt_uuid_t); \
+ if (dst_ptr) { \
+ gf_uuid_copy (*dst_ptr, uuid); \
+ ret = 0; \
+ } else { \
+ ret = -1; \
+ } \
+} while (0)
+
int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req, void *local,
void *cookie, rpc_clnt_prog_t *prog, int procnum,
fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);