diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-18 18:00:42 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-04-18 18:00:42 -0400 |
commit | eace4cb04c0edc9388e987bf9bbdef461f6daca4 (patch) | |
tree | 3cd10182940039df2c99b0029ae0badf6fc5ada1 /drivers/ide/ide-io.c | |
parent | 7f006dc24fae158131116c9472874f12e16cf040 (diff) |
ide-taskfile: don't abuse rq->buffer
Impact: rq->buffer usage cleanup
ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
data buffer. This complicates both block interface and ide backend
request handling. Use blk_rq_map_kern() instead and drop special
handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().
Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
to initialize bio rw flag.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 35dc38d3b2c5..9b9e8b1aae5e 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -248,10 +248,7 @@ void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd) | |||
248 | struct scatterlist *sg = hwif->sg_table; | 248 | struct scatterlist *sg = hwif->sg_table; |
249 | struct request *rq = cmd->rq; | 249 | struct request *rq = cmd->rq; |
250 | 250 | ||
251 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { | 251 | if (!rq->bio) { |
252 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | ||
253 | cmd->sg_nents = 1; | ||
254 | } else if (!rq->bio) { | ||
255 | sg_init_one(sg, rq->data, rq->data_len); | 252 | sg_init_one(sg, rq->data, rq->data_len); |
256 | cmd->sg_nents = 1; | 253 | cmd->sg_nents = 1; |
257 | } else | 254 | } else |