summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-10-07 16:55:53 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2012-11-07 05:55:44 +0100
commit6f23ac8a39418d6c6711f4fd73cc4519067d7f08 (patch)
treed6975dda37b047b6f9c3f5cf74cc4206a32a9e3a /drivers/target
parenttarget/pscsi: call spc_emulate_report_luns directly (diff)
downloadlinux-6f23ac8a39418d6c6711f4fd73cc4519067d7f08.tar.xz
linux-6f23ac8a39418d6c6711f4fd73cc4519067d7f08.zip
target: provide generic sbc device type/revision helpers
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_file.c22
-rw-r--r--drivers/target/target_core_iblock.c14
-rw-r--r--drivers/target/target_core_rd.c14
-rw-r--r--drivers/target/target_core_sbc.c12
4 files changed, 18 insertions, 44 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 571d3645f58a..2a3e2bbd8078 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -491,24 +491,6 @@ static ssize_t fd_show_configfs_dev_params(struct se_device *dev, char *b)
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_template = {
.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,
};
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 969eed8bff52..701877f9cd33 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -664,16 +664,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);
@@ -735,8 +725,8 @@ static struct se_subsystem_api iblock_template = {
.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,
};
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 1b36e67b1153..6348b6672526 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -417,16 +417,6 @@ static ssize_t rd_show_configfs_dev_params(struct se_device *dev, char *b)
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_template = {
.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,
};
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index a77a19c8d923..01686954cfa0 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -603,3 +603,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);