diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-11-24 08:45:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-24 06:40:12 -0800 |
commit | 250edc9e494fe0c59eff580df18080111ecb475e (patch) | |
tree | 0e73af8f82f9f644abff21ee5b2f0309e276dc22 /xlators/cluster/afr/src/afr-open.c | |
parent | 74612a456ad1602f8038fae79fee654eb427602a (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-open.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-open.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 945f5cddf..1918dee81 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -199,7 +199,7 @@ out: int -afr_up_down_flush_sh_completion_cbk (call_frame_t *frame, xlator_t *this) +afr_up_down_flush_sh_unwind (call_frame_t *frame, xlator_t *this) { afr_local_t *local = NULL; @@ -222,30 +222,18 @@ afr_up_down_flush_post_post_op (call_frame_t *frame, xlator_t *this) local = frame->local; sh = &local->self_heal; - sh->calling_fop = GF_FOP_FLUSH; - -// sh->healing_fd = local->fd; - -// sh->healing_fd_opened = _gf_true; - - local->cont.lookup.inode = local->fd->inode; - inode_path (local->fd->inode, NULL, (char **)&local->loc.path); local->loc.name = strrchr (local->loc.path, '/'); local->loc.inode = inode_ref (local->fd->inode); local->loc.parent = inode_parent (local->fd->inode, 0, NULL); - sh->data_lock_held = _gf_true; - - local->need_data_self_heal = _gf_true; - local->cont.lookup.buf.st_mode = local->fd->inode->st_mode; - local->child_count = afr_up_children_count (priv->child_count, - local->child_up); - - sh->flush_self_heal_cbk = afr_up_down_flush_sh_completion_cbk; + sh->data_lock_held = _gf_true; + sh->need_data_self_heal = _gf_true; + sh->mode = local->fd->inode->st_mode; + sh->background = _gf_false; + sh->unwind = afr_up_down_flush_sh_unwind; - afr_self_heal (frame, this, afr_up_down_flush_sh_completion_cbk, - _gf_false); + afr_self_heal (frame, this); return 0; } |