From: Bart Van Assche Date: Wed, 10 Jun 2026 19:34:18 +0000 (-0700) Subject: f2fs: Rename f2fs_post_read_wq into f2fs_wq X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ba36a9ea81c018c828138e8071c3658620e2f0f;p=thirdparty%2Flinux.git f2fs: Rename f2fs_post_read_wq into f2fs_wq Rename f2fs_post_read_wq into f2fs_wq. Create it unconditionally. Prepare for using this workqueue for completing write bios. Reviewed-by: Chao Yu Signed-off-by: Bart Van Assche Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index caf522d667d61..372e07c58e21a 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -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); } } } diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9bddc8bf0af6e..64250e6a94d10 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -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) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 086bc52439794..8f3e632f315cc 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -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; /* diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index b277807c81850..438616597e53e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -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);