summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-metadata.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-metadata.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-metadata.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index 9842902e6..bddccf682 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -81,7 +81,7 @@ afr_sh_metadata_done (call_frame_t *frame, xlator_t *this)
local->loc.path);
sh->completion_cbk (frame, this);
} else {
- if (S_ISREG (local->cont.lookup.buf.st_mode)) {
+ if (S_ISREG (sh->mode)) {
gf_log (this->name, GF_LOG_TRACE,
"proceeding to data check on %s",
local->loc.path);
@@ -89,7 +89,7 @@ afr_sh_metadata_done (call_frame_t *frame, xlator_t *this)
return 0;
}
- if (S_ISDIR (local->cont.lookup.buf.st_mode)) {
+ if (S_ISDIR (sh->mode)) {
gf_log (this->name, GF_LOG_TRACE,
"proceeding to entry check on %s",
local->loc.path);
@@ -668,7 +668,8 @@ afr_sh_metadata_lookup (call_frame_t *frame, xlator_t *this)
sh = &local->self_heal;
priv = this->private;
- call_count = local->child_count;
+ call_count = afr_up_children_count (priv->child_count,
+ local->child_up);
local->call_count = call_count;
xattr_req = dict_new();
@@ -769,7 +770,8 @@ afr_sh_metadata_lock (call_frame_t *frame, xlator_t *this)
sh = &local->self_heal;
priv = this->private;
- call_count = local->child_count;
+ call_count = afr_up_children_count (priv->child_count,
+ local->child_up);
local->call_count = call_count;
for (i = 0; i < priv->child_count; i++) {
@@ -809,7 +811,7 @@ afr_self_heal_metadata (call_frame_t *frame, xlator_t *this)
local = frame->local;
sh = &local->self_heal;
- if (local->need_metadata_self_heal && priv->metadata_self_heal) {
+ if (local->self_heal.need_metadata_self_heal && priv->metadata_self_heal) {
afr_sh_metadata_lock (frame, this);
} else {
afr_sh_metadata_done (frame, this);