summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-05-01 20:35:21 +0200
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 06:43:59 +0200
commitdfb7e621fa12c0579e88560ab176c5768f9e0bfb (patch)
tree9a0fc84735ee3290c366b4244763013ba07bcdd7 /drivers/ide/ide-floppy.c
parentide-tape: fix potential fs requests bug (diff)
downloadlinux-dfb7e621fa12c0579e88560ab176c5768f9e0bfb.tar.xz
linux-dfb7e621fa12c0579e88560ab176c5768f9e0bfb.zip
ide-atapi: switch to blk_rq_bytes() on do_request() path
After the recent struct request cleanups, blk_rq_bytes() is guaranteed to be valid and is the current total length of the rq's bio. Use that instead of pc->req_xfer in the do_request() path after the command has been queued The remaining usage of pc->req_xfer now is only until we map the rq to a bio. While at it: - remove local caching of rq completion length in ide_tape_issue_pc() Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 650981758f15..a1c55985d4ae 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -210,7 +210,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive,
if (rq->cmd_flags & REQ_RW)
pc->flags |= PC_FLAG_WRITING;
pc->buf = NULL;
- pc->req_xfer = pc->buf_size = blocks * floppy->block_size;
+ pc->buf_size = blk_rq_bytes(rq);
pc->flags |= PC_FLAG_DMA_OK;
}
@@ -227,7 +227,7 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy,
}
/* pio will be performed by ide_pio_bytes() which handles sg fine */
pc->buf = NULL;
- pc->req_xfer = pc->buf_size = blk_rq_bytes(rq);
+ pc->buf_size = blk_rq_bytes(rq);
}
static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
@@ -286,8 +286,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
cmd.rq = rq;
- if (blk_fs_request(rq) || pc->req_xfer) {
- ide_init_sg_cmd(&cmd, pc->req_xfer);
+ if (blk_fs_request(rq) || blk_rq_bytes(rq)) {
+ ide_init_sg_cmd(&cmd, blk_rq_bytes(rq));
ide_map_sg(drive, &cmd);
}