f2fs: Use a folio in f2fs_truncate_meta_inode_pages()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:12:37 +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/f2fs.h

index e23249da26109b391baf494697dd1ec5e07d7922..3b821c7d0579b51712e9f576cee4fb732f8dfccf 100644 (file)
@@ -4819,13 +4819,13 @@ static inline void f2fs_truncate_meta_inode_pages(struct f2fs_sb_info *sbi,
        int i = 0;
 
        do {
-               struct page *page;
+               struct folio *folio;
 
-               page = find_get_page(META_MAPPING(sbi), blkaddr + i);
-               if (page) {
-                       if (folio_test_writeback(page_folio(page)))
+               folio = filemap_get_folio(META_MAPPING(sbi), blkaddr + i);
+               if (!IS_ERR(folio)) {
+                       if (folio_test_writeback(folio))
                                need_submit = true;
-                       f2fs_put_page(page, 0);
+                       f2fs_folio_put(folio, false);
                }
        } while (++i < cnt && !need_submit);