mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Alex Dubov <[email protected]> Cc: Markus Lidel <[email protected]> Cc: Pierre Ossman <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
fb3ac7f6b8
commit
296b2f6ae6
7 changed files with 36 additions and 18 deletions
|
|
@ -931,7 +931,7 @@ static inline void unlock_fdc(void)
|
|||
del_timer(&fd_timeout);
|
||||
cont = NULL;
|
||||
clear_bit(0, &fdc_busy);
|
||||
if (elv_next_request(floppy_queue))
|
||||
if (current_req || elv_next_request(floppy_queue))
|
||||
do_fd_request(floppy_queue);
|
||||
spin_unlock_irqrestore(&floppy_lock, flags);
|
||||
wake_up(&fdc_wait);
|
||||
|
|
@ -2913,6 +2913,8 @@ static void redo_fd_request(void)
|
|||
|
||||
spin_lock_irq(floppy_queue->queue_lock);
|
||||
req = elv_next_request(floppy_queue);
|
||||
if (req)
|
||||
blkdev_dequeue_request(req);
|
||||
spin_unlock_irq(floppy_queue->queue_lock);
|
||||
if (!req) {
|
||||
do_floppy = NULL;
|
||||
|
|
|
|||
|
|
@ -301,22 +301,23 @@ static void do_blkif_request(struct request_queue *rq)
|
|||
|
||||
while ((req = elv_next_request(rq)) != NULL) {
|
||||
info = req->rq_disk->private_data;
|
||||
if (!blk_fs_request(req)) {
|
||||
__blk_end_request_cur(req, -EIO);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (RING_FULL(&info->ring))
|
||||
goto wait;
|
||||
|
||||
blkdev_dequeue_request(req);
|
||||
|
||||
if (!blk_fs_request(req)) {
|
||||
__blk_end_request_all(req, -EIO);
|
||||
continue;
|
||||
}
|
||||
|
||||
pr_debug("do_blk_req %p: cmd %p, sec %lx, "
|
||||
"(%u/%u) buffer:%p [%s]\n",
|
||||
req, req->cmd, (unsigned long)blk_rq_pos(req),
|
||||
blk_rq_cur_sectors(req), blk_rq_sectors(req),
|
||||
req->buffer, rq_data_dir(req) ? "write" : "read");
|
||||
|
||||
|
||||
blkdev_dequeue_request(req);
|
||||
if (blkif_queue_request(req)) {
|
||||
blk_requeue_request(rq, req);
|
||||
wait:
|
||||
|
|
|
|||
Loading…
Reference in a new issue