Skip to content

Commit 16409fd

Browse files
Wu BoJaegeuk Kim
authored andcommitted
f2fs: initialize last_block_in_bio variable
Initialize last_block_in_bio of struct f2fs_bio_info and clean up code. Signed-off-by: Wu Bo <bo.wu@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 0d89682 commit 16409fd

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

fs/f2fs/data.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -595,17 +595,20 @@ int f2fs_init_write_merge_io(struct f2fs_sb_info *sbi)
595595
return -ENOMEM;
596596

597597
for (j = HOT; j < n; j++) {
598-
init_f2fs_rwsem(&sbi->write_io[i][j].io_rwsem);
599-
sbi->write_io[i][j].sbi = sbi;
600-
sbi->write_io[i][j].bio = NULL;
601-
spin_lock_init(&sbi->write_io[i][j].io_lock);
602-
INIT_LIST_HEAD(&sbi->write_io[i][j].io_list);
603-
INIT_LIST_HEAD(&sbi->write_io[i][j].bio_list);
604-
init_f2fs_rwsem(&sbi->write_io[i][j].bio_list_lock);
598+
struct f2fs_bio_info *io = &sbi->write_io[i][j];
599+
600+
init_f2fs_rwsem(&io->io_rwsem);
601+
io->sbi = sbi;
602+
io->bio = NULL;
603+
io->last_block_in_bio = 0;
604+
spin_lock_init(&io->io_lock);
605+
INIT_LIST_HEAD(&io->io_list);
606+
INIT_LIST_HEAD(&io->bio_list);
607+
init_f2fs_rwsem(&io->bio_list_lock);
605608
#ifdef CONFIG_BLK_DEV_ZONED
606-
init_completion(&sbi->write_io[i][j].zone_wait);
607-
sbi->write_io[i][j].zone_pending_bio = NULL;
608-
sbi->write_io[i][j].bi_private = NULL;
609+
init_completion(&io->zone_wait);
610+
io->zone_pending_bio = NULL;
611+
io->bi_private = NULL;
609612
#endif
610613
}
611614
}

0 commit comments

Comments
 (0)