summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorAnuradha <atalur@redhat.com>2014-12-12 12:56:22 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2014-12-23 07:09:23 -0800
commit85427a23c238499137cbfaafdb7b6ad27f67506a (patch)
tree6b8c5c7e802b2080d4b4e7299f1f89034538039d /xlators/cluster/afr/src/afr-self-heal-data.c
parentf3df93783d8c817722e086b14b97fa6bc9d0fce8 (diff)
cluster/afr : Change in volume heal info command
gluster volume heal <volname> info command will now also display if the files listed (in the output of the command) are in split-brain or possibly being healed. This patch also fixes build warning that occurs. Change-Id: I1fc92e62137f23b2b9ddf6e05819cee6230741d1 BUG: 1163804 Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/9119 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/src/afr-self-heal-data.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index f7503faa719..0a43d128634 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -569,10 +569,11 @@ out:
* The return value is the index of the subvolume to be used as the source
* for self-healing, or -1 if no healing is necessary/split brain.
*/
-static int
-__afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this, fd_t *fd,
- unsigned char *locked_on, unsigned char *sources,
- unsigned char *sinks, unsigned char *healed_sinks,
+int
+__afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this,
+ inode_t *inode, unsigned char *locked_on,
+ unsigned char *sources, unsigned char *sinks,
+ unsigned char *healed_sinks,
struct afr_reply *replies)
{
int ret = -1;
@@ -582,10 +583,8 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this, fd_t *fd,
priv = this->private;
- ret = afr_selfheal_unlocked_discover (frame, fd->inode, fd->inode->gfid,
+ ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid,
replies);
- if (ret)
- return ret;
witness = alloca0(priv->child_count * sizeof (*witness));
ret = afr_selfheal_find_direction (frame, this, replies,
@@ -650,8 +649,9 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd,
goto unlock;
}
- ret = __afr_selfheal_data_prepare (frame, this, fd, data_lock,
- sources, sinks, healed_sinks,
+ ret = __afr_selfheal_data_prepare (frame, this, fd->inode,
+ data_lock, sources, sinks,
+ healed_sinks,
locked_replies);
if (ret < 0)
goto unlock;
@@ -678,7 +678,7 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd,
unlock:
afr_selfheal_uninodelk (frame, this, fd->inode, this->name, 0, 0,
data_lock);
- if (ret < 0)
+ if (ret < 0)
goto out;
ret = afr_selfheal_data_do (frame, this, fd, source, healed_sinks,
@@ -731,7 +731,6 @@ afr_selfheal_data_open (xlator_t *this, inode_t *inode)
return fd;
}
-
int
afr_selfheal_data (call_frame_t *frame, xlator_t *this, inode_t *inode)
{