summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-08-22 14:08:43 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-22 22:27:40 -0700
commit63f9e2a49573a0b539c0082fd0c08c1b4d4db983 (patch)
treed697fb49e1a713bf1d83f4d8275857b0f0f1faa4 /xlators/cluster/afr/src/afr-common.c
parent37ec7db018979d04d02ae5670b53dbed7a498ba8 (diff)
cluster/afr: Use 2 phase locking for transactions and self heal.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 960 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 103a683fa..865b2a8a1 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -60,17 +60,6 @@
#define AFR_ICTX_SPLIT_BRAIN_MASK 0x0000000100000000ULL
#define AFR_ICTX_READ_CHILD_MASK 0x00000000FFFFFFFFULL
-void
-afr_set_lk_owner (call_frame_t *frame, xlator_t *this)
-{
- if (!frame->root->lk_owner) {
- gf_log (this->name, GF_LOG_TRACE,
- "Setting lk-owner=%llu",
- (unsigned long long) frame->root);
- frame->root->lk_owner = (uint64_t) frame->root;
- }
-}
-
uint64_t
afr_is_split_brain (xlator_t *this, inode_t *inode)
{
@@ -318,7 +307,19 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
GF_FREE (local->pending);
- GF_FREE (local->transaction.locked_nodes);
+ if (local->internal_lock.locked_nodes)
+ GF_FREE (local->internal_lock.locked_nodes);
+
+ if (local->internal_lock.inode_locked_nodes)
+ GF_FREE (local->internal_lock.inode_locked_nodes);
+
+ if (local->internal_lock.entry_locked_nodes)
+ GF_FREE (local->internal_lock.entry_locked_nodes);
+
+ if (local->internal_lock.lower_locked_nodes)
+ GF_FREE (local->internal_lock.lower_locked_nodes);
+
+
GF_FREE (local->transaction.child_errno);
GF_FREE (local->child_errno);
@@ -451,20 +452,6 @@ afr_up_children_count (int child_count, unsigned char *child_up)
}
-int
-afr_locked_nodes_count (unsigned char *locked_nodes, int child_count)
-{
- int ret = 0;
- int i;
-
- for (i = 0; i < child_count; i++)
- if (locked_nodes[i])
- ret++;
-
- return ret;
-}
-
-
ino64_t
afr_itransform (ino64_t ino, int child_count, int child_index)
{