[dm-devel] [Patch] dm-mpath.c: use schedule_work()
Joe Thornber
thornber at redhat.com
Tue Mar 2 04:49:01 UTC 2004
dm-mpath.c: Use schedule_work() rather than queue_work(). Having our
own thread for mpath seems like overkill.
--- diff/drivers/md/dm-mpath.c 2004-03-01 16:18:32.000000000 +0000
+++ source/drivers/md/dm-mpath.c 2004-03-02 09:48:20.000000000 +0000
@@ -199,8 +199,6 @@ static void free_multipath(struct multip
/*-----------------------------------------------------------------
* The multipath daemon is responsible for resubmitting failed ios.
*---------------------------------------------------------------*/
-static struct workqueue_struct *_kmpathd_wq;
-
static int __choose_path(struct multipath *m)
{
struct priority_group *pg;
@@ -533,7 +531,7 @@ static void fail_path(struct path *path)
path->has_failed = 1;
path->pg->ps->type->fail_path(path->pg->ps, path);
- queue_work(_kmpathd_wq, &m->trigger_event);
+ schedule_work(&m->trigger_event);
spin_lock(&m->lock);
m->nr_valid_paths--;
@@ -574,7 +572,7 @@ static int do_end_io(struct multipath *m
bio_list_add(&m->failed_ios, bio);
spin_unlock(&m->lock);
- queue_work(_kmpathd_wq, &m->dispatch_failed);
+ schedule_work(&m->dispatch_failed);
return 1; /* io not complete */
}
@@ -693,15 +691,7 @@ int __init dm_multipath_init(void)
return r;
}
- _kmpathd_wq = create_workqueue("dm-mpath");
- if (!_kmpathd_wq) {
- /* FIXME: remove this */
- dm_unregister_path_selectors();
- dm_unregister_target(&multipath_target);
- kmem_cache_destroy(_details_cache);
- } else
- DMINFO("dm_multipath v0.2.0");
-
+ DMINFO("dm_multipath v0.2.0");
return r;
}
@@ -709,7 +699,6 @@ void __exit dm_multipath_exit(void)
{
int r;
- destroy_workqueue(_kmpathd_wq);
dm_unregister_path_selectors();
r = dm_unregister_target(&multipath_target);
if (r < 0)
More information about the dm-devel
mailing list