aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 9e79a485e4f3..c3df30cfb3fc 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -257,7 +257,6 @@ void __generic_unplug_device(struct request_queue *q)
257 257
258 q->request_fn(q); 258 q->request_fn(q);
259} 259}
260EXPORT_SYMBOL(__generic_unplug_device);
261 260
262/** 261/**
263 * generic_unplug_device - fire a request queue 262 * generic_unplug_device - fire a request queue
@@ -325,6 +324,9 @@ EXPORT_SYMBOL(blk_unplug);
325 324
326static void blk_invoke_request_fn(struct request_queue *q) 325static void blk_invoke_request_fn(struct request_queue *q)
327{ 326{
327 if (unlikely(blk_queue_stopped(q)))
328 return;
329
328 /* 330 /*
329 * one level of recursion is ok and is much faster than kicking 331 * one level of recursion is ok and is much faster than kicking
330 * the unplug handling 332 * the unplug handling
@@ -399,8 +401,13 @@ void blk_sync_queue(struct request_queue *q)
399EXPORT_SYMBOL(blk_sync_queue); 401EXPORT_SYMBOL(blk_sync_queue);
400 402
401/** 403/**
402 * blk_run_queue - run a single device queue 404 * __blk_run_queue - run a single device queue
403 * @q: The queue to run 405 * @q: The queue to run
406 *
407 * Description:
408 * See @blk_run_queue. This variant must be called with the queue lock
409 * held and interrupts disabled.
410 *
404 */ 411 */
405void __blk_run_queue(struct request_queue *q) 412void __blk_run_queue(struct request_queue *q)
406{ 413{
@@ -418,6 +425,12 @@ EXPORT_SYMBOL(__blk_run_queue);
418/** 425/**
419 * blk_run_queue - run a single device queue 426 * blk_run_queue - run a single device queue
420 * @q: The queue to run 427 * @q: The queue to run
428 *
429 * Description:
430 * Invoke request handling on this queue, if it has pending work to do.
431 * May be used to restart queueing when a request has completed. Also
432 * See @blk_start_queueing.
433 *
421 */ 434 */
422void blk_run_queue(struct request_queue *q) 435void blk_run_queue(struct request_queue *q)
423{ 436{
@@ -501,6 +514,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
501 init_timer(&q->unplug_timer); 514 init_timer(&q->unplug_timer);
502 setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); 515 setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
503 INIT_LIST_HEAD(&q->timeout_list); 516 INIT_LIST_HEAD(&q->timeout_list);
517 INIT_WORK(&q->unplug_work, blk_unplug_work);
504 518
505 kobject_init(&q->kobj, &blk_queue_ktype); 519 kobject_init(&q->kobj, &blk_queue_ktype);
506 520
@@ -884,7 +898,8 @@ EXPORT_SYMBOL(blk_get_request);
884 * 898 *
885 * This is basically a helper to remove the need to know whether a queue 899 * This is basically a helper to remove the need to know whether a queue
886 * is plugged or not if someone just wants to initiate dispatch of requests 900 * is plugged or not if someone just wants to initiate dispatch of requests
887 * for this queue. 901 * for this queue. Should be used to start queueing on a device outside
902 * of ->request_fn() context. Also see @blk_run_queue.
888 * 903 *
889 * The queue lock must be held with interrupts disabled. 904 * The queue lock must be held with interrupts disabled.
890 */ 905 */
@@ -1003,8 +1018,9 @@ static void part_round_stats_single(int cpu, struct hd_struct *part,
1003} 1018}
1004 1019
1005/** 1020/**
1006 * part_round_stats() - Round off the performance stats on a struct 1021 * part_round_stats() - Round off the performance stats on a struct disk_stats.
1007 * disk_stats. 1022 * @cpu: cpu number for stats access
1023 * @part: target partition
1008 * 1024 *
1009 * The average IO queue length and utilisation statistics are maintained 1025 * The average IO queue length and utilisation statistics are maintained
1010 * by observing the current state of the queue length and the amount of 1026 * by observing the current state of the queue length and the amount of