blk-mq: turn hctx->run_work into a regular work struct
[cascardo/linux.git] / block / blk-core.c
index 999442e..34ff808 100644 (file)
@@ -288,7 +288,7 @@ void blk_sync_queue(struct request_queue *q)
                int i;
 
                queue_for_each_hw_ctx(q, hctx, i) {
-                       cancel_delayed_work_sync(&hctx->run_work);
+                       cancel_work_sync(&hctx->run_work);
                        cancel_delayed_work_sync(&hctx->delay_work);
                }
        } else {
@@ -515,7 +515,9 @@ EXPORT_SYMBOL_GPL(blk_queue_bypass_end);
 
 void blk_set_queue_dying(struct request_queue *q)
 {
-       queue_flag_set_unlocked(QUEUE_FLAG_DYING, q);
+       spin_lock_irq(q->queue_lock);
+       queue_flag_set(QUEUE_FLAG_DYING, q);
+       spin_unlock_irq(q->queue_lock);
 
        if (q->mq_ops)
                blk_mq_wake_waiters(q);
@@ -3095,6 +3097,12 @@ int kblockd_schedule_work(struct work_struct *work)
 }
 EXPORT_SYMBOL(kblockd_schedule_work);
 
+int kblockd_schedule_work_on(int cpu, struct work_struct *work)
+{
+       return queue_work_on(cpu, kblockd_workqueue, work);
+}
+EXPORT_SYMBOL(kblockd_schedule_work_on);
+
 int kblockd_schedule_delayed_work(struct delayed_work *dwork,
                                  unsigned long delay)
 {