]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: Rename f2fs_post_read_wq into f2fs_wq
authorBart Van Assche <bvanassche@acm.org>
Wed, 10 Jun 2026 19:34:18 +0000 (12:34 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:37 +0000 (19:52 +0000)
Rename f2fs_post_read_wq into f2fs_wq. Create it unconditionally.
Prepare for using this workqueue for completing write bios.

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/compress.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/super.c

index caf522d667d613ec1cdbf0b1cdc04c2b3d4aef2d..372e07c58e21a53756aae671f2cb398738c12ef5 100644 (file)
@@ -1809,7 +1809,7 @@ static void f2fs_put_dic(struct decompress_io_ctx *dic, bool in_task)
                        f2fs_free_dic(dic, false);
                } else {
                        INIT_WORK(&dic->free_work, f2fs_late_free_dic);
-                       queue_work(dic->sbi->post_read_wq, &dic->free_work);
+                       queue_work(dic->sbi->wq, &dic->free_work);
                }
        }
 }
index 9bddc8bf0af6e2ac1d6664fa8597a1d6f6ea0c03..64250e6a94d107d9824409432c397fdc9217a910 100644 (file)
@@ -342,7 +342,7 @@ static void f2fs_read_end_io(struct bio *bio)
                        f2fs_handle_step_decompress(ctx, intask);
                } else if (enabled_steps) {
                        INIT_WORK(&ctx->work, f2fs_post_read_work);
-                       queue_work(ctx->sbi->post_read_wq, &ctx->work);
+                       queue_work(ctx->sbi->wq, &ctx->work);
                        return;
                }
        }
@@ -4527,23 +4527,17 @@ void f2fs_destroy_post_read_processing(void)
        kmem_cache_destroy(bio_post_read_ctx_cache);
 }
 
-int f2fs_init_post_read_wq(struct f2fs_sb_info *sbi)
+int f2fs_init_wq(struct f2fs_sb_info *sbi)
 {
-       if (!f2fs_sb_has_encrypt(sbi) &&
-               !f2fs_sb_has_verity(sbi) &&
-               !f2fs_sb_has_compression(sbi))
-               return 0;
-
-       sbi->post_read_wq = alloc_workqueue("f2fs_post_read_wq",
-                                                WQ_UNBOUND | WQ_HIGHPRI,
-                                                num_online_cpus());
-       return sbi->post_read_wq ? 0 : -ENOMEM;
+       sbi->wq = alloc_workqueue("f2fs_wq", WQ_UNBOUND | WQ_HIGHPRI,
+                                 num_online_cpus());
+       return sbi->wq ? 0 : -ENOMEM;
 }
 
-void f2fs_destroy_post_read_wq(struct f2fs_sb_info *sbi)
+void f2fs_destroy_wq(struct f2fs_sb_info *sbi)
 {
-       if (sbi->post_read_wq)
-               destroy_workqueue(sbi->post_read_wq);
+       if (sbi->wq)
+               destroy_workqueue(sbi->wq);
 }
 
 int __init f2fs_init_bio_entry_cache(void)
index 086bc5243979462b9972c8a79e6fe0bc4be99d18..8f3e632f315ccdfa233f7d29488fc743305bfc8c 100644 (file)
@@ -1979,7 +1979,7 @@ struct f2fs_sb_info {
        /* Precomputed FS UUID checksum for seeding other checksums */
        __u32 s_chksum_seed;
 
-       struct workqueue_struct *post_read_wq;  /* post read workqueue */
+       struct workqueue_struct *wq;            /* bio completion workqueue */
 
        /*
         * If we are in irq context, let's update error information into
@@ -4214,8 +4214,8 @@ bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len);
 void f2fs_clear_page_cache_dirty_tag(struct folio *folio);
 int f2fs_init_post_read_processing(void);
 void f2fs_destroy_post_read_processing(void);
-int f2fs_init_post_read_wq(struct f2fs_sb_info *sbi);
-void f2fs_destroy_post_read_wq(struct f2fs_sb_info *sbi);
+int f2fs_init_wq(struct f2fs_sb_info *sbi);
+void f2fs_destroy_wq(struct f2fs_sb_info *sbi);
 extern const struct iomap_ops f2fs_iomap_ops;
 
 /*
index b277807c81850549eb67b82072f4915d882f8992..438616597e53eb7e617cb8316a9c8f22a18b60df 100644 (file)
@@ -2075,7 +2075,7 @@ static void f2fs_put_super(struct super_block *sb)
        /* flush s_error_work before sbi destroy */
        flush_work(&sbi->s_error_work);
 
-       f2fs_destroy_post_read_wq(sbi);
+       f2fs_destroy_wq(sbi);
 
        kvfree(sbi->ckpt);
 
@@ -5189,9 +5189,9 @@ try_onemore:
                goto free_devices;
        }
 
-       err = f2fs_init_post_read_wq(sbi);
+       err = f2fs_init_wq(sbi);
        if (err) {
-               f2fs_err(sbi, "Failed to initialize post read workqueue");
+               f2fs_err(sbi, "Failed to create workqueue");
                goto free_devices;
        }
 
@@ -5478,7 +5478,7 @@ stop_ckpt_thread:
        f2fs_stop_ckpt_thread(sbi);
        /* flush s_error_work before sbi destroy */
        flush_work(&sbi->s_error_work);
-       f2fs_destroy_post_read_wq(sbi);
+       f2fs_destroy_wq(sbi);
 free_devices:
        destroy_device_list(sbi);
        kvfree(sbi->ckpt);