[PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function

Yuwei Guan posted 3 patches 3 years, 4 months ago
[PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function
Posted by Yuwei Guan 3 years, 4 months ago
A cleanup patch for 'f2fs_tuning_parameters' function.

Signed-off-by: Yuwei Guan <Yuwei.Guan@zeekrlife.com>
---
 fs/f2fs/super.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 17b9e70b8f32..3e974c003b77 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4060,13 +4060,11 @@ static int f2fs_setup_casefold(struct f2fs_sb_info *sbi)
 
 static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi)
 {
-	struct f2fs_sm_info *sm_i = SM_I(sbi);
-
 	/* adjust parameters according to the volume size */
-	if (sm_i->main_segments <= SMALL_VOLUME_SEGMENTS) {
+	if (MAIN_SEGS(sbi) <= SMALL_VOLUME_SEGMENTS) {
 		if (f2fs_block_unit_discard(sbi))
-			sm_i->dcc_info->discard_granularity = 1;
-		sm_i->ipu_policy = 1 << F2FS_IPU_FORCE |
+			SM_I(sbi)->dcc_info->discard_granularity = 1;
+		SM_I(sbi)->ipu_policy = 1 << F2FS_IPU_FORCE |
 					1 << F2FS_IPU_HONOR_OPU_WRITE;
 	}
 
-- 
2.34.1
Re: [PATCH v2 2/3] f2fs: cleanup for 'f2fs_tuning_parameters' function
Posted by Chao Yu 3 years, 4 months ago
On 2022/11/15 14:35, Yuwei Guan wrote:
> A cleanup patch for 'f2fs_tuning_parameters' function.
> 
> Signed-off-by: Yuwei Guan <Yuwei.Guan@zeekrlife.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,