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>
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);
}
}
}
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;
}
}
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)
/* 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
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;
/*
/* 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);
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;
}
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);