summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-01-06 14:39:11 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-24 16:36:27 -0800
commit7cef443310ed7e6317b19b94628c968aa210ce17 (patch)
treed0b63b6d0d4e754d5bb8c562496459c629ed82db /mm
parente55e8f16723d5017aff16547e259e2c35766e4ad (diff)
mm: write_cache_pages more terminate quickly
commit 82fd1a9a8ced9607312b54859572bcc6211e8919 upstream. Now that we have the early-termination logic in place, it makes sense to bail out early in all other cases where done is set to 1. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Chris Mason <chris.mason@oracle.com> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0f225bf6b8ed..8875822d105e 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -987,12 +987,15 @@ continue_unlock:
if (wbc->sync_mode == WB_SYNC_NONE) {
wbc->nr_to_write--;
- if (wbc->nr_to_write <= 0)
+ if (wbc->nr_to_write <= 0) {
done = 1;
+ break;
+ }
}
if (wbc->nonblocking && bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1;
done = 1;
+ break;
}
}
pagevec_release(&pvec);