diff options
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index fb6795236e76..3436b1f104eb 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -59,7 +59,7 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq, | |||
59 | { | 59 | { |
60 | int ret = 1; | 60 | int ret = 1; |
61 | 61 | ||
62 | BUG_ON(!(rq->flags & REQ_STARTED)); | 62 | BUG_ON(!blk_rq_started(rq)); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * if failfast is set on a request, override number of sectors and | 65 | * if failfast is set on a request, override number of sectors and |
@@ -244,7 +244,7 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | |||
244 | 244 | ||
245 | spin_lock_irqsave(&ide_lock, flags); | 245 | spin_lock_irqsave(&ide_lock, flags); |
246 | 246 | ||
247 | BUG_ON(!(rq->flags & REQ_STARTED)); | 247 | BUG_ON(!blk_rq_started(rq)); |
248 | 248 | ||
249 | /* | 249 | /* |
250 | * if failfast is set on a request, override number of sectors and | 250 | * if failfast is set on a request, override number of sectors and |
@@ -366,7 +366,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
366 | rq = HWGROUP(drive)->rq; | 366 | rq = HWGROUP(drive)->rq; |
367 | spin_unlock_irqrestore(&ide_lock, flags); | 367 | spin_unlock_irqrestore(&ide_lock, flags); |
368 | 368 | ||
369 | if (rq->flags & REQ_DRIVE_CMD) { | 369 | if (rq->cmd_type == REQ_TYPE_ATA_CMD) { |
370 | u8 *args = (u8 *) rq->buffer; | 370 | u8 *args = (u8 *) rq->buffer; |
371 | if (rq->errors == 0) | 371 | if (rq->errors == 0) |
372 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 372 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -376,7 +376,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
376 | args[1] = err; | 376 | args[1] = err; |
377 | args[2] = hwif->INB(IDE_NSECTOR_REG); | 377 | args[2] = hwif->INB(IDE_NSECTOR_REG); |
378 | } | 378 | } |
379 | } else if (rq->flags & REQ_DRIVE_TASK) { | 379 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { |
380 | u8 *args = (u8 *) rq->buffer; | 380 | u8 *args = (u8 *) rq->buffer; |
381 | if (rq->errors == 0) | 381 | if (rq->errors == 0) |
382 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 382 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -390,7 +390,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) | |||
390 | args[5] = hwif->INB(IDE_HCYL_REG); | 390 | args[5] = hwif->INB(IDE_HCYL_REG); |
391 | args[6] = hwif->INB(IDE_SELECT_REG); | 391 | args[6] = hwif->INB(IDE_SELECT_REG); |
392 | } | 392 | } |
393 | } else if (rq->flags & REQ_DRIVE_TASKFILE) { | 393 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
394 | ide_task_t *args = (ide_task_t *) rq->special; | 394 | ide_task_t *args = (ide_task_t *) rq->special; |
395 | if (rq->errors == 0) | 395 | if (rq->errors == 0) |
396 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); | 396 | rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); |
@@ -587,7 +587,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat) | |||
587 | return ide_stopped; | 587 | return ide_stopped; |
588 | 588 | ||
589 | /* retry only "normal" I/O: */ | 589 | /* retry only "normal" I/O: */ |
590 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) { | 590 | if (!blk_fs_request(rq)) { |
591 | rq->errors = 1; | 591 | rq->errors = 1; |
592 | ide_end_drive_cmd(drive, stat, err); | 592 | ide_end_drive_cmd(drive, stat, err); |
593 | return ide_stopped; | 593 | return ide_stopped; |
@@ -638,7 +638,7 @@ ide_startstop_t ide_abort(ide_drive_t *drive, const char *msg) | |||
638 | return ide_stopped; | 638 | return ide_stopped; |
639 | 639 | ||
640 | /* retry only "normal" I/O: */ | 640 | /* retry only "normal" I/O: */ |
641 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) { | 641 | if (!blk_fs_request(rq)) { |
642 | rq->errors = 1; | 642 | rq->errors = 1; |
643 | ide_end_drive_cmd(drive, BUSY_STAT, 0); | 643 | ide_end_drive_cmd(drive, BUSY_STAT, 0); |
644 | return ide_stopped; | 644 | return ide_stopped; |
@@ -808,7 +808,7 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq) | |||
808 | if (hwif->sg_mapped) /* needed by ide-scsi */ | 808 | if (hwif->sg_mapped) /* needed by ide-scsi */ |
809 | return; | 809 | return; |
810 | 810 | ||
811 | if ((rq->flags & REQ_DRIVE_TASKFILE) == 0) { | 811 | if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) { |
812 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | 812 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); |
813 | } else { | 813 | } else { |
814 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | 814 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); |
@@ -844,7 +844,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
844 | struct request *rq) | 844 | struct request *rq) |
845 | { | 845 | { |
846 | ide_hwif_t *hwif = HWIF(drive); | 846 | ide_hwif_t *hwif = HWIF(drive); |
847 | if (rq->flags & REQ_DRIVE_TASKFILE) { | 847 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
848 | ide_task_t *args = rq->special; | 848 | ide_task_t *args = rq->special; |
849 | 849 | ||
850 | if (!args) | 850 | if (!args) |
@@ -866,7 +866,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
866 | if (args->tf_out_flags.all != 0) | 866 | if (args->tf_out_flags.all != 0) |
867 | return flagged_taskfile(drive, args); | 867 | return flagged_taskfile(drive, args); |
868 | return do_rw_taskfile(drive, args); | 868 | return do_rw_taskfile(drive, args); |
869 | } else if (rq->flags & REQ_DRIVE_TASK) { | 869 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { |
870 | u8 *args = rq->buffer; | 870 | u8 *args = rq->buffer; |
871 | u8 sel; | 871 | u8 sel; |
872 | 872 | ||
@@ -892,7 +892,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
892 | hwif->OUTB(sel, IDE_SELECT_REG); | 892 | hwif->OUTB(sel, IDE_SELECT_REG); |
893 | ide_cmd(drive, args[0], args[2], &drive_cmd_intr); | 893 | ide_cmd(drive, args[0], args[2], &drive_cmd_intr); |
894 | return ide_started; | 894 | return ide_started; |
895 | } else if (rq->flags & REQ_DRIVE_CMD) { | 895 | } else if (rq->cmd_type == REQ_TYPE_ATA_CMD) { |
896 | u8 *args = rq->buffer; | 896 | u8 *args = rq->buffer; |
897 | 897 | ||
898 | if (!args) | 898 | if (!args) |
@@ -980,7 +980,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
980 | ide_startstop_t startstop; | 980 | ide_startstop_t startstop; |
981 | sector_t block; | 981 | sector_t block; |
982 | 982 | ||
983 | BUG_ON(!(rq->flags & REQ_STARTED)); | 983 | BUG_ON(!blk_rq_started(rq)); |
984 | 984 | ||
985 | #ifdef DEBUG | 985 | #ifdef DEBUG |
986 | printk("%s: start_request: current=0x%08lx\n", | 986 | printk("%s: start_request: current=0x%08lx\n", |
@@ -1013,9 +1013,9 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
1013 | if (!drive->special.all) { | 1013 | if (!drive->special.all) { |
1014 | ide_driver_t *drv; | 1014 | ide_driver_t *drv; |
1015 | 1015 | ||
1016 | if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK)) | 1016 | if (rq->cmd_type == REQ_TYPE_ATA_CMD || |
1017 | return execute_drive_cmd(drive, rq); | 1017 | rq->cmd_type == REQ_TYPE_ATA_TASK || |
1018 | else if (rq->flags & REQ_DRIVE_TASKFILE) | 1018 | rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
1019 | return execute_drive_cmd(drive, rq); | 1019 | return execute_drive_cmd(drive, rq); |
1020 | else if (blk_pm_request(rq)) { | 1020 | else if (blk_pm_request(rq)) { |
1021 | struct request_pm_state *pm = rq->end_io_data; | 1021 | struct request_pm_state *pm = rq->end_io_data; |
@@ -1264,7 +1264,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) | |||
1264 | * We count how many times we loop here to make sure we service | 1264 | * We count how many times we loop here to make sure we service |
1265 | * all drives in the hwgroup without looping for ever | 1265 | * all drives in the hwgroup without looping for ever |
1266 | */ | 1266 | */ |
1267 | if (drive->blocked && !blk_pm_request(rq) && !(rq->flags & REQ_PREEMPT)) { | 1267 | if (drive->blocked && !blk_pm_request(rq) && !(rq->cmd_flags & REQ_PREEMPT)) { |
1268 | drive = drive->next ? drive->next : hwgroup->drive; | 1268 | drive = drive->next ? drive->next : hwgroup->drive; |
1269 | if (loops++ < 4 && !blk_queue_plugged(drive->queue)) | 1269 | if (loops++ < 4 && !blk_queue_plugged(drive->queue)) |
1270 | goto again; | 1270 | goto again; |
@@ -1670,7 +1670,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs) | |||
1670 | void ide_init_drive_cmd (struct request *rq) | 1670 | void ide_init_drive_cmd (struct request *rq) |
1671 | { | 1671 | { |
1672 | memset(rq, 0, sizeof(*rq)); | 1672 | memset(rq, 0, sizeof(*rq)); |
1673 | rq->flags = REQ_DRIVE_CMD; | 1673 | rq->cmd_type = REQ_TYPE_ATA_CMD; |
1674 | rq->ref_count = 1; | 1674 | rq->ref_count = 1; |
1675 | } | 1675 | } |
1676 | 1676 | ||
@@ -1727,7 +1727,7 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio | |||
1727 | hwgroup->rq = NULL; | 1727 | hwgroup->rq = NULL; |
1728 | if (action == ide_preempt || action == ide_head_wait) { | 1728 | if (action == ide_preempt || action == ide_head_wait) { |
1729 | where = ELEVATOR_INSERT_FRONT; | 1729 | where = ELEVATOR_INSERT_FRONT; |
1730 | rq->flags |= REQ_PREEMPT; | 1730 | rq->cmd_flags |= REQ_PREEMPT; |
1731 | } | 1731 | } |
1732 | __elv_add_request(drive->queue, rq, where, 0); | 1732 | __elv_add_request(drive->queue, rq, where, 0); |
1733 | ide_do_request(hwgroup, IDE_NO_IRQ); | 1733 | ide_do_request(hwgroup, IDE_NO_IRQ); |