]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: Split f2fs_write_end_io()
authorBart Van Assche <bvanassche@acm.org>
Wed, 10 Jun 2026 19:34:19 +0000 (12:34 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:37 +0000 (19:52 +0000)
Prepare for running most of the write completion work asynchronously.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 64250e6a94d107d9824409432c397fdc9217a910..a765fda715363914f0ed67449444df9c54009c5e 100644 (file)
@@ -350,14 +350,11 @@ static void f2fs_read_end_io(struct bio *bio)
        f2fs_verify_and_finish_bio(bio, intask);
 }
 
-static void f2fs_write_end_io(struct bio *bio)
+static void f2fs_write_end_bio(struct bio *bio)
 {
-       struct f2fs_sb_info *sbi;
+       struct f2fs_sb_info *sbi = bio->bi_private;
        struct folio_iter fi;
 
-       iostat_update_and_unbind_ctx(bio);
-       sbi = bio->bi_private;
-
        if (time_to_inject(sbi, FAULT_WRITE_IO))
                bio->bi_status = BLK_STS_IOERR;
 
@@ -414,6 +411,13 @@ static void f2fs_write_end_io(struct bio *bio)
        bio_put(bio);
 }
 
+static void f2fs_write_end_io(struct bio *bio)
+{
+       iostat_update_and_unbind_ctx(bio);
+
+       f2fs_write_end_bio(bio);
+}
+
 #ifdef CONFIG_BLK_DEV_ZONED
 static void f2fs_zone_write_end_io(struct bio *bio)
 {