diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-20 14:57:18 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-20 14:57:18 -0500 |
commit | d1fa7a1d506730a5d1211048c2fdacc42373d4d5 (patch) | |
tree | d3105e04c7134c5e1a982cad8e185c3ffce15d11 /drivers/target/iscsi/iscsi_target_configfs.c | |
parent | b0a382c58ef5c12804cda4268d7e62bef978789d (diff) |
iscsi-target: Expose default_erl as TPG attribute
This patch exposes default_erl as a TPG attribute so that it may be
set TPG wide in demo-mode, but still allow the existing NodeACL
attribute to be overridden on a per initiator basis.
Reported-by: Arshad Hussain <arshad.hussain@calsoftinc.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_configfs.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index fde3624dce7e..e3318edb233d 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -1046,6 +1046,11 @@ TPG_ATTR(prod_mode_write_protect, S_IRUGO | S_IWUSR); | |||
1046 | */ | 1046 | */ |
1047 | DEF_TPG_ATTRIB(demo_mode_discovery); | 1047 | DEF_TPG_ATTRIB(demo_mode_discovery); |
1048 | TPG_ATTR(demo_mode_discovery, S_IRUGO | S_IWUSR); | 1048 | TPG_ATTR(demo_mode_discovery, S_IRUGO | S_IWUSR); |
1049 | /* | ||
1050 | * Define iscsi_tpg_attrib_s_default_erl | ||
1051 | */ | ||
1052 | DEF_TPG_ATTRIB(default_erl); | ||
1053 | TPG_ATTR(default_erl, S_IRUGO | S_IWUSR); | ||
1049 | 1054 | ||
1050 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | 1055 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { |
1051 | &iscsi_tpg_attrib_authentication.attr, | 1056 | &iscsi_tpg_attrib_authentication.attr, |
@@ -1057,6 +1062,7 @@ static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | |||
1057 | &iscsi_tpg_attrib_demo_mode_write_protect.attr, | 1062 | &iscsi_tpg_attrib_demo_mode_write_protect.attr, |
1058 | &iscsi_tpg_attrib_prod_mode_write_protect.attr, | 1063 | &iscsi_tpg_attrib_prod_mode_write_protect.attr, |
1059 | &iscsi_tpg_attrib_demo_mode_discovery.attr, | 1064 | &iscsi_tpg_attrib_demo_mode_discovery.attr, |
1065 | &iscsi_tpg_attrib_default_erl.attr, | ||
1060 | NULL, | 1066 | NULL, |
1061 | }; | 1067 | }; |
1062 | 1068 | ||
@@ -1919,9 +1925,12 @@ static void lio_set_default_node_attributes(struct se_node_acl *se_acl) | |||
1919 | { | 1925 | { |
1920 | struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl, | 1926 | struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl, |
1921 | se_node_acl); | 1927 | se_node_acl); |
1928 | struct se_portal_group *se_tpg = se_acl->se_tpg; | ||
1929 | struct iscsi_portal_group *tpg = container_of(se_tpg, | ||
1930 | struct iscsi_portal_group, tpg_se_tpg); | ||
1922 | 1931 | ||
1923 | acl->node_attrib.nacl = acl; | 1932 | acl->node_attrib.nacl = acl; |
1924 | iscsit_set_default_node_attribues(acl); | 1933 | iscsit_set_default_node_attribues(acl, tpg); |
1925 | } | 1934 | } |
1926 | 1935 | ||
1927 | static int lio_check_stop_free(struct se_cmd *se_cmd) | 1936 | static int lio_check_stop_free(struct se_cmd *se_cmd) |