Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- drivers/target/target_core_file.c | 22 ++-------------------- drivers/target/target_core_iblock.c | 14 ++------------ drivers/target/target_core_rd.c | 14 ++------------ drivers/target/target_core_sbc.c | 12 ++++++++++++ include/target/target_core_backend.h | 5 ++++- 5 files changed, 22 insertions(+), 45 deletions(-) Index: lio-core/drivers/target/target_core_file.c =================================================================== --- lio-core.orig/drivers/target/target_core_file.c 2012-10-07 05:34:23.655923456 -0700 +++ lio-core/drivers/target/target_core_file.c 2012-10-07 07:07:59.923768899 -0700 @@ -491,24 +491,6 @@ static ssize_t fd_show_configfs_dev_para return bl; } -/* fd_get_device_rev(): (Part of se_subsystem_api_t template) - * - * - */ -static u32 fd_get_device_rev(struct se_device *dev) -{ - return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */ -} - -/* fd_get_device_type(): (Part of se_subsystem_api_t template) - * - * - */ -static u32 fd_get_device_type(struct se_device *dev) -{ - return TYPE_DISK; -} - static sector_t fd_get_blocks(struct se_device *dev) { struct fd_dev *fd_dev = FD_DEV(dev); @@ -552,8 +534,8 @@ static struct se_subsystem_api fileio_te .parse_cdb = fd_parse_cdb, .set_configfs_dev_params = fd_set_configfs_dev_params, .show_configfs_dev_params = fd_show_configfs_dev_params, - .get_device_rev = fd_get_device_rev, - .get_device_type = fd_get_device_type, + .get_device_rev = sbc_get_device_rev, + .get_device_type = sbc_get_device_type, .get_blocks = fd_get_blocks, }; Index: lio-core/drivers/target/target_core_iblock.c =================================================================== --- lio-core.orig/drivers/target/target_core_iblock.c 2012-10-07 05:33:54.071924266 -0700 +++ lio-core/drivers/target/target_core_iblock.c 2012-10-07 07:07:39.471769461 -0700 @@ -673,16 +673,6 @@ fail: return -ENOMEM; } -static u32 iblock_get_device_rev(struct se_device *dev) -{ - return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */ -} - -static u32 iblock_get_device_type(struct se_device *dev) -{ - return TYPE_DISK; -} - static sector_t iblock_get_blocks(struct se_device *dev) { struct iblock_dev *ib_dev = IBLOCK_DEV(dev); @@ -744,8 +734,8 @@ static struct se_subsystem_api iblock_te .parse_cdb = iblock_parse_cdb, .set_configfs_dev_params = iblock_set_configfs_dev_params, .show_configfs_dev_params = iblock_show_configfs_dev_params, - .get_device_rev = iblock_get_device_rev, - .get_device_type = iblock_get_device_type, + .get_device_rev = sbc_get_device_rev, + .get_device_type = sbc_get_device_type, .get_blocks = iblock_get_blocks, }; Index: lio-core/drivers/target/target_core_rd.c =================================================================== --- lio-core.orig/drivers/target/target_core_rd.c 2012-10-07 06:32:22.279827724 -0700 +++ lio-core/drivers/target/target_core_rd.c 2012-10-07 07:08:20.575768330 -0700 @@ -417,16 +417,6 @@ static ssize_t rd_show_configfs_dev_para return bl; } -static u32 rd_get_device_rev(struct se_device *dev) -{ - return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */ -} - -static u32 rd_get_device_type(struct se_device *dev) -{ - return TYPE_DISK; -} - static sector_t rd_get_blocks(struct se_device *dev) { struct rd_dev *rd_dev = RD_DEV(dev); @@ -459,8 +449,8 @@ static struct se_subsystem_api rd_mcp_te .parse_cdb = rd_parse_cdb, .set_configfs_dev_params = rd_set_configfs_dev_params, .show_configfs_dev_params = rd_show_configfs_dev_params, - .get_device_rev = rd_get_device_rev, - .get_device_type = rd_get_device_type, + .get_device_rev = sbc_get_device_rev, + .get_device_type = sbc_get_device_type, .get_blocks = rd_get_blocks, }; Index: lio-core/drivers/target/target_core_sbc.c =================================================================== --- lio-core.orig/drivers/target/target_core_sbc.c 2012-10-07 05:42:50.035909516 -0700 +++ lio-core/drivers/target/target_core_sbc.c 2012-10-07 07:07:26.095769830 -0700 @@ -585,3 +585,15 @@ out_invalid_cdb_field: return -EINVAL; } EXPORT_SYMBOL(sbc_parse_cdb); + +u32 sbc_get_device_rev(struct se_device *dev) +{ + return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */ +} +EXPORT_SYMBOL(sbc_get_device_rev); + +u32 sbc_get_device_type(struct se_device *dev) +{ + return TYPE_DISK; +} +EXPORT_SYMBOL(sbc_get_device_type); Index: lio-core/include/target/target_core_backend.h =================================================================== --- lio-core.orig/include/target/target_core_backend.h 2012-10-07 05:40:11.383913881 -0700 +++ lio-core/include/target/target_core_backend.h 2012-10-07 07:10:02.631765521 -0700 @@ -50,11 +50,14 @@ void transport_subsystem_release(struct void target_complete_cmd(struct se_cmd *, u8); -int sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); int spc_emulate_report_luns(struct se_cmd *cmd); int spc_get_write_same_sectors(struct se_cmd *cmd); +int sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); +u32 sbc_get_device_rev(struct se_device *dev); +u32 sbc_get_device_type(struct se_device *dev); + void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *); -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html