f2fs: Use a folio in f2fs_migrate_blocks()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:11:09 +0000 (21:11 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:32 +0000 (15:26 +0000)
Get a folio from the pagecache and use it throughout.  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/data.c

index efc8e6c0b1d7beeb58023dc738bea0be7a4f4f25..5e6638189e78a05e97024d42400204fcbdb64b59 100644 (file)
@@ -3878,18 +3878,18 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk,
                set_inode_flag(inode, FI_SKIP_WRITES);
 
                for (blkofs = 0; blkofs <= blkofs_end; blkofs++) {
-                       struct page *page;
+                       struct folio *folio;
                        unsigned int blkidx = secidx * blk_per_sec + blkofs;
 
-                       page = f2fs_get_lock_data_page(inode, blkidx, true);
-                       if (IS_ERR(page)) {
+                       folio = f2fs_get_lock_data_folio(inode, blkidx, true);
+                       if (IS_ERR(folio)) {
                                f2fs_up_write(&sbi->pin_sem);
-                               ret = PTR_ERR(page);
+                               ret = PTR_ERR(folio);
                                goto done;
                        }
 
-                       set_page_dirty(page);
-                       f2fs_put_page(page, 1);
+                       folio_mark_dirty(folio);
+                       f2fs_folio_put(folio, true);
                }
 
                clear_inode_flag(inode, FI_SKIP_WRITES);