f2fs: Use a folio in fill_zero()

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>
This commit is contained in:
Matthew Wilcox (Oracle) 2025-03-31 21:11:15 +01:00 committed by Jaegeuk Kim
parent 6965a65caf
commit c35cc972c3

View 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;
}