diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-06-17 18:40:52 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-16 17:29:12 -0700 |
commit | 0c2ad7d1132d8b089b1d37875917858e03610019 (patch) | |
tree | e86cc118497605026a15c0e97630c57aeb625793 /drivers/target/target_core_pscsi.c | |
parent | e1306bdab3af8bef620990a99e613f99eb30065c (diff) | |
download | linux-0c2ad7d1132d8b089b1d37875917858e03610019.tar.bz2 |
target: add struct spc_ops + initial ->execute_rw pointer usage
Remove the execute_cmd method in struct se_subsystem_api, and always use the
one directly in struct se_cmd. To make life simpler for SBC virtual backends
a struct spc_ops that is passed to sbc_parse_cmd is added. For now it
only contains an execute_rw member, but more will follow with the subsequent
commits.
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 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index cb4c6b1195d4..6e32ff6f2fa0 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -55,6 +55,7 @@ static struct se_subsystem_api pscsi_template; +static int pscsi_execute_cmd(struct se_cmd *cmd); static void pscsi_req_done(struct request *, int); /* pscsi_attach_hba(): @@ -1081,17 +1082,20 @@ static int pscsi_parse_cdb(struct se_cmd *cmd) case WRITE_16: case WRITE_VERIFY: cmd->se_cmd_flags |= SCF_SCSI_DATA_CDB; - break; + /* FALLTHROUGH*/ default: + cmd->execute_cmd = pscsi_execute_cmd; break; } return 0; } -static int pscsi_execute_cmd(struct se_cmd *cmd, struct scatterlist *sgl, - u32 sgl_nents, enum dma_data_direction data_direction) +static int pscsi_execute_cmd(struct se_cmd *cmd) { + struct scatterlist *sgl = cmd->t_data_sg; + u32 sgl_nents = cmd->t_data_nents; + enum dma_data_direction data_direction = cmd->data_direction; struct pscsi_dev_virt *pdv = cmd->se_dev->dev_ptr; struct pscsi_plugin_task *pt; struct request *req; @@ -1259,7 +1263,6 @@ static struct se_subsystem_api pscsi_template = { .free_device = pscsi_free_device, .transport_complete = pscsi_transport_complete, .parse_cdb = pscsi_parse_cdb, - .execute_cmd = pscsi_execute_cmd, .check_configfs_dev_params = pscsi_check_configfs_dev_params, .set_configfs_dev_params = pscsi_set_configfs_dev_params, .show_configfs_dev_params = pscsi_show_configfs_dev_params, |