From 0c2ad7d1132d8b089b1d37875917858e03610019 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 17 Jun 2012 18:40:52 -0400 Subject: 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 Signed-off-by: Nicholas Bellinger --- include/target/target_core_backend.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/target') diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 24d2004f0d12..9b4f2c92ed53 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -26,8 +26,6 @@ struct se_subsystem_api { int (*transport_complete)(struct se_cmd *cmd, struct scatterlist *); int (*parse_cdb)(struct se_cmd *cmd); - int (*execute_cmd)(struct se_cmd *, struct scatterlist *, u32, - enum dma_data_direction); int (*do_discard)(struct se_device *, sector_t, u32); void (*do_sync_cache)(struct se_cmd *); ssize_t (*check_configfs_dev_params)(struct se_hba *, @@ -42,6 +40,10 @@ struct se_subsystem_api { unsigned char *(*get_sense_buffer)(struct se_cmd *); }; +struct spc_ops { + int (*execute_rw)(struct se_cmd *cmd); +}; + int transport_subsystem_register(struct se_subsystem_api *); void transport_subsystem_release(struct se_subsystem_api *); @@ -51,7 +53,7 @@ struct se_device *transport_add_device_to_core_hba(struct se_hba *, void target_complete_cmd(struct se_cmd *, u8); -int sbc_parse_cdb(struct se_cmd *cmd); +int sbc_parse_cdb(struct se_cmd *cmd, struct spc_ops *ops); int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); -- cgit v1.2.3