ide-cd: use ide_end_rq() also for failed non-fs requests

Use ide_end_rq() also for failed non-fs requests on completion
of REQUEST SENSE requests + use blk_rq_bytes() while at it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Bartlomiej Zolnierkiewicz 2009-03-31 20:15:00 +02:00
parent 116e690f4e
commit bf12a9c1c9
1 changed files with 4 additions and 12 deletions

View File

@ -265,18 +265,10 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
failed->sense_len = rq->sense_len; failed->sense_len = rq->sense_len;
} }
cdrom_analyze_sense_data(drive, failed, sense); cdrom_analyze_sense_data(drive, failed, sense);
/*
* now end the failed request if (ide_end_rq(drive, failed, -EIO,
*/ blk_rq_bytes(failed)))
if (blk_fs_request(failed)) { BUG();
if (ide_end_rq(drive, failed, -EIO,
failed->hard_nr_sectors << 9))
BUG();
} else {
if (blk_end_request(failed, -EIO,
failed->data_len))
BUG();
}
} else } else
cdrom_analyze_sense_data(drive, NULL, sense); cdrom_analyze_sense_data(drive, NULL, sense);
} }