linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: convert to F2FS_*_INO macro
@ 2020-12-07 10:59 liush
  2020-12-07 10:59 ` [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super() liush
  2020-12-07 15:04 ` [PATCH 1/2] f2fs: convert to F2FS_*_INO macro Chao Yu
  0 siblings, 2 replies; 5+ messages in thread
From: liush @ 2020-12-07 10:59 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel, tiny.windzz, Shaohua Liu

From: Yangtao Li <tiny.windzz@gmail.com>

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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Shaohua Liu <liush@allwinnertech.com>
---
 fs/f2fs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 00eff2f51807..d3ccf89647df 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super()
  2020-12-07 10:59 [PATCH 1/2] f2fs: convert to F2FS_*_INO macro liush
@ 2020-12-07 10:59 ` liush
  2020-12-07 15:06   ` Chao Yu
  2020-12-07 15:04 ` [PATCH 1/2] f2fs: convert to F2FS_*_INO macro Chao Yu
  1 sibling, 1 reply; 5+ messages in thread
From: liush @ 2020-12-07 10:59 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel, tiny.windzz, Shaohua Liu

From: Yangtao Li <tiny.windzz@gmail.com>

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().

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Shaohua Liu <liush@allwinnertech.com>
---
 fs/f2fs/super.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index d3ccf89647df..a39a81ab8dee 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] f2fs: convert to F2FS_*_INO macro
  2020-12-07 10:59 [PATCH 1/2] f2fs: convert to F2FS_*_INO macro liush
  2020-12-07 10:59 ` [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super() liush
@ 2020-12-07 15:04 ` Chao Yu
  1 sibling, 0 replies; 5+ messages in thread
From: Chao Yu @ 2020-12-07 15:04 UTC (permalink / raw)
  To: liush, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, tiny.windzz

On 2020/12/7 18:59, liush wrote:
> From: Yangtao Li <tiny.windzz@gmail.com>
> 
> Use F2FS_ROOT_INO, F2FS_NODE_INO and F2FS_META_INO macro
> for better code readability.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> Signed-off-by: Shaohua Liu <liush@allwinnertech.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super()
  2020-12-07 10:59 ` [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super() liush
@ 2020-12-07 15:06   ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2020-12-07 15:06 UTC (permalink / raw)
  To: liush, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, tiny.windzz

On 2020/12/7 18:59, liush wrote:
> From: Yangtao Li <tiny.windzz@gmail.com>
> 
> 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().
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> Signed-off-by: Shaohua Liu <liush@allwinnertech.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] f2fs: convert to F2FS_*_INO macro
@ 2020-12-07 10:58 liush
  0 siblings, 0 replies; 5+ messages in thread
From: liush @ 2020-12-07 10:58 UTC (permalink / raw)
  To: jaegeuk, chao
  Cc: linux-f2fs-devel, linux-kernel, iny.windzz, Yangtao Li, Shaohua Liu

From: Yangtao Li <tiny.windzz@gmail.com>

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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Shaohua Liu <liush@allwinnertech.com>
---
 fs/f2fs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 00eff2f51807..d3ccf89647df 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-07 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 10:59 [PATCH 1/2] f2fs: convert to F2FS_*_INO macro liush
2020-12-07 10:59 ` [PATCH 2/2] f2fs: don't check PAGE_SIZE again in sanity_check_raw_super() liush
2020-12-07 15:06   ` Chao Yu
2020-12-07 15:04 ` [PATCH 1/2] f2fs: convert to F2FS_*_INO macro Chao Yu
  -- strict thread matches above, loose matches on Subject: below --
2020-12-07 10:58 liush

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).