Skip to content

Commit 24fd7f0

Browse files
murphy12138Jaegeuk Kim
authored andcommitted
f2fs: simplify list initialization in f2fs_recover_fsync_data()
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. Signed-off-by: Baolin Liu <liubaolin@kylinos.cn> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 7ee8bc3 commit 24fd7f0

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

fs/f2fs/recovery.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,9 @@ static int recover_data(struct f2fs_sb_info *sbi, struct list_head *inode_list,
872872

873873
int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
874874
{
875-
struct list_head inode_list, tmp_inode_list;
876-
struct list_head dir_list;
875+
LIST_HEAD(inode_list);
876+
LIST_HEAD(tmp_inode_list);
877+
LIST_HEAD(dir_list);
877878
int err;
878879
int ret = 0;
879880
unsigned long s_flags = sbi->sb->s_flags;
@@ -886,10 +887,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
886887
if (is_sbi_flag_set(sbi, SBI_IS_WRITABLE))
887888
f2fs_info(sbi, "recover fsync data on readonly fs");
888889

889-
INIT_LIST_HEAD(&inode_list);
890-
INIT_LIST_HEAD(&tmp_inode_list);
891-
INIT_LIST_HEAD(&dir_list);
892-
893890
/* prevent checkpoint */
894891
f2fs_down_write(&sbi->cp_global_sem);
895892

0 commit comments

Comments
 (0)