Skip to contentSkip to conversation

f2fs: convert to F2FS_*_INO macro

PATCH In review liush 2 participants 4 messages Dec 7, 2020 F2FS file system

lore
Share & tools
lore
author
#1 lore raw

PATCH 2/2 f2fs: don't check PAGE_SIZE again in sanity_check_raw_super()

In reply to liush

From: Yangtao Li <[email protected]>

Many flash devices read and write a single IO based on a multiple of 4KB, and we support only 4KB page cache size now.

Since we already check page size in init_f2fs_fs(), so remove page size check in sanity_check_raw_super().

---
 fs/f2fs/super.c | 7 -------
 1 file changed, 7 deletions(-)
fs/f2fs/super.c +0 -7
index d3ccf89647df..a39a81ab8dee 100644
@@ -2770,13 +2770,6 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi,
 		}
 	}
 
-	/* Currently, support only 4KB page cache size */
-	if (F2FS_BLKSIZE != PAGE_SIZE) {
-		f2fs_info(sbi, "Invalid page_cache_size (%lu), supports only 4KB",
-			  PAGE_SIZE);
-		return -EFSCORRUPTED;
-	}
-
 	/* Currently, support only 4KB block size */
 	blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
 	if (blocksize != F2FS_BLKSIZE) {
Signature · 8 lines
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

liush

author
#0 lore raw

PATCH 1/2 f2fs: convert to F2FS_*_INO macro

From: Yangtao Li <[email protected]>

Use F2FS_ROOT_INO, F2FS_NODE_INO and F2FS_META_INO macro for better code readability.

---
 fs/f2fs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/f2fs/super.c +3 -3
index 00eff2f51807..d3ccf89647df 100644
@@ -3071,9 +3071,9 @@ static void init_sb_info(struct f2fs_sb_info *sbi)
 	sbi->total_node_count =
 		(le32_to_cpu(raw_super->segment_count_nat) / 2)
 			* sbi->blocks_per_seg * NAT_ENTRY_PER_BLOCK;
-	sbi->root_ino_num = le32_to_cpu(raw_super->root_ino);
-	sbi->node_ino_num = le32_to_cpu(raw_super->node_ino);
-	sbi->meta_ino_num = le32_to_cpu(raw_super->meta_ino);
+	F2FS_ROOT_INO(sbi) = le32_to_cpu(raw_super->root_ino);
+	F2FS_NODE_INO(sbi) = le32_to_cpu(raw_super->node_ino);
+	F2FS_META_INO(sbi) = le32_to_cpu(raw_super->meta_ino);
 	sbi->cur_victim_sec = NULL_SECNO;
 	sbi->next_victim_seg[BG_GC] = NULL_SEGNO;
 	sbi->next_victim_seg[FG_GC] = NULL_SEGNO;
Signature · 8 lines
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer Reviewed-by on v1 1/2
#3 lore raw
Quoted 7 lines · liush

From: Yangtao Li <[email protected]>

Use F2FS_ROOT_INO, F2FS_NODE_INO and F2FS_META_INO macro for better code readability.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super()

In reply to liush
Quoted 10 lines · liush

From: Yangtao Li <[email protected]>

Many flash devices read and write a single IO based on a multiple of 4KB, and we support only 4KB page cache size now.

Since we already check page size in init_f2fs_fs(), so remove page size check in sanity_check_raw_super().

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel