aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index bcbaeb50bb93..8d50df4526a4 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -55,22 +55,9 @@
55#include <asm/io.h> 55#include <asm/io.h>
56#include <asm/bitops.h> 56#include <asm/bitops.h>
57 57
58void ide_softirq_done(struct request *rq)
59{
60 request_queue_t *q = rq->q;
61
62 add_disk_randomness(rq->rq_disk);
63 end_that_request_chunk(rq, 1, rq->data_len);
64
65 spin_lock_irq(q->queue_lock);
66 end_that_request_last(rq, 1);
67 spin_unlock_irq(q->queue_lock);
68}
69
70int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate, 58int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate,
71 int nr_sectors) 59 int nr_sectors)
72{ 60{
73 unsigned int nbytes;
74 int ret = 1; 61 int ret = 1;
75 62
76 BUG_ON(!(rq->flags & REQ_STARTED)); 63 BUG_ON(!(rq->flags & REQ_STARTED));
@@ -94,27 +81,12 @@ int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate,
94 HWGROUP(drive)->hwif->ide_dma_on(drive); 81 HWGROUP(drive)->hwif->ide_dma_on(drive);
95 } 82 }
96 83
97 /* 84 if (!end_that_request_first(rq, uptodate, nr_sectors)) {
98 * For partial completions (or non fs/pc requests), use the regular 85 add_disk_randomness(rq->rq_disk);
99 * direct completion path. Same thing for requests that failed, to
100 * preserve the ->errors value we use the normal completion path
101 * for those
102 */
103 nbytes = nr_sectors << 9;
104 if (!rq->errors && rq_all_done(rq, nbytes)) {
105 rq->data_len = nbytes;
106 blkdev_dequeue_request(rq); 86 blkdev_dequeue_request(rq);
107 HWGROUP(drive)->rq = NULL; 87 HWGROUP(drive)->rq = NULL;
108 blk_complete_request(rq); 88 end_that_request_last(rq, uptodate);
109 ret = 0; 89 ret = 0;
110 } else {
111 if (!end_that_request_first(rq, uptodate, nr_sectors)) {
112 add_disk_randomness(rq->rq_disk);
113 blkdev_dequeue_request(rq);
114 HWGROUP(drive)->rq = NULL;
115 end_that_request_last(rq, uptodate);
116 ret = 0;
117 }
118 } 90 }
119 91
120 return ret; 92 return ret;