f2fs: get rid of buffer_head use
Chao Yu
maintainerPATCH 1/1 f2fs: get rid of buffer_head use
For later folio conversion.
---
v1:
- I checked recovery flow of superblock w/ below testcase, it passes.
1. mkfs.f2fs /dev/vdd
2. dd if=/dev/zero of=/dev/vdd bs=4k count=1
3. mount /dev/vdd /mnt/f2fs
4. umount /mnt/f2fs
5. dd if=/dev/zero of=/dev/vdd bs=4k count=1 seek=1
6. mount /dev/vdd /mnt/f2fs
7. umount /mnt/f2fs
fs/f2fs/data.c | 1 - fs/f2fs/f2fs.h | 1 - fs/f2fs/file.c | 1 - fs/f2fs/inode.c | 1 - fs/f2fs/super.c | 95 ++++++++++++++++++++++++++++++------------------- 5 files changed, 58 insertions(+), 41 deletions(-)
fs/f2fs/data.c +0 -1
@@ -7,7 +7,6 @@*/ #include <linux/fs.h> #include <linux/f2fs_fs.h> -#include <linux/buffer_head.h> #include <linux/sched/mm.h> #include <linux/mpage.h> #include <linux/writeback.h>
fs/f2fs/f2fs.h +0 -1
@@ -11,7 +11,6 @@#include <linux/uio.h> #include <linux/types.h> #include <linux/page-flags.h> -#include <linux/buffer_head.h> #include <linux/slab.h> #include <linux/crc32.h> #include <linux/magic.h>
fs/f2fs/file.c +0 -1
@@ -8,7 +8,6 @@#include <linux/fs.h> #include <linux/f2fs_fs.h> #include <linux/stat.h> -#include <linux/buffer_head.h> #include <linux/writeback.h> #include <linux/blkdev.h> #include <linux/falloc.h>
fs/f2fs/inode.c +0 -1
@@ -7,7 +7,6 @@*/ #include <linux/fs.h> #include <linux/f2fs_fs.h> -#include <linux/buffer_head.h> #include <linux/writeback.h> #include <linux/sched/mm.h> #include <linux/lz4.h>
fs/f2fs/super.c +58 -37
184 lines not on this page · raw message
Signature · 1 line
2.40.1
Quoted 1 line · Chao Yu
For later folio conversion.
What tree is this against?
fs/f2fs/super.c static int read_raw_super_block(struct f2fs_sb_info *sbi, · line 3980
Quoted 8 lines
fs/f2fs/super.c +2
-2@@ -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);
Chao Yu
maintainerQuoted 4 lines · Matthew Wilcox
Quoted 1 line · Chao Yu
For later folio conversion.
What tree is this against?
Last dev-test branch of f2fs git tree, I guess it's a little behind to linus' tree.
Quoted 4 lines
Quoted 4 lines
fs/f2fs/super.c +0
-0@@ -3957,32 +3976,32 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,return -ENOMEM ;
Quoted 8 lines
fs/f2fs/super.c static int read_raw_super_block(struct f2fs_sb_info *sbi, · line 3980
Quoted 5 lines
fs/f2fs/super.c +2
-2for (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, notbd_inode->i_mapping(since May 21 in Linus' tree).
Will update it once f2fs codebase was rebased to linus' tree.
Quoted 5 lines
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);
Fine, let me work on this in v2.
Thanks,