summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-12-05 11:16:07 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2014-12-09 22:14:13 -0800
commit1f67254c4d6e6b44a8deee47b66e57d92adeffde (patch)
treeed25b2951d72f3054e1d5246defcaaf0ff66a176 /xlators
parent471292ed2ef8fb50428125304b78e7348a822ccc (diff)
cluster/afr: Eliminate locking in sh domain in metadata self-heal
Backport of: http://review.gluster.org/9240 Change-Id: I2ab2ad9a02d88c299cfb32e0cf6baa44d1c2ee12 BUG: 1171077 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/9246 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index dced4d07df6..68dc568bc65 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -244,9 +244,8 @@ __afr_selfheal_metadata_prepare (call_frame_t *frame, xlator_t *this, inode_t *i
return source;
}
-static int
-__afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode,
- unsigned char *locked_on)
+int
+afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode)
{
afr_private_t *priv = NULL;
int ret = -1;
@@ -309,35 +308,3 @@ unlock:
afr_replies_wipe (locked_replies, priv->child_count);
return ret;
}
-
-
-int
-afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode)
-{
- afr_private_t *priv = NULL;
- unsigned char *locked_on = NULL;
- int ret = 0;
-
- priv = this->private;
-
- locked_on = alloca0 (priv->child_count);
-
- ret = afr_selfheal_tryinodelk (frame, this, inode, priv->sh_domain, 0, 0,
- locked_on);
- {
- if (ret < AFR_SH_MIN_PARTICIPANTS) {
- /* Either less than two subvols available, or another
- selfheal (from another server) is in progress. Skip
- for now in any case there isn't anything to do.
- */
- ret = -ENOTCONN;
- goto unlock;
- }
-
- ret = __afr_selfheal_metadata (frame, this, inode, locked_on);
- }
-unlock:
- afr_selfheal_uninodelk (frame, this, inode, priv->sh_domain, 0, 0, locked_on);
-
- return ret;
-}