From: Bartlomiej Zolnierkiewicz Date: Fri, 19 Oct 2007 22:32:36 +0000 (+0200) Subject: ide: use __ide_end_request() in ide_end_dequeued_request() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bbc615b16d64643a3d22ab4890fde1a685e86d83;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ide: use __ide_end_request() in ide_end_dequeued_request() * Remove dead code for handling IDE TCQ from ide_end_dequeued_request(). * Add 'dequeue' parameter to __ide_end_request(). * Use __ide_end_request() in ide_end_dequeued_request(). Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index e2eb408a8a18..c89f0d3058e9 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -55,7 +55,7 @@ #include static int __ide_end_request(ide_drive_t *drive, struct request *rq, - int uptodate, unsigned int nr_bytes) + int uptodate, unsigned int nr_bytes, int dequeue) { int ret = 1; @@ -80,9 +80,11 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq, if (!end_that_request_chunk(rq, uptodate, nr_bytes)) { add_disk_randomness(rq->rq_disk); - if (!list_empty(&rq->queuelist)) - blkdev_dequeue_request(rq); - HWGROUP(drive)->rq = NULL; + if (dequeue) { + if (!list_empty(&rq->queuelist)) + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + } end_that_request_last(rq, uptodate); ret = 0; } @@ -122,7 +124,7 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors) nr_bytes = rq->hard_cur_sectors << 9; } - ret = __ide_end_request(drive, rq, uptodate, nr_bytes); + ret = __ide_end_request(drive, rq, uptodate, nr_bytes, 1); spin_unlock_irqrestore(&ide_lock, flags); return ret; @@ -255,39 +257,13 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, int uptodate, int nr_sectors) { unsigned long flags; - int ret = 1; + int ret; spin_lock_irqsave(&ide_lock, flags); - BUG_ON(!blk_rq_started(rq)); - - /* - * if failfast is set on a request, override number of sectors and - * complete the whole request right now - */ - if (blk_noretry_request(rq) && end_io_error(uptodate)) - nr_sectors = rq->hard_nr_sectors; - - if (!blk_fs_request(rq) && end_io_error(uptodate) && !rq->errors) - rq->errors = -EIO; - - /* - * decide whether to reenable DMA -- 3 is a random magic for now, - * if we DMA timeout more than 3 times, just stay in PIO - */ - if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { - drive->state = 0; - HWGROUP(drive)->hwif->ide_dma_on(drive); - } - - if (!end_that_request_first(rq, uptodate, nr_sectors)) { - add_disk_randomness(rq->rq_disk); - if (blk_rq_tagged(rq)) - blk_queue_end_tag(drive->queue, rq); - end_that_request_last(rq, uptodate); - ret = 0; - } + ret = __ide_end_request(drive, rq, uptodate, nr_sectors << 9, 0); spin_unlock_irqrestore(&ide_lock, flags); + return ret; } EXPORT_SYMBOL_GPL(ide_end_dequeued_request);