diff options
author | Tejun Heo <tj@kernel.org> | 2009-05-07 22:54:15 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-11 03:52:17 -0400 |
commit | 296b2f6ae654581adc27f0d6f0af454c7f3d06ee (patch) | |
tree | 8fab2b91741336d41e559a839b547d7ac3090524 /drivers/block/xen-blkfront.c | |
parent | fb3ac7f6b811eac8e0aafa3df1c16ed872e898a8 (diff) |
block: convert to dequeueing model (easy ones)
plat-omap/mailbox, floppy, viocd, mspro_block, i2o_block and
mmc/card/queue are already pretty close to dequeueing model and can be
converted with simple changes. Convert them.
While at it,
* xen-blkfront: !fs check moved downwards to share dequeue call with
normal path.
* mspro_block: __blk_end_request(..., blk_rq_cur_byte()) converted to
__blk_end_request_cur()
* mmc/card/queue: loop of __blk_end_request() converted to
__blk_end_request_all()
[ Impact: dequeue in-flight request ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r-- | drivers/block/xen-blkfront.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 91fc56597e9b..66f834571b88 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -301,22 +301,23 @@ static void do_blkif_request(struct request_queue *rq) | |||
301 | 301 | ||
302 | while ((req = elv_next_request(rq)) != NULL) { | 302 | while ((req = elv_next_request(rq)) != NULL) { |
303 | info = req->rq_disk->private_data; | 303 | info = req->rq_disk->private_data; |
304 | if (!blk_fs_request(req)) { | ||
305 | __blk_end_request_cur(req, -EIO); | ||
306 | continue; | ||
307 | } | ||
308 | 304 | ||
309 | if (RING_FULL(&info->ring)) | 305 | if (RING_FULL(&info->ring)) |
310 | goto wait; | 306 | goto wait; |
311 | 307 | ||
308 | blkdev_dequeue_request(req); | ||
309 | |||
310 | if (!blk_fs_request(req)) { | ||
311 | __blk_end_request_all(req, -EIO); | ||
312 | continue; | ||
313 | } | ||
314 | |||
312 | pr_debug("do_blk_req %p: cmd %p, sec %lx, " | 315 | pr_debug("do_blk_req %p: cmd %p, sec %lx, " |
313 | "(%u/%u) buffer:%p [%s]\n", | 316 | "(%u/%u) buffer:%p [%s]\n", |
314 | req, req->cmd, (unsigned long)blk_rq_pos(req), | 317 | req, req->cmd, (unsigned long)blk_rq_pos(req), |
315 | blk_rq_cur_sectors(req), blk_rq_sectors(req), | 318 | blk_rq_cur_sectors(req), blk_rq_sectors(req), |
316 | req->buffer, rq_data_dir(req) ? "write" : "read"); | 319 | req->buffer, rq_data_dir(req) ? "write" : "read"); |
317 | 320 | ||
318 | |||
319 | blkdev_dequeue_request(req); | ||
320 | if (blkif_queue_request(req)) { | 321 | if (blkif_queue_request(req)) { |
321 | blk_requeue_request(rq, req); | 322 | blk_requeue_request(rq, req); |
322 | wait: | 323 | wait: |