diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:38 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:38 +0100 |
commit | b6308ee0c55acd2e943d849773c9f0a49c516317 (patch) | |
tree | e56f59a7935fccdf0145ffd4638a066bf4ba1e17 /drivers/ide/ide-io.c | |
parent | adb1af9803d167091c2cb4de14014185054bfe2c (diff) | |
download | talos-obmc-linux-b6308ee0c55acd2e943d849773c9f0a49c516317.tar.gz talos-obmc-linux-b6308ee0c55acd2e943d849773c9f0a49c516317.zip |
ide: move command related fields from ide_hwif_t to struct ide_cmd
* Move command related fields from ide_hwif_t to struct ide_cmd.
* Make ide_init_sg_cmd() take command and sectors number as arguments.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 2900271c6ddd..7917fa09bf15 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -274,30 +274,26 @@ static ide_startstop_t do_special (ide_drive_t *drive) void ide_map_sg(ide_drive_t *drive, struct request *rq) { ide_hwif_t *hwif = drive->hwif; + struct ide_cmd *cmd = &hwif->cmd; struct scatterlist *sg = hwif->sg_table; if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); - hwif->sg_nents = 1; + cmd->sg_nents = 1; } else if (!rq->bio) { sg_init_one(sg, rq->data, rq->data_len); - hwif->sg_nents = 1; - } else { - hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); - } + cmd->sg_nents = 1; + } else + cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); } - EXPORT_SYMBOL_GPL(ide_map_sg); -void ide_init_sg_cmd(ide_drive_t *drive, struct request *rq) +void ide_init_sg_cmd(struct ide_cmd *cmd, int nsect) { - ide_hwif_t *hwif = drive->hwif; - - hwif->nsect = hwif->nleft = rq->nr_sectors; - hwif->cursg_ofs = 0; - hwif->cursg = NULL; + cmd->nsect = cmd->nleft = nsect; + cmd->cursg_ofs = 0; + cmd->cursg = NULL; } - EXPORT_SYMBOL_GPL(ide_init_sg_cmd); /** @@ -323,7 +319,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, case TASKFILE_OUT: case TASKFILE_MULTI_IN: case TASKFILE_IN: - ide_init_sg_cmd(drive, rq); + ide_init_sg_cmd(cmd, rq->nr_sectors); ide_map_sg(drive, rq); default: break; |