From 51d105d63fa82dae5465d19598b489d453b3a902 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 3 Nov 2009 10:17:07 +0000 Subject: cluster/afr: Bail out of the self-heal driver loops as soon as possible Don't wait for the next recursive call to sh_{full,diff}_loop_driver to decide that we've reached the end of file, as the frame could have been destroyed by that time (if subvolumes are posix). Signed-off-by: Vikas Gorur Signed-off-by: Anand V. Avati BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320 --- xlators/cluster/afr/src/afr-self-heal-algorithm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-algorithm.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c index e8fce966b..f9ed1afe0 100644 --- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c +++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c @@ -350,7 +350,8 @@ spawn: sh_priv->loops_running++; - loop = 1; + if (sh_priv->offset < sh->file_size) + loop = 1; } } UNLOCK (&sh_priv->lock); @@ -842,7 +843,6 @@ sh_diff_loop_driver (call_frame_t *frame, xlator_t *this) local->loc.path); sh_diff_private_cleanup (frame, this); - local->self_heal.algo_abort_cbk (frame, this); } @@ -857,7 +857,6 @@ sh_diff_loop_driver (call_frame_t *frame, xlator_t *this) sh_diff_private_cleanup (frame, this); - local->self_heal.algo_completion_cbk (frame, this); } @@ -881,7 +880,8 @@ spawn: sh_priv->loops_running++; - loop = 1; + if (sh_priv->offset < sh->file_size) + loop = 1; } } UNLOCK (&sh_priv->lock); -- cgit