aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-23 07:27:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-26 02:57:16 -0400
commit5e955245d6cf49c5ed26c7add7392ff5a6762bf4 (patch)
tree9cf243dd76059d9d218170cde5998f5a334b6a36 /drivers/ide/ide-io.c
parent789547508f22e482825f52f813b59680408ec2c7 (diff)
ide: always kill the whole request on error
* Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_kill_rq() and ide_floppy_do_request() for failed requests. [ bugfix part ] * Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_do_devset() and ide_complete_drive_reset(). Then remove ide_rq_bytes(). [ cleanup part ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 95db5f03f6a2..d5f3c77beadd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -112,16 +112,6 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
112 } 112 }
113} 113}
114 114
115/* obsolete, blk_rq_bytes() should be used instead */
116unsigned int ide_rq_bytes(struct request *rq)
117{
118 if (blk_pc_request(rq))
119 return blk_rq_bytes(rq);
120 else
121 return blk_rq_cur_sectors(rq) << 9;
122}
123EXPORT_SYMBOL_GPL(ide_rq_bytes);
124
125int ide_complete_rq(ide_drive_t *drive, int error, unsigned int nr_bytes) 115int ide_complete_rq(ide_drive_t *drive, int error, unsigned int nr_bytes)
126{ 116{
127 ide_hwif_t *hwif = drive->hwif; 117 ide_hwif_t *hwif = drive->hwif;
@@ -152,14 +142,14 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
152 142
153 if ((media == ide_floppy || media == ide_tape) && drv_req) { 143 if ((media == ide_floppy || media == ide_tape) && drv_req) {
154 rq->errors = 0; 144 rq->errors = 0;
155 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
156 } else { 145 } else {
157 if (media == ide_tape) 146 if (media == ide_tape)
158 rq->errors = IDE_DRV_ERROR_GENERAL; 147 rq->errors = IDE_DRV_ERROR_GENERAL;
159 else if (blk_fs_request(rq) == 0 && rq->errors == 0) 148 else if (blk_fs_request(rq) == 0 && rq->errors == 0)
160 rq->errors = -EIO; 149 rq->errors = -EIO;
161 ide_complete_rq(drive, -EIO, ide_rq_bytes(rq));
162 } 150 }
151
152 ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
163} 153}
164 154
165static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) 155static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)