diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-04-29 03:54:38 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-04-29 08:48:55 -0400 |
commit | e7b241a7715d2a0885f779f5baa63711d71b1d75 (patch) | |
tree | ec9024d351008795009a30f07652340cc01d8963 /drivers/ide | |
parent | 4f54eec8311c3325888c29ce8e4496daf4dbe624 (diff) |
ide: use blk_rq_init() to initialize the request
This converts ide to use blk_rq_init to initialize the request.
This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-io.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide.c | 4 |
4 files changed, 5 insertions, 7 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 788783da902..696525342e9 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1550,8 +1550,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) | |||
1550 | 1550 | ||
1551 | void ide_init_drive_cmd (struct request *rq) | 1551 | void ide_init_drive_cmd (struct request *rq) |
1552 | { | 1552 | { |
1553 | memset(rq, 0, sizeof(*rq)); | 1553 | blk_rq_init(NULL, rq); |
1554 | rq->ref_count = 1; | ||
1555 | } | 1554 | } |
1556 | 1555 | ||
1557 | EXPORT_SYMBOL(ide_init_drive_cmd); | 1556 | EXPORT_SYMBOL(ide_init_drive_cmd); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 54a43b04460..1e1f26331a2 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -662,7 +662,7 @@ static void idetape_create_request_sense_cmd(struct ide_atapi_pc *pc) | |||
662 | 662 | ||
663 | static void idetape_init_rq(struct request *rq, u8 cmd) | 663 | static void idetape_init_rq(struct request *rq, u8 cmd) |
664 | { | 664 | { |
665 | memset(rq, 0, sizeof(*rq)); | 665 | blk_rq_init(NULL, rq); |
666 | rq->cmd_type = REQ_TYPE_SPECIAL; | 666 | rq->cmd_type = REQ_TYPE_SPECIAL; |
667 | rq->cmd[0] = cmd; | 667 | rq->cmd[0] = cmd; |
668 | } | 668 | } |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 9a846a0cd5a..0c908ca3ff7 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -494,8 +494,7 @@ int 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 | 496 | ||
497 | memset(&rq, 0, sizeof(rq)); | 497 | blk_rq_init(NULL, &rq); |
498 | rq.ref_count = 1; | ||
499 | rq.cmd_type = REQ_TYPE_ATA_TASKFILE; | 498 | rq.cmd_type = REQ_TYPE_ATA_TASKFILE; |
500 | rq.buffer = buf; | 499 | rq.buffer = buf; |
501 | 500 | ||
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 999584c03d9..c758dcb13b1 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -564,7 +564,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
564 | if (!(drive->dn % 2)) | 564 | if (!(drive->dn % 2)) |
565 | ide_acpi_get_timing(hwif); | 565 | ide_acpi_get_timing(hwif); |
566 | 566 | ||
567 | memset(&rq, 0, sizeof(rq)); | 567 | blk_rq_init(NULL, &rq); |
568 | memset(&rqpm, 0, sizeof(rqpm)); | 568 | memset(&rqpm, 0, sizeof(rqpm)); |
569 | memset(&args, 0, sizeof(args)); | 569 | memset(&args, 0, sizeof(args)); |
570 | rq.cmd_type = REQ_TYPE_PM_SUSPEND; | 570 | rq.cmd_type = REQ_TYPE_PM_SUSPEND; |
@@ -602,7 +602,7 @@ static int generic_ide_resume(struct device *dev) | |||
602 | 602 | ||
603 | ide_acpi_exec_tfs(drive); | 603 | ide_acpi_exec_tfs(drive); |
604 | 604 | ||
605 | memset(&rq, 0, sizeof(rq)); | 605 | blk_rq_init(NULL, &rq); |
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; |