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>
This commit is contained in:
FUJITA Tomonori 2008-04-29 09:54:38 +02:00 коммит произвёл Jens Axboe
Родитель 4f54eec831
Коммит e7b241a771
4 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -1550,8 +1550,7 @@ irqreturn_t ide_intr (int irq, void *dev_id)
void ide_init_drive_cmd (struct request *rq) void ide_init_drive_cmd (struct request *rq)
{ {
memset(rq, 0, sizeof(*rq)); blk_rq_init(NULL, rq);
rq->ref_count = 1;
} }
EXPORT_SYMBOL(ide_init_drive_cmd); EXPORT_SYMBOL(ide_init_drive_cmd);

Просмотреть файл

@ -662,7 +662,7 @@ static void idetape_create_request_sense_cmd(struct ide_atapi_pc *pc)
static void idetape_init_rq(struct request *rq, u8 cmd) static void idetape_init_rq(struct request *rq, u8 cmd)
{ {
memset(rq, 0, sizeof(*rq)); blk_rq_init(NULL, rq);
rq->cmd_type = REQ_TYPE_SPECIAL; rq->cmd_type = REQ_TYPE_SPECIAL;
rq->cmd[0] = cmd; rq->cmd[0] = cmd;
} }

Просмотреть файл

@ -494,8 +494,7 @@ int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect)
{ {
struct request rq; struct request rq;
memset(&rq, 0, sizeof(rq)); blk_rq_init(NULL, &rq);
rq.ref_count = 1;
rq.cmd_type = REQ_TYPE_ATA_TASKFILE; rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
rq.buffer = buf; rq.buffer = buf;

Просмотреть файл

@ -564,7 +564,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg)
if (!(drive->dn % 2)) if (!(drive->dn % 2))
ide_acpi_get_timing(hwif); ide_acpi_get_timing(hwif);
memset(&rq, 0, sizeof(rq)); blk_rq_init(NULL, &rq);
memset(&rqpm, 0, sizeof(rqpm)); memset(&rqpm, 0, sizeof(rqpm));
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
rq.cmd_type = REQ_TYPE_PM_SUSPEND; rq.cmd_type = REQ_TYPE_PM_SUSPEND;
@ -602,7 +602,7 @@ static int generic_ide_resume(struct device *dev)
ide_acpi_exec_tfs(drive); ide_acpi_exec_tfs(drive);
memset(&rq, 0, sizeof(rq)); blk_rq_init(NULL, &rq);
memset(&rqpm, 0, sizeof(rqpm)); memset(&rqpm, 0, sizeof(rqpm));
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
rq.cmd_type = REQ_TYPE_PM_RESUME; rq.cmd_type = REQ_TYPE_PM_RESUME;