The block layer needs the ability to queue unplug work so that it will execute on a CPU other than the current one. --- include/linux/workqueue.h | 4 +++- kernel/workqueue.c | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff -puN kernel/workqueue.c~queue_work_on_cpu kernel/workqueue.c --- 25/kernel/workqueue.c~queue_work_on_cpu 2004-03-02 03:52:16.000000000 -0800 +++ 25-akpm/kernel/workqueue.c 2004-03-02 03:56:29.000000000 -0800 @@ -94,18 +94,29 @@ static void __queue_work(struct cpu_work * We queue the work to the CPU it was submitted, but there is no * guarantee that it will be processed by that CPU. */ -int fastcall queue_work(struct workqueue_struct *wq, struct work_struct *work) +int queue_work_on_cpu(struct workqueue_struct *wq, + struct work_struct *work, int cpu) { - int ret = 0, cpu = get_cpu(); + int ret = 0; if (!test_and_set_bit(0, &work->pending)) { BUG_ON(!list_empty(&work->entry)); __queue_work(wq->cpu_wq + cpu, work); ret = 1; } + return ret; +} +EXPORT_SYMBOL_GPL(queue_work); + +int queue_work(struct workqueue_struct *wq, struct work_struct *work) +{ + int ret; + + ret = queue_work_on_cpu(wq, work, get_cpu()); put_cpu(); return ret; } +EXPORT_SYMBOL_GPL(queue_work_on_cpu); static void delayed_work_timer_fn(unsigned long __data) { @@ -449,7 +460,6 @@ void init_workqueues(void) } EXPORT_SYMBOL_GPL(create_workqueue); -EXPORT_SYMBOL_GPL(queue_work); EXPORT_SYMBOL_GPL(queue_delayed_work); EXPORT_SYMBOL_GPL(flush_workqueue); EXPORT_SYMBOL_GPL(destroy_workqueue); diff -puN include/linux/workqueue.h~queue_work_on_cpu include/linux/workqueue.h --- 25/include/linux/workqueue.h~queue_work_on_cpu 2004-03-02 03:52:16.000000000 -0800 +++ 25-akpm/include/linux/workqueue.h 2004-03-02 03:55:33.000000000 -0800 @@ -52,7 +52,9 @@ struct work_struct { extern struct workqueue_struct *create_workqueue(const char *name); extern void destroy_workqueue(struct workqueue_struct *wq); -extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); +int queue_work(struct workqueue_struct *wq, struct work_struct *work); +int queue_work_on_cpu(struct workqueue_struct *wq, + struct work_struct *work, int cpu); extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay)); extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); _