diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-10-12 11:09:12 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-10-23 23:21:13 -0400 |
commit | 485fd0d1e3b8010b538bd0b209f3592acc825677 (patch) | |
tree | a13b8785b9b24fcec032b9f28fd06597edae7256 /drivers/target/target_core_pscsi.c | |
parent | 6193f06e6fe27c9475e407cb3cf2b0d4cd2725b0 (diff) |
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_pscsi.c')
-rw-r--r-- | drivers/target/target_core_pscsi.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index b347862bf801..936b9fec4cca 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -1068,6 +1068,8 @@ static int pscsi_do_task(struct se_task *task) | |||
1068 | struct bio *hbio; | 1068 | struct bio *hbio; |
1069 | int ret; | 1069 | int ret; |
1070 | 1070 | ||
1071 | target_get_task_cdb(task, pt->pscsi_cdb); | ||
1072 | |||
1071 | if (task->task_se_cmd->se_cmd_flags & SCF_SCSI_NON_DATA_CDB) { | 1073 | if (task->task_se_cmd->se_cmd_flags & SCF_SCSI_NON_DATA_CDB) { |
1072 | req = blk_get_request(pdv->pdv_sd->request_queue, | 1074 | req = blk_get_request(pdv->pdv_sd->request_queue, |
1073 | (task->task_data_direction == DMA_TO_DEVICE), | 1075 | (task->task_data_direction == DMA_TO_DEVICE), |
@@ -1150,18 +1152,6 @@ fail: | |||
1150 | return PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES; | 1152 | return PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES; |
1151 | } | 1153 | } |
1152 | 1154 | ||
1153 | |||
1154 | /* pscsi_get_cdb(): | ||
1155 | * | ||
1156 | * | ||
1157 | */ | ||
1158 | static unsigned char *pscsi_get_cdb(struct se_task *task) | ||
1159 | { | ||
1160 | struct pscsi_plugin_task *pt = PSCSI_TASK(task); | ||
1161 | |||
1162 | return pt->pscsi_cdb; | ||
1163 | } | ||
1164 | |||
1165 | /* pscsi_get_sense_buffer(): | 1155 | /* pscsi_get_sense_buffer(): |
1166 | * | 1156 | * |
1167 | * | 1157 | * |
@@ -1276,7 +1266,6 @@ static struct se_subsystem_api pscsi_template = { | |||
1276 | .check_configfs_dev_params = pscsi_check_configfs_dev_params, | 1266 | .check_configfs_dev_params = pscsi_check_configfs_dev_params, |
1277 | .set_configfs_dev_params = pscsi_set_configfs_dev_params, | 1267 | .set_configfs_dev_params = pscsi_set_configfs_dev_params, |
1278 | .show_configfs_dev_params = pscsi_show_configfs_dev_params, | 1268 | .show_configfs_dev_params = pscsi_show_configfs_dev_params, |
1279 | .get_cdb = pscsi_get_cdb, | ||
1280 | .get_sense_buffer = pscsi_get_sense_buffer, | 1269 | .get_sense_buffer = pscsi_get_sense_buffer, |
1281 | .get_device_rev = pscsi_get_device_rev, | 1270 | .get_device_rev = pscsi_get_device_rev, |
1282 | .get_device_type = pscsi_get_device_type, | 1271 | .get_device_type = pscsi_get_device_type, |