diff options
author | Jens Axboe <axboe@suse.de> | 2006-07-20 08:54:05 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:29:40 -0400 |
commit | dc72ef4ae35c2016fb594bcc85ce871376682174 (patch) | |
tree | c0c78879addf0d65adcc8f8cce01165fa2502dac /block/ll_rw_blk.c | |
parent | 981a79730d586335ef8f942c83bdf2b1de6d4e3d (diff) |
[PATCH] Add blk_start_queueing() helper
CFQ implements this on its own now, but it's really block layer
knowledge. Tells a device queue to start dispatching requests to
the driver, taking care to unplug if needed. Also fixes the issue
where as/cfq will invoke a stopped queue, which we really don't
want.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index c6dfa889206c..346be9ae31f6 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -2267,6 +2267,25 @@ struct request *blk_get_request(request_queue_t *q, int rw, gfp_t gfp_mask) | |||
2267 | EXPORT_SYMBOL(blk_get_request); | 2267 | EXPORT_SYMBOL(blk_get_request); |
2268 | 2268 | ||
2269 | /** | 2269 | /** |
2270 | * blk_start_queueing - initiate dispatch of requests to device | ||
2271 | * @q: request queue to kick into gear | ||
2272 | * | ||
2273 | * This is basically a helper to remove the need to know whether a queue | ||
2274 | * is plugged or not if someone just wants to initiate dispatch of requests | ||
2275 | * for this queue. | ||
2276 | * | ||
2277 | * The queue lock must be held with interrupts disabled. | ||
2278 | */ | ||
2279 | void blk_start_queueing(request_queue_t *q) | ||
2280 | { | ||
2281 | if (!blk_queue_plugged(q)) | ||
2282 | q->request_fn(q); | ||
2283 | else | ||
2284 | __generic_unplug_device(q); | ||
2285 | } | ||
2286 | EXPORT_SYMBOL(blk_start_queueing); | ||
2287 | |||
2288 | /** | ||
2270 | * blk_requeue_request - put a request back on queue | 2289 | * blk_requeue_request - put a request back on queue |
2271 | * @q: request queue where request should be inserted | 2290 | * @q: request queue where request should be inserted |
2272 | * @rq: request to be inserted | 2291 | * @rq: request to be inserted |
@@ -2333,11 +2352,7 @@ void blk_insert_request(request_queue_t *q, struct request *rq, | |||
2333 | 2352 | ||
2334 | drive_stat_acct(rq, rq->nr_sectors, 1); | 2353 | drive_stat_acct(rq, rq->nr_sectors, 1); |
2335 | __elv_add_request(q, rq, where, 0); | 2354 | __elv_add_request(q, rq, where, 0); |
2336 | 2355 | blk_start_queueing(q); | |
2337 | if (blk_queue_plugged(q)) | ||
2338 | __generic_unplug_device(q); | ||
2339 | else | ||
2340 | q->request_fn(q); | ||
2341 | spin_unlock_irqrestore(q->queue_lock, flags); | 2356 | spin_unlock_irqrestore(q->queue_lock, flags); |
2342 | } | 2357 | } |
2343 | 2358 | ||