diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2014-12-05 11:16:07 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2014-12-05 01:51:14 -0800 |
commit | 5fdffa7164ffc5a798246411d065259b36658bc3 (patch) | |
tree | 80023d2f502d6ba85f5c925414eebb403a9a6972 /xlators/cluster/afr | |
parent | 9a3d848e78425363246345a4cfb6783298e9f1b5 (diff) |
cluster/afr: Eliminate locking in sh domain in metadata self-heal
Change-Id: I9ef25a17c9a43ba06fac2ad3f7c18cb47de91537
BUG: 1170913
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/9240
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 37 |
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; -} |