Re: [PATCH] f2fs: get rid of buffer_head use

From: Matthew Wilcox
Date: Thu Jun 06 2024 - 08:38:27 EST


On Thu, Jun 06, 2024 at 05:50:37PM +0800, Chao Yu wrote:
> For later folio conversion.

What tree is this against?

> @@ -3957,32 +3976,32 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
> return -ENOMEM;
>
> for (block = 0; block < 2; block++) {
> - bh = sb_bread(sb, block);
> - if (!bh) {
> + page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping,
> + block, NULL);

You need to use bd_mapping, not bd_inode->i_mapping (since May 21 in
Linus' tree).

And I don't think there's much point in switching to pages as an
intermediate step. You may as well go straight to folios.

folio = read_mapping_folio(sb->s_bdev->bd_mapping, block, NULL);