]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: move rq->errors quirk out from ide_end_request()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:43 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:43 +0000 (12:46 +0100)
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>
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-eh.c
drivers/ide/ide-floppy.c
drivers/ide/ide-io.c
drivers/ide/ide-tape.c

index 5d57af29c4c87410682c51860f06fa0ceae97937..5504a84e9bd6d99694d9f10eedc47663f7af84f3 100644 (file)
@@ -405,8 +405,13 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
                if (blk_special_request(rq)) {
                        rq->errors = 0;
                        ide_complete_rq(drive, 0);
-               } else
+               } else {
+                       if (blk_fs_request(rq) == 0 && uptodate <= 0) {
+                               if (rq->errors == 0)
+                                       rq->errors = -EIO;
+                       }
                        ide_end_request(drive, uptodate, 0);
+               }
 
                return ide_stopped;
        }
index bbbebcbb1e3dd3f1fe44ace287253ebd5147a5ed..e4fa807fdcfad1c2960325a57dc50b4dd54c7fdc 100644 (file)
@@ -295,6 +295,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
        ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d",
                                    uptodate, nsectors);
 
+       if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
+               rq->errors = -EIO;
+
        ide_end_request(drive, uptodate, nsectors);
 }
 
index dae9d988de10c142e03c48e031e80397fb687b5f..ad9a3f54d21dd267405a6571b0213adb4c86c805 100644 (file)
@@ -184,6 +184,8 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
 
        if (!blk_fs_request(rq)) {
                blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
+               if (rq->errors == 0)
+                       rq->errors = -EIO;
                ide_end_request(drive, 0, 0);
                return ide_stopped;
        }
index d1385d332e94501d2e13677b15c902916c24b66f..6ad419414f95506feec1982104181cd5e3b590d1 100644 (file)
@@ -146,8 +146,11 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
 {
        struct request *rq = drive->hwif->rq;
 
-       if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET)
+       if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) {
+               if (err <= 0 && rq->errors == 0)
+                       rq->errors = -EIO;
                ide_end_request(drive, err ? err : 1, 0);
+       }
 }
 
 /* needed below */
index 407e4914dfd1d601aa76ce2c5170b6f693560b09..572aa9696daded9ace53b175f53619853915d0b1 100644 (file)
@@ -298,6 +298,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
        return idefloppy_issue_pc(drive, pc);
 out_end:
        drive->failed_pc = NULL;
+       if (blk_fs_request(rq) == 0 && rq->errors == 0)
+               rq->errors = -EIO;
        ide_end_request(drive, 0, 0);
        return ide_stopped;
 }
index 4cc2bb13f1d60f07b6e06a82400d7f5f2ccbcb21..28ac463dde1c8bb0ccf47baade9b17ca4be003db 100644 (file)
@@ -102,9 +102,6 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
        if (blk_noretry_request(rq) && uptodate <= 0)
                nr_bytes = rq->hard_nr_sectors << 9;
 
-       if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
-               rq->errors = -EIO;
-
        if (uptodate <= 0)
                error = uptodate ? uptodate : -EIO;
 
@@ -169,6 +166,8 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq)
        } else {
                if (media == ide_tape)
                        rq->errors = IDE_DRV_ERROR_GENERAL;
+               else if (blk_fs_request(rq) == 0 && rq->errors == 0)
+                       rq->errors = -EIO;
                ide_end_request(drive, 0, 0);
        }
 }
index 3bfcd7290ce01a080cc837450ef35ffc1b07f75a..94f6fb8c147a894bc1144d6e25f6d3aadffe6aa3 100644 (file)
@@ -760,6 +760,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
                /* We do not support buffer cache originated requests. */
                printk(KERN_NOTICE "ide-tape: %s: Unsupported request in "
                        "request queue (%d)\n", drive->name, rq->cmd_type);
+               if (blk_fs_request(rq) == 0 && rq->errors == 0)
+                       rq->errors = -EIO;
                ide_end_request(drive, 0, 0);
                return ide_stopped;
        }