summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-11-24 08:45:10 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-24 06:40:12 -0800
commit250edc9e494fe0c59eff580df18080111ecb475e (patch)
tree0e73af8f82f9f644abff21ee5b2f0309e276dc22 /xlators/cluster/afr/src/afr-self-heal-data.c
parent74612a456ad1602f8038fae79fee654eb427602a (diff)
cluster/afr: Refactored the self-heal interface.
Cleaned up the self-heal interface to callers. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index e8384ec30..7662c1178 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -80,7 +80,7 @@ afr_sh_data_done (call_frame_t *frame, xlator_t *this)
"self heal of %s completed",
local->loc.path);
- sh->completion_cbk (sh->orig_frame, this);
+ sh->completion_cbk (frame, this);
return 0;
}
@@ -728,7 +728,8 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this)
afr_set_read_child (this, local->loc.inode, sh->source);
if (sh->background) {
- sh->unwind (frame, this);
+ sh->unwind (sh->orig_frame, this);
+ sh->unwound = _gf_true;
}
afr_sh_data_sync_prepare (frame, this);
@@ -790,7 +791,8 @@ afr_sh_data_fstat (call_frame_t *frame, xlator_t *this)
local = frame->local;
sh = &local->self_heal;
- call_count = local->child_count;
+ call_count = afr_up_children_count (priv->child_count,
+ local->child_up);
local->call_count = call_count;
@@ -868,7 +870,8 @@ afr_sh_data_fxattrop (call_frame_t *frame, xlator_t *this)
local = frame->local;
sh = &local->self_heal;
- call_count = local->child_count;
+ call_count = afr_up_children_count (priv->child_count,
+ local->child_up);
local->call_count = call_count;
@@ -1142,7 +1145,7 @@ afr_self_heal_data (call_frame_t *frame, xlator_t *this)
local = frame->local;
sh = &local->self_heal;
- if (local->need_data_self_heal && priv->data_self_heal) {
+ if (sh->need_data_self_heal && priv->data_self_heal) {
afr_sh_data_open (frame, this);
} else {
gf_log (this->name, GF_LOG_TRACE,