summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-lk-common.c
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2016-08-25 11:46:25 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-09-01 10:22:39 -0700
commitbefae0b48729894282b5b8b174907e24779c3442 (patch)
tree1f43412cb788a40ddc547e15fe71e16f39fd1442 /xlators/cluster/afr/src/afr-lk-common.c
parent68b23745602e4cc6317d6dce72ed0392d4174972 (diff)
afr: Consume compound fops in afr transaction
Change-Id: Ib06ece3cce1b10d28d6d2953da28444f5c2457ad BUG: 1290304 Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/15014 Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-lk-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-lk-common.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
index 718ba318cfe..233672898f1 100644
--- a/xlators/cluster/afr/src/afr-lk-common.c
+++ b/xlators/cluster/afr/src/afr-lk-common.c
@@ -463,8 +463,8 @@ transaction_lk_op (afr_local_t *local)
}
-static int
-is_afr_lock_transaction (afr_local_t *local)
+int
+afr_is_inodelk_transaction(afr_local_t *local)
{
int ret = 0;
@@ -636,13 +636,25 @@ afr_unlock_common_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
}
+void
+afr_update_uninodelk (afr_local_t *local, afr_internal_lock_t *int_lock,
+ int32_t child_index)
+{
+ afr_inodelk_t *inodelk = NULL;
+
+ inodelk = afr_get_inodelk (int_lock, int_lock->domain);
+ inodelk->locked_nodes[child_index] &= LOCKED_NO;
+ if (local->transaction.eager_lock)
+ local->transaction.eager_lock[child_index] = 0;
+
+}
+
static int32_t
afr_unlock_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata)
{
afr_local_t *local = NULL;
afr_internal_lock_t *int_lock = NULL;
- afr_inodelk_t *inodelk = NULL;
int32_t child_index = (long)cookie;
afr_private_t *priv = NULL;
@@ -665,11 +677,7 @@ afr_unlock_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
lkowner_utoa (&frame->root->lk_owner));
}
-
- inodelk = afr_get_inodelk (int_lock, int_lock->domain);
- inodelk->locked_nodes[child_index] &= LOCKED_NO;
- if (local->transaction.eager_lock)
- local->transaction.eager_lock[child_index] = 0;
+ afr_update_uninodelk (local, int_lock, child_index);
afr_unlock_common_cbk (frame, cookie, this, op_ret, op_errno, xdata);
@@ -1712,7 +1720,7 @@ afr_unlock (call_frame_t *frame, xlator_t *this)
local = frame->local;
if (transaction_lk_op (local)) {
- if (is_afr_lock_transaction (local))
+ if (afr_is_inodelk_transaction(local))
afr_unlock_inodelk (frame, this);
else
afr_unlock_entrylk (frame, this);