From 250edc9e494fe0c59eff580df18080111ecb475e Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 24 Nov 2009 08:45:10 +0000 Subject: cluster/afr: Refactored the self-heal interface. Cleaned up the self-heal interface to callers. Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati 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 --- xlators/cluster/afr/src/afr-open.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'xlators/cluster/afr/src/afr-open.c') 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; } -- cgit