diff options
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 34a7a9affea0..0b159c555069 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2916,7 +2916,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping, { int ret = 0; int done = 0, retry = 0; - struct pagevec pvec; + struct page *pages[F2FS_ONSTACK_PAGES]; struct f2fs_sb_info *sbi = F2FS_M_SB(mapping); struct bio *bio = NULL; sector_t last_block; @@ -2947,8 +2947,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping, int submitted = 0; int i; - pagevec_init(&pvec); - if (get_dirty_pages(mapping->host) <= SM_I(F2FS_M_SB(mapping))->min_hot_blocks) set_inode_flag(mapping->host, FI_HOT_DATA); @@ -2974,13 +2972,13 @@ retry: tag_pages_for_writeback(mapping, index, end); done_index = index; while (!done && !retry && (index <= end)) { - nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, - tag); + nr_pages = find_get_pages_range_tag(mapping, &index, end, + tag, F2FS_ONSTACK_PAGES, pages); if (nr_pages == 0) break; for (i = 0; i < nr_pages; i++) { - struct page *page = pvec.pages[i]; + struct page *page = pages[i]; bool need_readd; readd: need_readd = false; @@ -3012,7 +3010,7 @@ readd: goto lock_page; if (f2fs_all_cluster_page_ready(&cc, - &pvec, i, nr_pages, true)) + pages, i, nr_pages, true)) goto lock_page; ret2 = f2fs_prepare_compress_overwrite( @@ -3026,7 +3024,7 @@ readd: (!f2fs_compress_write_end(inode, fsdata, page->index, 1) || !f2fs_all_cluster_page_ready(&cc, - &pvec, i, nr_pages, false))) { + pages, i, nr_pages, false))) { retry = 1; break; } @@ -3116,7 +3114,7 @@ next: if (need_readd) goto readd; } - pagevec_release(&pvec); + release_pages(pages, nr_pages); cond_resched(); } #ifdef CONFIG_F2FS_FS_COMPRESSION |