summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 04fe1df052b2..0bb8e2c022d3 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -305,25 +305,22 @@ long sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
305 long nr_to_write, enum iostat_type io_type) 305 long nr_to_write, enum iostat_type io_type)
306{ 306{
307 struct address_space *mapping = META_MAPPING(sbi); 307 struct address_space *mapping = META_MAPPING(sbi);
308 pgoff_t index = 0, end = ULONG_MAX, prev = ULONG_MAX; 308 pgoff_t index = 0, prev = ULONG_MAX;
309 struct pagevec pvec; 309 struct pagevec pvec;
310 long nwritten = 0; 310 long nwritten = 0;
311 int nr_pages;
311 struct writeback_control wbc = { 312 struct writeback_control wbc = {
312 .for_reclaim = 0, 313 .for_reclaim = 0,
313 }; 314 };
314 struct blk_plug plug; 315 struct blk_plug plug;
315 316
316 pagevec_init(&pvec, 0); 317 pagevec_init(&pvec);
317 318
318 blk_start_plug(&plug); 319 blk_start_plug(&plug);
319 320
320 while (index <= end) { 321 while ((nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
321 int i, nr_pages; 322 PAGECACHE_TAG_DIRTY))) {
322 nr_pages = pagevec_lookup_tag(&pvec, mapping, &index, 323 int i;
323 PAGECACHE_TAG_DIRTY,
324 min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1);
325 if (unlikely(nr_pages == 0))
326 break;
327 324
328 for (i = 0; i < nr_pages; i++) { 325 for (i = 0; i < nr_pages; i++) {
329 struct page *page = pvec.pages[i]; 326 struct page *page = pvec.pages[i];