From 1f67254c4d6e6b44a8deee47b66e57d92adeffde Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 5 Dec 2014 11:16:07 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/9246 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Raghavendra Bhat Tested-by: Raghavendra Bhat --- xlators/cluster/afr/src/afr-self-heal-metadata.c | 37 ++---------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'xlators') 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; -} -- cgit