Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71777
b: refs/heads/master
c: bbc615b
h: refs/heads/master
i:
  71775: 46ba10e
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent 2913bea commit 0664174
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bde07e5eab1351109007bf375349f295977e7f53
refs/heads/master: bbc615b16d64643a3d22ab4890fde1a685e86d83
44 changes: 10 additions & 34 deletions trunk/drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include <asm/io.h>

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;

Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0664174

Please sign in to comment.