Skip to contentSkip to conversation

f2fs: simplify list initialization in f2fs_recover_fsync_data()

PATCH Applied Baolin Liu 3 participants 3 messages Nov 11, 2025 – Nov 24, 2025 F2FS file system

lore
Share & tools
lore

Baolin Liu

author
#0 lore raw

PATCH 1/1 f2fs: simplify list initialization in f2fs_recover_fsync_data()

From: Baolin Liu <[email protected]>

In f2fs_recover_fsync_data(),use LIST_HEAD() to declare and initialize the list_head in one step instead of using INIT_LIST_HEAD() separately.

No functional change.

---
 fs/f2fs/recovery.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
fs/f2fs/recovery.c +3 -6
index 215e442db72c..3d85d15a4f8b 100644
@@ -869,8 +869,9 @@ static int recover_data(struct f2fs_sb_info *sbi, struct list_head *inode_list,
 
 int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 {
-	struct list_head inode_list, tmp_inode_list;
-	struct list_head dir_list;
+	LIST_HEAD(inode_list);
+	LIST_HEAD(tmp_inode_list);
+	LIST_HEAD(dir_list);
 	int err;
 	int ret = 0;
 	unsigned long s_flags = sbi->sb->s_flags;
@@ -882,10 +883,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 	if (is_sbi_flag_set(sbi, SBI_IS_WRITABLE))
 		f2fs_info(sbi, "recover fsync data on readonly fs");
 
-	INIT_LIST_HEAD(&inode_list);
-	INIT_LIST_HEAD(&tmp_inode_list);
-	INIT_LIST_HEAD(&dir_list);
-
 	/* prevent checkpoint */
 	f2fs_down_write(&sbi->cp_global_sem);
 
Signature · 1 line
2.39.2
#2 lore raw
In reply to Baolin Liu
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 9 lines · On Tue, 11 Nov 2025 20:17:28 +0800 you wrote:

From: Baolin Liu <[email protected]>

In f2fs_recover_fsync_data(),use LIST_HEAD() to declare and initialize the list_head in one step instead of using INIT_LIST_HEAD() separately.

No functional change.

[...]

Here is the summary with links:
- [f2fs-dev,v1] f2fs: simplify list initialization in f2fs_recover_fsync_data()

    https://git.kernel.org/jaegeuk/f2fs/c/82fbca2067aa

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html