]> Git Repo - linux.git/commitdiff
f2fs: initialize last_block_in_bio variable
authorWu Bo <[email protected]>
Tue, 14 May 2024 11:35:29 +0000 (05:35 -0600)
committerJaegeuk Kim <[email protected]>
Wed, 15 May 2024 04:18:40 +0000 (04:18 +0000)
Initialize last_block_in_bio of struct f2fs_bio_info and clean up code.

Signed-off-by: Wu Bo <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
fs/f2fs/data.c

index bdbd4195cadc7540469986840a07b72ab6c78a66..50ceb25b341de57c4a52bad9d5ec42343345aae2 100644 (file)
@@ -595,17 +595,20 @@ int f2fs_init_write_merge_io(struct f2fs_sb_info *sbi)
                        return -ENOMEM;
 
                for (j = HOT; j < n; j++) {
-                       init_f2fs_rwsem(&sbi->write_io[i][j].io_rwsem);
-                       sbi->write_io[i][j].sbi = sbi;
-                       sbi->write_io[i][j].bio = NULL;
-                       spin_lock_init(&sbi->write_io[i][j].io_lock);
-                       INIT_LIST_HEAD(&sbi->write_io[i][j].io_list);
-                       INIT_LIST_HEAD(&sbi->write_io[i][j].bio_list);
-                       init_f2fs_rwsem(&sbi->write_io[i][j].bio_list_lock);
+                       struct f2fs_bio_info *io = &sbi->write_io[i][j];
+
+                       init_f2fs_rwsem(&io->io_rwsem);
+                       io->sbi = sbi;
+                       io->bio = NULL;
+                       io->last_block_in_bio = 0;
+                       spin_lock_init(&io->io_lock);
+                       INIT_LIST_HEAD(&io->io_list);
+                       INIT_LIST_HEAD(&io->bio_list);
+                       init_f2fs_rwsem(&io->bio_list_lock);
 #ifdef CONFIG_BLK_DEV_ZONED
-                       init_completion(&sbi->write_io[i][j].zone_wait);
-                       sbi->write_io[i][j].zone_pending_bio = NULL;
-                       sbi->write_io[i][j].bi_private = NULL;
+                       init_completion(&io->zone_wait);
+                       io->zone_pending_bio = NULL;
+                       io->bi_private = NULL;
 #endif
                }
        }
This page took 0.049966 seconds and 4 git commands to generate.