f2fs: Use a folio in need_inode_page_update()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:12:36 +0000 (21:12 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:45 +0000 (15:26 +0000)
Fetch a folio from the pagecache instead of a page.  Removes two
calls to compound_head()

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index b98451073bf7bc62a03dd182661d9eb150b3f5f4..b41a8d3f88a555246b77f93a662d1a4ef6dfda18 100644 (file)
@@ -226,12 +226,13 @@ static inline enum cp_reason_type need_do_checkpoint(struct inode *inode)
 
 static bool need_inode_page_update(struct f2fs_sb_info *sbi, nid_t ino)
 {
-       struct page *i = find_get_page(NODE_MAPPING(sbi), ino);
+       struct folio *i = filemap_get_folio(NODE_MAPPING(sbi), ino);
        bool ret = false;
        /* But we need to avoid that there are some inode updates */
-       if ((i && PageDirty(i)) || f2fs_need_inode_block_update(sbi, ino))
+       if ((!IS_ERR(i) && folio_test_dirty(i)) ||
+           f2fs_need_inode_block_update(sbi, ino))
                ret = true;
-       f2fs_put_page(i, 0);
+       f2fs_folio_put(i, false);
        return ret;
 }