diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:21:41 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:21:41 -0400 |
commit | e8a96aa71355edef9f40ce01459acf25c50cb78c (patch) | |
tree | bb9ffe53be3405e4df9e38c815999c77202b8a88 /drivers/ide | |
parent | 5d0cc8ae29b310ceb6516a6840ca22738aab7820 (diff) |
ide: set REQ_PREEMPT request flag in ide_do_drive_cmd() users
* Set REQ_PREEMPT request flag in ide_do_drive_cmd() users
for ide_preempt and ide_head_wait action types.
* Remove setting REQ_PREEMPT from ide_do_drive_cmd().
While at it:
* Set 'where' variable outside ide_lock.
This is a preparation for converting IDE to use blk_execute_rq().
There should be no functional changes caused by this patch.
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 7 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide.c | 1 |
5 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 68e7f19dc036..ff8815937d32 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -216,6 +216,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
216 | rq->data_len = 18; | 216 | rq->data_len = 18; |
217 | 217 | ||
218 | rq->cmd_type = REQ_TYPE_SENSE; | 218 | rq->cmd_type = REQ_TYPE_SENSE; |
219 | rq->cmd_flags |= REQ_PREEMPT; | ||
219 | 220 | ||
220 | /* NOTE! Save the failed command in "rq->buffer" */ | 221 | /* NOTE! Save the failed command in "rq->buffer" */ |
221 | rq->buffer = (void *) failed_command; | 222 | rq->buffer = (void *) failed_command; |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index f05fbc2bd7a8..7d75240c2e26 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -289,6 +289,7 @@ static void idefloppy_queue_pc_head(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
289 | ide_init_drive_cmd(rq); | 289 | ide_init_drive_cmd(rq); |
290 | rq->buffer = (char *) pc; | 290 | rq->buffer = (char *) pc; |
291 | rq->cmd_type = REQ_TYPE_SPECIAL; | 291 | rq->cmd_type = REQ_TYPE_SPECIAL; |
292 | rq->cmd_flags |= REQ_PREEMPT; | ||
292 | rq->rq_disk = floppy->disk; | 293 | rq->rq_disk = floppy->disk; |
293 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); | 294 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); |
294 | } | 295 | } |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 696525342e9a..5aed79ed4586 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1600,13 +1600,12 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio | |||
1600 | rq->end_io = blk_end_sync_rq; | 1600 | rq->end_io = blk_end_sync_rq; |
1601 | } | 1601 | } |
1602 | 1602 | ||
1603 | if (action == ide_preempt || action == ide_head_wait) | ||
1604 | where = ELEVATOR_INSERT_FRONT; | ||
1605 | |||
1603 | spin_lock_irqsave(&ide_lock, flags); | 1606 | spin_lock_irqsave(&ide_lock, flags); |
1604 | if (action == ide_preempt) | 1607 | if (action == ide_preempt) |
1605 | hwgroup->rq = NULL; | 1608 | hwgroup->rq = NULL; |
1606 | if (action == ide_preempt || action == ide_head_wait) { | ||
1607 | where = ELEVATOR_INSERT_FRONT; | ||
1608 | rq->cmd_flags |= REQ_PREEMPT; | ||
1609 | } | ||
1610 | __elv_add_request(drive->queue, rq, where, 0); | 1609 | __elv_add_request(drive->queue, rq, where, 0); |
1611 | ide_do_request(hwgroup, IDE_NO_IRQ); | 1610 | ide_do_request(hwgroup, IDE_NO_IRQ); |
1612 | spin_unlock_irqrestore(&ide_lock, flags); | 1611 | spin_unlock_irqrestore(&ide_lock, flags); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 1a96cc503994..d67a17891786 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -688,6 +688,7 @@ static void idetape_queue_pc_head(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
688 | struct ide_tape_obj *tape = drive->driver_data; | 688 | struct ide_tape_obj *tape = drive->driver_data; |
689 | 689 | ||
690 | idetape_init_rq(rq, REQ_IDETAPE_PC1); | 690 | idetape_init_rq(rq, REQ_IDETAPE_PC1); |
691 | rq->cmd_flags |= REQ_PREEMPT; | ||
691 | rq->buffer = (char *) pc; | 692 | rq->buffer = (char *) pc; |
692 | rq->rq_disk = tape->disk; | 693 | rq->rq_disk = tape->disk; |
693 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); | 694 | (void) ide_do_drive_cmd(drive, rq, ide_preempt); |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 300431d080a9..c9a05721360e 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -606,6 +606,7 @@ static int generic_ide_resume(struct device *dev) | |||
606 | memset(&rqpm, 0, sizeof(rqpm)); | 606 | memset(&rqpm, 0, sizeof(rqpm)); |
607 | memset(&args, 0, sizeof(args)); | 607 | memset(&args, 0, sizeof(args)); |
608 | rq.cmd_type = REQ_TYPE_PM_RESUME; | 608 | rq.cmd_type = REQ_TYPE_PM_RESUME; |
609 | rq.cmd_flags |= REQ_PREEMPT; | ||
609 | rq.special = &args; | 610 | rq.special = &args; |
610 | rq.data = &rqpm; | 611 | rq.data = &rqpm; |
611 | rqpm.pm_step = ide_pm_state_start_resume; | 612 | rqpm.pm_step = ide_pm_state_start_resume; |