aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:43 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:43 -0400
commit89f78b3261f7e331e41753ea2459fbb9b60a6f7a (patch)
treef294393d4d4a1db653c5f0ce7b5504ff589e4a3b
parent6902a5331256e1b9f4cef95a1e3622252113b260 (diff)
ide: move rq->errors quirk out from ide_end_request()
Move rq->errors quirk out from ide_end_request() to its call sites. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-atapi.c7
-rw-r--r--drivers/ide/ide-cd.c3
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-eh.c5
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c5
-rw-r--r--drivers/ide/ide-tape.c2
7 files changed, 21 insertions, 5 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 5d57af29c4c8..5504a84e9bd6 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -405,8 +405,13 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
405 if (blk_special_request(rq)) { 405 if (blk_special_request(rq)) {
406 rq->errors = 0; 406 rq->errors = 0;
407 ide_complete_rq(drive, 0); 407 ide_complete_rq(drive, 0);
408 } else 408 } else {
409 if (blk_fs_request(rq) == 0 && uptodate <= 0) {
410 if (rq->errors == 0)
411 rq->errors = -EIO;
412 }
409 ide_end_request(drive, uptodate, 0); 413 ide_end_request(drive, uptodate, 0);
414 }
410 415
411 return ide_stopped; 416 return ide_stopped;
412 } 417 }
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index bbbebcbb1e3d..e4fa807fdcfa 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -295,6 +295,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
295 ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d", 295 ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d",
296 uptodate, nsectors); 296 uptodate, nsectors);
297 297
298 if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
299 rq->errors = -EIO;
300
298 ide_end_request(drive, uptodate, nsectors); 301 ide_end_request(drive, uptodate, nsectors);
299} 302}
300 303
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index dae9d988de10..ad9a3f54d21d 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -184,6 +184,8 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
184 184
185 if (!blk_fs_request(rq)) { 185 if (!blk_fs_request(rq)) {
186 blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command"); 186 blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
187 if (rq->errors == 0)
188 rq->errors = -EIO;
187 ide_end_request(drive, 0, 0); 189 ide_end_request(drive, 0, 0);
188 return ide_stopped; 190 return ide_stopped;
189 } 191 }
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index d1385d332e94..6ad419414f95 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -146,8 +146,11 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
146{ 146{
147 struct request *rq = drive->hwif->rq; 147 struct request *rq = drive->hwif->rq;
148 148
149 if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) 149 if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) {
150 if (err <= 0 && rq->errors == 0)
151 rq->errors = -EIO;
150 ide_end_request(drive, err ? err : 1, 0); 152 ide_end_request(drive, err ? err : 1, 0);
153 }
151} 154}
152 155
153/* needed below */ 156/* needed below */
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 407e4914dfd1..572aa9696dad 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -298,6 +298,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
298 return idefloppy_issue_pc(drive, pc); 298 return idefloppy_issue_pc(drive, pc);
299out_end: 299out_end:
300 drive->failed_pc = NULL; 300 drive->failed_pc = NULL;
301 if (blk_fs_request(rq) == 0 && rq->errors == 0)
302 rq->errors = -EIO;
301 ide_end_request(drive, 0, 0); 303 ide_end_request(drive, 0, 0);
302 return ide_stopped; 304 return ide_stopped;
303} 305}
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 4cc2bb13f1d6..28ac463dde1c 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -102,9 +102,6 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
102 if (blk_noretry_request(rq) && uptodate <= 0) 102 if (blk_noretry_request(rq) && uptodate <= 0)
103 nr_bytes = rq->hard_nr_sectors << 9; 103 nr_bytes = rq->hard_nr_sectors << 9;
104 104
105 if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
106 rq->errors = -EIO;
107
108 if (uptodate <= 0) 105 if (uptodate <= 0)
109 error = uptodate ? uptodate : -EIO; 106 error = uptodate ? uptodate : -EIO;
110 107
@@ -169,6 +166,8 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
169 } else { 166 } else {
170 if (media == ide_tape) 167 if (media == ide_tape)
171 rq->errors = IDE_DRV_ERROR_GENERAL; 168 rq->errors = IDE_DRV_ERROR_GENERAL;
169 else if (blk_fs_request(rq) == 0 && rq->errors == 0)
170 rq->errors = -EIO;
172 ide_end_request(drive, 0, 0); 171 ide_end_request(drive, 0, 0);
173 } 172 }
174} 173}
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3bfcd7290ce0..94f6fb8c147a 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -760,6 +760,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
760 /* We do not support buffer cache originated requests. */ 760 /* We do not support buffer cache originated requests. */
761 printk(KERN_NOTICE "ide-tape: %s: Unsupported request in " 761 printk(KERN_NOTICE "ide-tape: %s: Unsupported request in "
762 "request queue (%d)\n", drive->name, rq->cmd_type); 762 "request queue (%d)\n", drive->name, rq->cmd_type);
763 if (blk_fs_request(rq) == 0 && rq->errors == 0)
764 rq->errors = -EIO;
763 ide_end_request(drive, 0, 0); 765 ide_end_request(drive, 0, 0);
764 return ide_stopped; 766 return ide_stopped;
765 } 767 }