summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_pscsi.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_pscsi.c
parent72a0e5e2e2e6b577343c79013611ad5701e94482 (diff)
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_pscsi.c')
-rw-r--r--drivers/target/target_core_pscsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 94c7a4649632..46eb017287a6 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -967,8 +967,8 @@ static int pscsi_map_sg(struct se_task *task, struct scatterlist *task_sg,
struct bio *bio = NULL, *tbio = NULL;
struct page *page;
struct scatterlist *sg;
- u32 data_len = task->task_size, i, len, bytes, off;
- int nr_pages = (task->task_size + task_sg[0].offset +
+ u32 data_len = cmd->data_length, i, len, bytes, off;
+ int nr_pages = (cmd->data_length + task_sg[0].offset +
PAGE_SIZE - 1) >> PAGE_SHIFT;
int nr_vecs = 0, rc;
int rw = (task->task_data_direction == DMA_TO_DEVICE);
@@ -1085,7 +1085,7 @@ static int pscsi_do_task(struct se_task *task)
return -ENODEV;
}
} else {
- BUG_ON(!task->task_size);
+ BUG_ON(!cmd->data_length);
/*
* Setup the main struct request for the task->task_sg[] payload