diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-04-23 15:35:30 (GMT) |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-05-06 22:02:59 (GMT) |
commit | 72a0e5e2e2e6b577343c79013611ad5701e94482 (patch) | |
tree | 06e41f5240a98040a2a6eed30ab75c0c4213baf2 /drivers/target/target_core_file.c | |
parent | ed3102c678c6274933948f9097bb4e2b314e5f82 (diff) | |
download | linux-72a0e5e2e2e6b577343c79013611ad5701e94482.tar.xz |
target: remove the task_lba field in struct se_task
Now that we don't split commands the lba field in the task is always
equivalent to the one in the CDB, even in cases where we have two tasks
due to a BIDI transfer. Just refer the the lba in the command instead
of duplicating it in the task.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r-- | drivers/target/target_core_file.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index c3e899e..4343cfd 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -273,7 +273,7 @@ static int fd_do_readv(struct se_task *task) struct scatterlist *sg = task->task_sg; struct iovec *iov; mm_segment_t old_fs; - loff_t pos = (task->task_lba * + loff_t pos = (task->task_se_cmd->t_task_lba * se_dev->se_sub_dev->se_dev_attrib.block_size); int ret = 0, i; @@ -326,7 +326,7 @@ static int fd_do_writev(struct se_task *task) struct scatterlist *sg = task->task_sg; struct iovec *iov; mm_segment_t old_fs; - loff_t pos = (task->task_lba * + loff_t pos = (task->task_se_cmd->t_task_lba * se_dev->se_sub_dev->se_dev_attrib.block_size); int ret, i = 0; @@ -402,12 +402,13 @@ static void fd_emulate_write_fua(struct se_cmd *cmd, struct se_task *task) { struct se_device *dev = cmd->se_dev; struct fd_dev *fd_dev = dev->dev_ptr; - loff_t start = task->task_lba * dev->se_sub_dev->se_dev_attrib.block_size; + loff_t start = task->task_se_cmd->t_task_lba * + dev->se_sub_dev->se_dev_attrib.block_size; loff_t end = start + task->task_size; int ret; pr_debug("FILEIO: FUA WRITE LBA: %llu, bytes: %u\n", - task->task_lba, task->task_size); + task->task_se_cmd->t_task_lba, task->task_size); ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1); if (ret != 0) |