]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: Use a folio in fill_zero()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:11:15 +0000 (21:11 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:33 +0000 (15:26 +0000)
Remove three hidden 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 471cdd3ba16dbfd7314e42e7fdee72f50405c6dc..d333161ed40cda28fbeeddca1ad36bf32a2be5fd 100644 (file)
@@ -1164,7 +1164,7 @@ static int fill_zero(struct inode *inode, pgoff_t index,
                                        loff_t start, loff_t len)
 {
        struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
-       struct page *page;
+       struct folio *folio;
 
        if (!len)
                return 0;
@@ -1172,16 +1172,16 @@ static int fill_zero(struct inode *inode, pgoff_t index,
        f2fs_balance_fs(sbi, true);
 
        f2fs_lock_op(sbi);
-       page = f2fs_get_new_data_page(inode, NULL, index, false);
+       folio = f2fs_get_new_data_folio(inode, NULL, index, false);
        f2fs_unlock_op(sbi);
 
-       if (IS_ERR(page))
-               return PTR_ERR(page);
+       if (IS_ERR(folio))
+               return PTR_ERR(folio);
 
-       f2fs_wait_on_page_writeback(page, DATA, true, true);
-       zero_user(page, start, len);
-       set_page_dirty(page);
-       f2fs_put_page(page, 1);
+       f2fs_folio_wait_writeback(folio, DATA, true, true);
+       folio_zero_range(folio, start, len);
+       folio_mark_dirty(folio);
+       f2fs_folio_put(folio, true);
        return 0;
 }