Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139408
b: refs/heads/master
c: 299c485
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Mar 31, 2009
1 parent 0463946 commit f155bf5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6041e8fba8b9a9a64bd7402be700b0f1247a9c55
refs/heads/master: 299c4852fc6995e0665d246927d25cefd4dad754
47 changes: 25 additions & 22 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,29 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0);
}

static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq)
{
/*
* For REQ_TYPE_SENSE, "rq->buffer" points to the original
* failed request
*/
struct request *failed = (struct request *)rq->buffer;
struct cdrom_info *info = drive->driver_data;
void *sense = &info->sense_data;

if (failed) {
if (failed->sense) {
sense = failed->sense;
failed->sense_len = rq->sense_len;
}
cdrom_analyze_sense_data(drive, failed, sense);

if (ide_end_rq(drive, failed, -EIO, blk_rq_bytes(failed)))
BUG();
} else
cdrom_analyze_sense_data(drive, NULL, sense);
}

static void cdrom_end_request(ide_drive_t *drive, int uptodate)
{
struct request *rq = drive->hwif->rq;
Expand All @@ -250,28 +273,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
ide_debug_log(IDE_DBG_FUNC, "cmd: 0x%x, uptodate: 0x%x, nsectors: %d",
rq->cmd[0], uptodate, nsectors);

if (blk_sense_request(rq) && uptodate) {
/*
* For REQ_TYPE_SENSE, "rq->buffer" points to the original
* failed request
*/
struct request *failed = (struct request *) rq->buffer;
struct cdrom_info *info = drive->driver_data;
void *sense = &info->sense_data;

if (failed) {
if (failed->sense) {
sense = failed->sense;
failed->sense_len = rq->sense_len;
}
cdrom_analyze_sense_data(drive, failed, sense);

if (ide_end_rq(drive, failed, -EIO,
blk_rq_bytes(failed)))
BUG();
} else
cdrom_analyze_sense_data(drive, NULL, sense);
}
if (blk_sense_request(rq) && uptodate)
ide_cd_complete_failed_rq(drive, rq);

if (!rq->current_nr_sectors && blk_fs_request(rq))
uptodate = 1;
Expand Down

0 comments on commit f155bf5

Please sign in to comment.