Commit 4d4d66ab authored by Tejun Heo's avatar Tejun Heo Committed by Alasdair G Kergon

dm: convert workqueues to alloc_ordered

Convert all create[_singlethread]_work() users to the new
alloc[_ordered]_workqueue().  This conversion is mechanical and
doesn't introduce any behavior change.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent f521f074
...@@ -352,7 +352,7 @@ static int __init dm_delay_init(void) ...@@ -352,7 +352,7 @@ static int __init dm_delay_init(void)
{ {
int r = -ENOMEM; int r = -ENOMEM;
kdelayd_wq = create_workqueue("kdelayd"); kdelayd_wq = alloc_workqueue("kdelayd", WQ_MEM_RECLAIM, 0);
if (!kdelayd_wq) { if (!kdelayd_wq) {
DMERR("Couldn't start kdelayd"); DMERR("Couldn't start kdelayd");
goto bad_queue; goto bad_queue;
......
...@@ -672,7 +672,7 @@ int dm_kcopyd_client_create(unsigned int nr_pages, ...@@ -672,7 +672,7 @@ int dm_kcopyd_client_create(unsigned int nr_pages,
goto bad_slab; goto bad_slab;
INIT_WORK(&kc->kcopyd_work, do_work); INIT_WORK(&kc->kcopyd_work, do_work);
kc->kcopyd_wq = create_singlethread_workqueue("kcopyd"); kc->kcopyd_wq = alloc_ordered_workqueue("kcopyd", WQ_MEM_RECLAIM);
if (!kc->kcopyd_wq) if (!kc->kcopyd_wq)
goto bad_workqueue; goto bad_workqueue;
......
...@@ -1675,7 +1675,7 @@ static int __init dm_multipath_init(void) ...@@ -1675,7 +1675,7 @@ static int __init dm_multipath_init(void)
return -EINVAL; return -EINVAL;
} }
kmultipathd = create_workqueue("kmpathd"); kmultipathd = alloc_workqueue("kmpathd", WQ_MEM_RECLAIM, 0);
if (!kmultipathd) { if (!kmultipathd) {
DMERR("failed to create workqueue kmpathd"); DMERR("failed to create workqueue kmpathd");
dm_unregister_target(&multipath_target); dm_unregister_target(&multipath_target);
...@@ -1689,7 +1689,8 @@ static int __init dm_multipath_init(void) ...@@ -1689,7 +1689,8 @@ static int __init dm_multipath_init(void)
* old workqueue would also create a bottleneck in the * old workqueue would also create a bottleneck in the
* path of the storage hardware device activation. * path of the storage hardware device activation.
*/ */
kmpath_handlerd = create_singlethread_workqueue("kmpath_handlerd"); kmpath_handlerd = alloc_ordered_workqueue("kmpath_handlerd",
WQ_MEM_RECLAIM);
if (!kmpath_handlerd) { if (!kmpath_handlerd) {
DMERR("failed to create workqueue kmpath_handlerd"); DMERR("failed to create workqueue kmpath_handlerd");
destroy_workqueue(kmultipathd); destroy_workqueue(kmultipathd);
......
...@@ -1085,7 +1085,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -1085,7 +1085,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
ti->num_flush_requests = 1; ti->num_flush_requests = 1;
ti->num_discard_requests = 1; ti->num_discard_requests = 1;
ms->kmirrord_wq = create_singlethread_workqueue("kmirrord"); ms->kmirrord_wq = alloc_ordered_workqueue("kmirrord", WQ_MEM_RECLAIM);
if (!ms->kmirrord_wq) { if (!ms->kmirrord_wq) {
DMERR("couldn't start kmirrord"); DMERR("couldn't start kmirrord");
r = -ENOMEM; r = -ENOMEM;
......
...@@ -818,7 +818,7 @@ static int persistent_ctr(struct dm_exception_store *store, ...@@ -818,7 +818,7 @@ static int persistent_ctr(struct dm_exception_store *store,
atomic_set(&ps->pending_count, 0); atomic_set(&ps->pending_count, 0);
ps->callbacks = NULL; ps->callbacks = NULL;
ps->metadata_wq = create_singlethread_workqueue("ksnaphd"); ps->metadata_wq = alloc_ordered_workqueue("ksnaphd", WQ_MEM_RECLAIM);
if (!ps->metadata_wq) { if (!ps->metadata_wq) {
kfree(ps); kfree(ps);
DMERR("couldn't start header metadata update thread"); DMERR("couldn't start header metadata update thread");
......
...@@ -1883,7 +1883,7 @@ static struct mapped_device *alloc_dev(int minor) ...@@ -1883,7 +1883,7 @@ static struct mapped_device *alloc_dev(int minor)
add_disk(md->disk); add_disk(md->disk);
format_dev_t(md->name, MKDEV(_major, minor)); format_dev_t(md->name, MKDEV(_major, minor));
md->wq = create_singlethread_workqueue("kdmflush"); md->wq = alloc_ordered_workqueue("kdmflush", WQ_MEM_RECLAIM);
if (!md->wq) if (!md->wq)
goto bad_thread; goto bad_thread;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment