From 4f9396545ba9c91d4bebfc81148c0082237141f4 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 22 Aug 2011 13:54:15 +0530 Subject: cluster/afr: Perform flush on all the children involved in self-heal Change-Id: I66362a3087a635fb7b759d7836a1f6564a6a7fc9 BUG: 3456 Reviewed-on: http://review.gluster.com/294 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-self-heal-data.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 5db2d94f5..60f42c54b 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -119,36 +119,23 @@ afr_sh_data_close (call_frame_t *frame, xlator_t *this) afr_self_heal_t *sh = NULL; int i = 0; int call_count = 0; - int source = 0; local = frame->local; sh = &local->self_heal; priv = this->private; - source = sh->source; - - call_count = (sh->active_sinks + 1); + call_count = afr_set_elem_count_get (sh->success, + priv->child_count); local->call_count = call_count; - /* closed source */ - gf_log (this->name, GF_LOG_DEBUG, - "closing fd of %s on %s", - local->loc.path, priv->children[sh->source]->name); - - STACK_WIND_COOKIE (frame, afr_sh_data_flush_cbk, - (void *) (long) sh->source, - priv->children[sh->source], - priv->children[sh->source]->fops->flush, - sh->healing_fd); - call_count--; - - if (call_count == 0) + if (call_count == 0) { + afr_sh_data_done (frame, this); return 0; + } for (i = 0; i < priv->child_count; i++) { - if (sh->sources[i] || !local->child_up[i]) + if (!sh->success[i]) continue; - gf_log (this->name, GF_LOG_DEBUG, "closing fd of %s on %s", local->loc.path, priv->children[i]->name); -- cgit