diff options
Diffstat (limited to 'block/blk-core.c')
| -rw-r--r-- | block/blk-core.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 2f4002f79a2..518dd423a5f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -352,7 +352,7 @@ void blk_start_queue(struct request_queue *q) | |||
| 352 | WARN_ON(!irqs_disabled()); | 352 | WARN_ON(!irqs_disabled()); |
| 353 | 353 | ||
| 354 | queue_flag_clear(QUEUE_FLAG_STOPPED, q); | 354 | queue_flag_clear(QUEUE_FLAG_STOPPED, q); |
| 355 | __blk_run_queue(q); | 355 | __blk_run_queue(q, false); |
| 356 | } | 356 | } |
| 357 | EXPORT_SYMBOL(blk_start_queue); | 357 | EXPORT_SYMBOL(blk_start_queue); |
| 358 | 358 | ||
| @@ -403,13 +403,14 @@ EXPORT_SYMBOL(blk_sync_queue); | |||
| 403 | /** | 403 | /** |
| 404 | * __blk_run_queue - run a single device queue | 404 | * __blk_run_queue - run a single device queue |
| 405 | * @q: The queue to run | 405 | * @q: The queue to run |
| 406 | * @force_kblockd: Don't run @q->request_fn directly. Use kblockd. | ||
| 406 | * | 407 | * |
| 407 | * Description: | 408 | * Description: |
| 408 | * See @blk_run_queue. This variant must be called with the queue lock | 409 | * See @blk_run_queue. This variant must be called with the queue lock |
| 409 | * held and interrupts disabled. | 410 | * held and interrupts disabled. |
| 410 | * | 411 | * |
| 411 | */ | 412 | */ |
| 412 | void __blk_run_queue(struct request_queue *q) | 413 | void __blk_run_queue(struct request_queue *q, bool force_kblockd) |
| 413 | { | 414 | { |
| 414 | blk_remove_plug(q); | 415 | blk_remove_plug(q); |
| 415 | 416 | ||
| @@ -423,7 +424,7 @@ void __blk_run_queue(struct request_queue *q) | |||
| 423 | * Only recurse once to avoid overrunning the stack, let the unplug | 424 | * Only recurse once to avoid overrunning the stack, let the unplug |
| 424 | * handling reinvoke the handler shortly if we already got there. | 425 | * handling reinvoke the handler shortly if we already got there. |
| 425 | */ | 426 | */ |
| 426 | if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) { | 427 | if (!force_kblockd && !queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) { |
| 427 | q->request_fn(q); | 428 | q->request_fn(q); |
| 428 | queue_flag_clear(QUEUE_FLAG_REENTER, q); | 429 | queue_flag_clear(QUEUE_FLAG_REENTER, q); |
| 429 | } else { | 430 | } else { |
| @@ -446,7 +447,7 @@ void blk_run_queue(struct request_queue *q) | |||
| 446 | unsigned long flags; | 447 | unsigned long flags; |
| 447 | 448 | ||
| 448 | spin_lock_irqsave(q->queue_lock, flags); | 449 | spin_lock_irqsave(q->queue_lock, flags); |
| 449 | __blk_run_queue(q); | 450 | __blk_run_queue(q, false); |
| 450 | spin_unlock_irqrestore(q->queue_lock, flags); | 451 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 451 | } | 452 | } |
| 452 | EXPORT_SYMBOL(blk_run_queue); | 453 | EXPORT_SYMBOL(blk_run_queue); |
| @@ -1053,7 +1054,7 @@ void blk_insert_request(struct request_queue *q, struct request *rq, | |||
| 1053 | 1054 | ||
| 1054 | drive_stat_acct(rq, 1); | 1055 | drive_stat_acct(rq, 1); |
| 1055 | __elv_add_request(q, rq, where, 0); | 1056 | __elv_add_request(q, rq, where, 0); |
| 1056 | __blk_run_queue(q); | 1057 | __blk_run_queue(q, false); |
| 1057 | spin_unlock_irqrestore(q->queue_lock, flags); | 1058 | spin_unlock_irqrestore(q->queue_lock, flags); |
| 1058 | } | 1059 | } |
| 1059 | EXPORT_SYMBOL(blk_insert_request); | 1060 | EXPORT_SYMBOL(blk_insert_request); |
| @@ -2610,13 +2611,6 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) | |||
| 2610 | } | 2611 | } |
| 2611 | EXPORT_SYMBOL(kblockd_schedule_work); | 2612 | EXPORT_SYMBOL(kblockd_schedule_work); |
| 2612 | 2613 | ||
| 2613 | int kblockd_schedule_delayed_work(struct request_queue *q, | ||
| 2614 | struct delayed_work *dwork, unsigned long delay) | ||
| 2615 | { | ||
| 2616 | return queue_delayed_work(kblockd_workqueue, dwork, delay); | ||
| 2617 | } | ||
| 2618 | EXPORT_SYMBOL(kblockd_schedule_delayed_work); | ||
| 2619 | |||
| 2620 | int __init blk_dev_init(void) | 2614 | int __init blk_dev_init(void) |
| 2621 | { | 2615 | { |
| 2622 | BUILD_BUG_ON(__REQ_NR_BITS > 8 * | 2616 | BUILD_BUG_ON(__REQ_NR_BITS > 8 * |
