mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -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
|
|
@ -54,8 +54,11 @@ static int mmc_queue_thread(void *d)
|
|||
|
||||
spin_lock_irq(q->queue_lock);
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (!blk_queue_plugged(q))
|
||||
if (!blk_queue_plugged(q)) {
|
||||
req = elv_next_request(q);
|
||||
if (req)
|
||||
blkdev_dequeue_request(req);
|
||||
}
|
||||
mq->req = req;
|
||||
spin_unlock_irq(q->queue_lock);
|
||||
|
||||
|
|
@ -88,15 +91,12 @@ static void mmc_request(struct request_queue *q)
|
|||
{
|
||||
struct mmc_queue *mq = q->queuedata;
|
||||
struct request *req;
|
||||
int ret;
|
||||
|
||||
if (!mq) {
|
||||
printk(KERN_ERR "MMC: killing requests for dead queue\n");
|
||||
while ((req = elv_next_request(q)) != NULL) {
|
||||
do {
|
||||
ret = __blk_end_request(req, -EIO,
|
||||
blk_rq_cur_bytes(req));
|
||||
} while (ret);
|
||||
blkdev_dequeue_request(req);
|
||||
__blk_end_request_all(req, -EIO);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue