aboutsummaryrefslogtreecommitdiff
path: root/drivers/target/target_core_file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-04-23 11:35:31 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-06 15:03:41 -0700
commit7a83aa4e7b26ba61b9dc98d5c0bf725f4df0043f (patch)
treedc2c7e29f7850e238e5f752aaeb4bbaa8dd69f94 /drivers/target/target_core_file.c
parent72a0e5e2e2e6b577343c79013611ad5701e94482 (diff)
downloadvexpress-lsk-7a83aa4e7b26ba61b9dc98d5c0bf725f4df0043f.tar.gz
target: remove the task_size field in struct se_task
Now that we don't split commands the size 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 size 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 4343cfd6811..6667039250c 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -300,10 +300,10 @@ static int fd_do_readv(struct se_task *task)
* block_device.
*/
if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) {
- if (ret < 0 || ret != task->task_size) {
+ if (ret < 0 || ret != task->task_se_cmd->data_length) {
pr_err("vfs_readv() returned %d,"
" expecting %d for S_ISBLK\n", ret,
- (int)task->task_size);
+ (int)task->task_se_cmd->data_length);
return (ret < 0 ? ret : -EINVAL);
}
} else {
@@ -348,7 +348,7 @@ static int fd_do_writev(struct se_task *task)
kfree(iov);
- if (ret < 0 || ret != task->task_size) {
+ if (ret < 0 || ret != task->task_se_cmd->data_length) {
pr_err("vfs_writev() returned %d\n", ret);
return (ret < 0 ? ret : -EINVAL);
}
@@ -404,11 +404,12 @@ static void fd_emulate_write_fua(struct se_cmd *cmd, struct se_task *task)
struct fd_dev *fd_dev = dev->dev_ptr;
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;
+ loff_t end = start + task->task_se_cmd->data_length;
int ret;
pr_debug("FILEIO: FUA WRITE LBA: %llu, bytes: %u\n",
- task->task_se_cmd->t_task_lba, task->task_size);
+ task->task_se_cmd->t_task_lba,
+ task->task_se_cmd->data_length);
ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1);
if (ret != 0)