Commit 243c5ea4 authored by Vishal Moola (Oracle)'s avatar Vishal Moola (Oracle) Committed by Andrew Morton

nilfs2: convert nilfs_clear_dirty_pages() to use filemap_get_folios_tag()

Convert function to use folios throughout.  This is in preparation for the
removal of find_get_pages_range_tag().  This change removes 2 calls to
compound_head().

Link: https://lkml.kernel.org/r/20230104211448.4804-23-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent d4a16d31
...@@ -358,22 +358,22 @@ void nilfs_copy_back_pages(struct address_space *dmap, ...@@ -358,22 +358,22 @@ void nilfs_copy_back_pages(struct address_space *dmap,
*/ */
void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent) void nilfs_clear_dirty_pages(struct address_space *mapping, bool silent)
{ {
struct pagevec pvec; struct folio_batch fbatch;
unsigned int i; unsigned int i;
pgoff_t index = 0; pgoff_t index = 0;
pagevec_init(&pvec); folio_batch_init(&fbatch);
while (pagevec_lookup_tag(&pvec, mapping, &index, while (filemap_get_folios_tag(mapping, &index, (pgoff_t)-1,
PAGECACHE_TAG_DIRTY)) { PAGECACHE_TAG_DIRTY, &fbatch)) {
for (i = 0; i < pagevec_count(&pvec); i++) { for (i = 0; i < folio_batch_count(&fbatch); i++) {
struct page *page = pvec.pages[i]; struct folio *folio = fbatch.folios[i];
lock_page(page); folio_lock(folio);
nilfs_clear_dirty_page(page, silent); nilfs_clear_dirty_page(&folio->page, silent);
unlock_page(page); folio_unlock(folio);
} }
pagevec_release(&pvec); folio_batch_release(&fbatch);
cond_resched(); cond_resched();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment