Skip to contentSkip to conversation

f2fs: always call f2fs_issue_checkpoint() in f2fs_sync_fs()

PATCH In review Yangtao Li 2 participants 2 messages Aug 16, 2021 – Aug 17, 2021 F2FS file system

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 f2fs: always call f2fs_issue_checkpoint() in f2fs_sync_fs()

Sync is always 1, so delete the check of the value.

---
 fs/f2fs/super.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/f2fs/super.c +1 -5
index 98727e04d271..b823c7e3f303 100644
@@ -1553,7 +1553,6 @@ static void f2fs_put_super(struct super_block *sb)
 int f2fs_sync_fs(struct super_block *sb, int sync)
 {
 	struct f2fs_sb_info *sbi = F2FS_SB(sb);
-	int err = 0;
 
 	if (unlikely(f2fs_cp_error(sbi)))
 		return 0;
@@ -1565,10 +1564,7 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
 	if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
 		return -EAGAIN;
 
-	if (sync)
-		err = f2fs_issue_checkpoint(sbi);
-
-	return err;
+	return f2fs_issue_checkpoint(sbi);
 }
 
 static int f2fs_freeze(struct super_block *sb)
Signature · 8 lines
2.32.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 1 line · Yangtao Li

Sync is always 1, so delete the check of the value.

I don't think so.

Quoted 32 lines
---
 fs/f2fs/super.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/f2fs/super.c +1 -5
index 98727e04d271..b823c7e3f303 100644
@@ -1553,7 +1553,6 @@ static void f2fs_put_super(struct super_block *sb)
 int f2fs_sync_fs(struct super_block *sb, int sync)
 {
 	struct f2fs_sb_info *sbi = F2FS_SB(sb);
-	int err = 0;
 
 	if (unlikely(f2fs_cp_error(sbi)))
 		return 0;
@@ -1565,10 +1564,7 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
 	if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
 		return -EAGAIN;
 
-	if (sync)
-		err = f2fs_issue_checkpoint(sbi);
-
-	return err;
+	return f2fs_issue_checkpoint(sbi);
 }
 
 static int f2fs_freeze(struct super_block *sb)
Signature · 1 line
2.32.0