summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_transport.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-10-12 11:09:12 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-10-24 03:21:13 +0000
commit485fd0d1e3b8010b538bd0b209f3592acc825677 (patch)
treea13b8785b9b24fcec032b9f28fd06597edae7256 /drivers/target/target_core_transport.c
parent6193f06e6fe27c9475e407cb3cf2b0d4cd2725b0 (diff)
downloadop-kernel-dev-485fd0d1e3b8010b538bd0b209f3592acc825677.zip
op-kernel-dev-485fd0d1e3b8010b538bd0b209f3592acc825677.tar.gz
target: replace ->get_cdb with a target_get_task_cdb helper
Instead of calling out to the backends from the core to get a per-task CDB and then modify it for the LBA/len pair used for this CDB provide a helper that writes the adjusted CDB into a provided buffer and call this method from ->do_task in pscsi. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r--drivers/target/target_core_transport.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 8959696..3025a6f 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -3958,17 +3958,6 @@ static int transport_allocate_data_tasks(
task->task_sectors = min(sectors, dev_max_sectors);
task->task_size = task->task_sectors * sector_size;
- if (dev->transport->get_cdb) {
- unsigned char *cdb = dev->transport->get_cdb(task);
-
- memcpy(cdb, cmd->t_task_cdb,
- scsi_command_size(cmd->t_task_cdb));
-
- /* Update new cdb with updated lba/sectors */
- cmd->transport_split_cdb(task->task_lba,
- task->task_sectors, cdb);
- }
-
/*
* This now assumes that passed sg_ents are in PAGE_SIZE chunks
* in order to calculate the number per task SGL entries
@@ -4022,7 +4011,6 @@ static int transport_allocate_data_tasks(
static int
transport_allocate_control_task(struct se_cmd *cmd)
{
- struct se_device *dev = cmd->se_dev;
struct se_task *task;
unsigned long flags;
@@ -4030,12 +4018,6 @@ transport_allocate_control_task(struct se_cmd *cmd)
if (!task)
return -ENOMEM;
- if (dev->transport->get_cdb) {
- unsigned char *cdb = dev->transport->get_cdb(task);
-
- memcpy(cdb, cmd->t_task_cdb, scsi_command_size(cmd->t_task_cdb));
- }
-
task->task_sg = kmalloc(sizeof(struct scatterlist) * cmd->t_data_nents,
GFP_KERNEL);
if (!task->task_sg) {
OpenPOWER on IntegriCloud