aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-15 15:21:43 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:43 -0400
commit154ed280e3f48995d0689b57f10b7063add63019 (patch)
tree1d852964a1641bfbd9577afb752318f4ba86a2d4 /drivers/ide/ide-taskfile.c
parent6fe162381e547f457252e68521eb42fd36ec1418 (diff)
ide-taskfile: convert ide_do_drive_cmd path to use blk_execute_rq
This converts the ide_do_drive_cmd path using ide_wait to use blk_execute_rq. Signed-off-by: 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/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index ab545ffa1549..b6a1c4b51129 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -492,11 +492,12 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
492 492
493int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect) 493int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect)
494{ 494{
495 struct request rq; 495 struct request *rq;
496 int error;
496 497
497 blk_rq_init(NULL, &rq); 498 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
498 rq.cmd_type = REQ_TYPE_ATA_TASKFILE; 499 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
499 rq.buffer = buf; 500 rq->buffer = buf;
500 501
501 /* 502 /*
502 * (ks) We transfer currently only whole sectors. 503 * (ks) We transfer currently only whole sectors.
@@ -504,16 +505,19 @@ int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect)
504 * if we would find a solution to transfer any size. 505 * if we would find a solution to transfer any size.
505 * To support special commands like READ LONG. 506 * To support special commands like READ LONG.
506 */ 507 */
507 rq.hard_nr_sectors = rq.nr_sectors = nsect; 508 rq->hard_nr_sectors = rq->nr_sectors = nsect;
508 rq.hard_cur_sectors = rq.current_nr_sectors = nsect; 509 rq->hard_cur_sectors = rq->current_nr_sectors = nsect;
509 510
510 if (task->tf_flags & IDE_TFLAG_WRITE) 511 if (task->tf_flags & IDE_TFLAG_WRITE)
511 rq.cmd_flags |= REQ_RW; 512 rq->cmd_flags |= REQ_RW;
512 513
513 rq.special = task; 514 rq->special = task;
514 task->rq = &rq; 515 task->rq = rq;
515 516
516 return ide_do_drive_cmd(drive, &rq, ide_wait); 517 error = blk_execute_rq(drive->queue, NULL, rq, 0);
518 blk_put_request(rq);
519
520 return error;
517} 521}
518 522
519EXPORT_SYMBOL(ide_raw_taskfile); 523EXPORT_SYMBOL(ide_raw_taskfile);
@@ -739,12 +743,14 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
739 struct hd_driveid *id = drive->id; 743 struct hd_driveid *id = drive->id;
740 744
741 if (NULL == (void *) arg) { 745 if (NULL == (void *) arg) {
742 struct request rq; 746 struct request *rq;
743 747
744 ide_init_drive_cmd(&rq); 748 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
745 rq.cmd_type = REQ_TYPE_ATA_TASKFILE; 749 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
750 err = blk_execute_rq(drive->queue, NULL, rq, 0);
751 blk_put_request(rq);
746 752
747 return ide_do_drive_cmd(drive, &rq, ide_wait); 753 return err;
748 } 754 }
749 755
750 if (copy_from_user(args, (void __user *)arg, 4)) 756 if (copy_from_user(args, (void __user *)arg, 4))