aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index f9daffd7d0e3..e88a2cf17711 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -190,7 +190,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq)
190 190
191 BUG_ON(sense_len > sizeof(*sense)); 191 BUG_ON(sense_len > sizeof(*sense));
192 192
193 if (blk_sense_request(rq) || drive->sense_rq_armed) 193 if (rq->cmd_type == REQ_TYPE_SENSE || drive->sense_rq_armed)
194 return; 194 return;
195 195
196 memset(sense, 0, sizeof(*sense)); 196 memset(sense, 0, sizeof(*sense));
@@ -307,13 +307,16 @@ EXPORT_SYMBOL_GPL(ide_cd_expiry);
307 307
308int ide_cd_get_xferlen(struct request *rq) 308int ide_cd_get_xferlen(struct request *rq)
309{ 309{
310 if (blk_fs_request(rq)) 310 switch (rq->cmd_type) {
311 case REQ_TYPE_FS:
311 return 32768; 312 return 32768;
312 else if (blk_sense_request(rq) || blk_pc_request(rq) || 313 case REQ_TYPE_SENSE:
313 rq->cmd_type == REQ_TYPE_ATA_PC) 314 case REQ_TYPE_BLOCK_PC:
315 case REQ_TYPE_ATA_PC:
314 return blk_rq_bytes(rq); 316 return blk_rq_bytes(rq);
315 else 317 default:
316 return 0; 318 return 0;
319 }
317} 320}
318EXPORT_SYMBOL_GPL(ide_cd_get_xferlen); 321EXPORT_SYMBOL_GPL(ide_cd_get_xferlen);
319 322
@@ -474,12 +477,12 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
474 if (uptodate == 0) 477 if (uptodate == 0)
475 drive->failed_pc = NULL; 478 drive->failed_pc = NULL;
476 479
477 if (blk_special_request(rq)) { 480 if (rq->cmd_type == REQ_TYPE_SPECIAL) {
478 rq->errors = 0; 481 rq->errors = 0;
479 error = 0; 482 error = 0;
480 } else { 483 } else {
481 484
482 if (blk_fs_request(rq) == 0 && uptodate <= 0) { 485 if (rq->cmd_type != REQ_TYPE_FS && uptodate <= 0) {
483 if (rq->errors == 0) 486 if (rq->errors == 0)
484 rq->errors = -EIO; 487 rq->errors = -EIO;
485 } 488 }