diff options
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) | |||
274 | void ide_map_sg(ide_drive_t *drive, struct request *rq) | 274 | void ide_map_sg(ide_drive_t *drive, struct request *rq) |
275 | { | 275 | { |
276 | ide_hwif_t *hwif = drive->hwif; | 276 | ide_hwif_t *hwif = drive->hwif; |
277 | struct ide_cmd *cmd = &hwif->cmd; | ||
277 | struct scatterlist *sg = hwif->sg_table; | 278 | struct scatterlist *sg = hwif->sg_table; |
278 | 279 | ||
279 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { | 280 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
280 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | 281 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); |
281 | hwif->sg_nents = 1; | 282 | cmd->sg_nents = 1; |
282 | } else if (!rq->bio) { | 283 | } else if (!rq->bio) { |
283 | sg_init_one(sg, rq->data, rq->data_len); | 284 | sg_init_one(sg, rq->data, rq->data_len); |
284 | hwif->sg_nents = 1; | 285 | cmd->sg_nents = 1; |
285 | } else { | 286 | } else |
286 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | 287 | cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); |
287 | } | ||
288 | } | 288 | } |
289 | |||
290 | EXPORT_SYMBOL_GPL(ide_map_sg); | 289 | EXPORT_SYMBOL_GPL(ide_map_sg); |
291 | 290 | ||
292 | void ide_init_sg_cmd(ide_drive_t *drive, struct request *rq) | 291 | void ide_init_sg_cmd(struct ide_cmd *cmd, int nsect) |
293 | { | 292 | { |
294 | ide_hwif_t *hwif = drive->hwif; | 293 | cmd->nsect = cmd->nleft = nsect; |
295 | 294 | cmd->cursg_ofs = 0; | |
296 | hwif->nsect = hwif->nleft = rq->nr_sectors; | 295 | cmd->cursg = NULL; |
297 | hwif->cursg_ofs = 0; | ||
298 | hwif->cursg = NULL; | ||
299 | } | 296 | } |
300 | |||
301 | EXPORT_SYMBOL_GPL(ide_init_sg_cmd); | 297 | EXPORT_SYMBOL_GPL(ide_init_sg_cmd); |
302 | 298 | ||
303 | /** | 299 | /** |
@@ -323,7 +319,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
323 | case TASKFILE_OUT: | 319 | case TASKFILE_OUT: |
324 | case TASKFILE_MULTI_IN: | 320 | case TASKFILE_MULTI_IN: |
325 | case TASKFILE_IN: | 321 | case TASKFILE_IN: |
326 | ide_init_sg_cmd(drive, rq); | 322 | ide_init_sg_cmd(cmd, rq->nr_sectors); |
327 | ide_map_sg(drive, rq); | 323 | ide_map_sg(drive, rq); |
328 | default: | 324 | default: |
329 | break; | 325 | break; |