diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-11-03 10:17:07 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-03 08:16:54 -0800 |
commit | 51d105d63fa82dae5465d19598b489d453b3a902 (patch) | |
tree | 2e9dc3f6b2d952ecf95b5b1f2f4ab12863b68e12 | |
parent | cd7a02533dbbc192cc117037cf39848d55210c83 (diff) |
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 <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 320 (Improve self-heal performance)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-algorithm.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |