summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_configfs.c
diff options
context:
space:
mode:
authorTregaron Bayly <tregaron@baylys.org>2013-01-31 22:30:24 (GMT)
committerNicholas Bellinger <nab@linux-iscsi.org>2013-02-13 19:27:58 (GMT)
commitadfa9570a56c3dbfc2a28baab77ff6f0b8f480d3 (patch)
tree3d0fcb992e2cf56c8a88cac6861c276f4ad7b088 /drivers/target/target_core_configfs.c
parent0e48e7a5a345a727d5fd7a06bd6a9e6a67eae2bd (diff)
downloadlinux-adfa9570a56c3dbfc2a28baab77ff6f0b8f480d3.tar.xz
target: Add device attribute to expose config_item_name for INQUIRY model
This patch changes LIO to use the configfs backend device name as the model if you echo '1' to an individual device's emulate_model_alias attribute. This is a valid operation only on devices with an export count of 0. Signed-off-by: Tregaron Bayly <tbayly@bluehost.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
-rw-r--r--drivers/target/target_core_configfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 4efb61b..43b7ac6 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -609,6 +609,9 @@ static struct target_core_dev_attrib_attribute \
__CONFIGFS_EATTR_RO(_name, \
target_core_dev_show_attr_##_name);
+DEF_DEV_ATTRIB(emulate_model_alias);
+SE_DEV_ATTR(emulate_model_alias, S_IRUGO | S_IWUSR);
+
DEF_DEV_ATTRIB(emulate_dpo);
SE_DEV_ATTR(emulate_dpo, S_IRUGO | S_IWUSR);
@@ -681,6 +684,7 @@ SE_DEV_ATTR(max_write_same_len, S_IRUGO | S_IWUSR);
CONFIGFS_EATTR_OPS(target_core_dev_attrib, se_dev_attrib, da_group);
static struct configfs_attribute *target_core_dev_attrib_attrs[] = {
+ &target_core_dev_attrib_emulate_model_alias.attr,
&target_core_dev_attrib_emulate_dpo.attr,
&target_core_dev_attrib_emulate_fua_write.attr,
&target_core_dev_attrib_emulate_fua_read.attr,