nilfs2: convert nilfs_lookup_dirty_node_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-20-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Vishal Moola (Oracle) 2023-01-04 13:14:44 -08:00 committed by Andrew Morton
parent 5ee4b25cb7
commit a245865831
1 changed files with 7 additions and 8 deletions

View File

@ -737,20 +737,19 @@ static void nilfs_lookup_dirty_node_buffers(struct inode *inode,
{ {
struct nilfs_inode_info *ii = NILFS_I(inode); struct nilfs_inode_info *ii = NILFS_I(inode);
struct inode *btnc_inode = ii->i_assoc_inode; struct inode *btnc_inode = ii->i_assoc_inode;
struct pagevec pvec; struct folio_batch fbatch;
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
unsigned int i; unsigned int i;
pgoff_t index = 0; pgoff_t index = 0;
if (!btnc_inode) if (!btnc_inode)
return; return;
folio_batch_init(&fbatch);
pagevec_init(&pvec); while (filemap_get_folios_tag(btnc_inode->i_mapping, &index,
(pgoff_t)-1, PAGECACHE_TAG_DIRTY, &fbatch)) {
while (pagevec_lookup_tag(&pvec, btnc_inode->i_mapping, &index, for (i = 0; i < folio_batch_count(&fbatch); i++) {
PAGECACHE_TAG_DIRTY)) { bh = head = folio_buffers(fbatch.folios[i]);
for (i = 0; i < pagevec_count(&pvec); i++) {
bh = head = page_buffers(pvec.pages[i]);
do { do {
if (buffer_dirty(bh) && if (buffer_dirty(bh) &&
!buffer_async_write(bh)) { !buffer_async_write(bh)) {
@ -761,7 +760,7 @@ static void nilfs_lookup_dirty_node_buffers(struct inode *inode,
bh = bh->b_this_page; bh = bh->b_this_page;
} while (bh != head); } while (bh != head);
} }
pagevec_release(&pvec); folio_batch_release(&fbatch);
cond_resched(); cond_resched();
} }
} }