ide-disk: convert ide_do_drive_cmd path to use blk_execute_rq
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:43 +0000 (21:21 +0200)
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>
drivers/ide/ide-disk.c

index 8e08d083fce95cba5f091b0a1892f938f8dfba11..c5f22ef8ed2419002949eff162aab8b06515253b 100644 (file)
@@ -617,7 +617,8 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
  */
 static int set_multcount(ide_drive_t *drive, int arg)
 {
-       struct request rq;
+       struct request *rq;
+       int error;
 
        if (arg < 0 || arg > drive->id->max_multsect)
                return -EINVAL;
@@ -625,12 +626,13 @@ static int set_multcount(ide_drive_t *drive, int arg)
        if (drive->special.b.set_multmode)
                return -EBUSY;
 
-       ide_init_drive_cmd(&rq);
-       rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
+       rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
+       rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
 
        drive->mult_req = arg;
        drive->special.b.set_multmode = 1;
-       (void)ide_do_drive_cmd(drive, &rq, ide_wait);
+       error = blk_execute_rq(drive->queue, NULL, rq, 0);
+       blk_put_request(rq);
 
        return (drive->mult_count == arg) ? 0 : -EIO;
 }