Commit 41f3f3b5 authored by Vishal Moola (Oracle)'s avatar Vishal Moola (Oracle) Committed by Andrew Morton

nilfs2: convert nilfs_btree_lookup_dirty_buffers() 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 1 call to
compound_head().

Link: https://lkml.kernel.org/r/20230104211448.4804-21-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 a2458658
...@@ -2150,7 +2150,7 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree, ...@@ -2150,7 +2150,7 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree,
struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode; struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode;
struct address_space *btcache = btnc_inode->i_mapping; struct address_space *btcache = btnc_inode->i_mapping;
struct list_head lists[NILFS_BTREE_LEVEL_MAX]; struct list_head lists[NILFS_BTREE_LEVEL_MAX];
struct pagevec pvec; struct folio_batch fbatch;
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
pgoff_t index = 0; pgoff_t index = 0;
int level, i; int level, i;
...@@ -2160,19 +2160,19 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree, ...@@ -2160,19 +2160,19 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree,
level++) level++)
INIT_LIST_HEAD(&lists[level]); INIT_LIST_HEAD(&lists[level]);
pagevec_init(&pvec); folio_batch_init(&fbatch);
while (pagevec_lookup_tag(&pvec, btcache, &index, while (filemap_get_folios_tag(btcache, &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++) {
bh = head = page_buffers(pvec.pages[i]); bh = head = folio_buffers(fbatch.folios[i]);
do { do {
if (buffer_dirty(bh)) if (buffer_dirty(bh))
nilfs_btree_add_dirty_buffer(btree, nilfs_btree_add_dirty_buffer(btree,
lists, bh); lists, bh);
} while ((bh = bh->b_this_page) != head); } while ((bh = bh->b_this_page) != head);
} }
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