diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index c66333d8e48d..b2d0ac8b760e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2100,6 +2100,34 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq, | |||
2100 | rq->rq_disk = bio->bi_bdev->bd_disk; | 2100 | rq->rq_disk = bio->bi_bdev->bd_disk; |
2101 | } | 2101 | } |
2102 | 2102 | ||
2103 | /** | ||
2104 | * blk_lld_busy - Check if underlying low-level drivers of a device are busy | ||
2105 | * @q : the queue of the device being checked | ||
2106 | * | ||
2107 | * Description: | ||
2108 | * Check if underlying low-level drivers of a device are busy. | ||
2109 | * If the drivers want to export their busy state, they must set own | ||
2110 | * exporting function using blk_queue_lld_busy() first. | ||
2111 | * | ||
2112 | * Basically, this function is used only by request stacking drivers | ||
2113 | * to stop dispatching requests to underlying devices when underlying | ||
2114 | * devices are busy. This behavior helps more I/O merging on the queue | ||
2115 | * of the request stacking driver and prevents I/O throughput regression | ||
2116 | * on burst I/O load. | ||
2117 | * | ||
2118 | * Return: | ||
2119 | * 0 - Not busy (The request stacking driver should dispatch request) | ||
2120 | * 1 - Busy (The request stacking driver should stop dispatching request) | ||
2121 | */ | ||
2122 | int blk_lld_busy(struct request_queue *q) | ||
2123 | { | ||
2124 | if (q->lld_busy_fn) | ||
2125 | return q->lld_busy_fn(q); | ||
2126 | |||
2127 | return 0; | ||
2128 | } | ||
2129 | EXPORT_SYMBOL_GPL(blk_lld_busy); | ||
2130 | |||
2103 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) | 2131 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) |
2104 | { | 2132 | { |
2105 | return queue_work(kblockd_workqueue, work); | 2133 | return queue_work(kblockd_workqueue, work); |