diff options
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_configfs.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 95a67f604073..9cb5ab472a52 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -1052,6 +1052,11 @@ TPG_ATTR(default_erl, S_IRUGO | S_IWUSR); | |||
1052 | */ | 1052 | */ |
1053 | DEF_TPG_ATTRIB(t10_pi); | 1053 | DEF_TPG_ATTRIB(t10_pi); |
1054 | TPG_ATTR(t10_pi, S_IRUGO | S_IWUSR); | 1054 | TPG_ATTR(t10_pi, S_IRUGO | S_IWUSR); |
1055 | /* | ||
1056 | * Define iscsi_tpg_attrib_s_fabric_prot_type | ||
1057 | */ | ||
1058 | DEF_TPG_ATTRIB(fabric_prot_type); | ||
1059 | TPG_ATTR(fabric_prot_type, S_IRUGO | S_IWUSR); | ||
1055 | 1060 | ||
1056 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | 1061 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { |
1057 | &iscsi_tpg_attrib_authentication.attr, | 1062 | &iscsi_tpg_attrib_authentication.attr, |
@@ -1065,6 +1070,7 @@ static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | |||
1065 | &iscsi_tpg_attrib_demo_mode_discovery.attr, | 1070 | &iscsi_tpg_attrib_demo_mode_discovery.attr, |
1066 | &iscsi_tpg_attrib_default_erl.attr, | 1071 | &iscsi_tpg_attrib_default_erl.attr, |
1067 | &iscsi_tpg_attrib_t10_pi.attr, | 1072 | &iscsi_tpg_attrib_t10_pi.attr, |
1073 | &iscsi_tpg_attrib_fabric_prot_type.attr, | ||
1068 | NULL, | 1074 | NULL, |
1069 | }; | 1075 | }; |
1070 | 1076 | ||
@@ -1882,6 +1888,20 @@ static int lio_tpg_check_prod_mode_write_protect( | |||
1882 | return tpg->tpg_attrib.prod_mode_write_protect; | 1888 | return tpg->tpg_attrib.prod_mode_write_protect; |
1883 | } | 1889 | } |
1884 | 1890 | ||
1891 | static int lio_tpg_check_prot_fabric_only( | ||
1892 | struct se_portal_group *se_tpg) | ||
1893 | { | ||
1894 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | ||
1895 | /* | ||
1896 | * Only report fabric_prot_type if t10_pi has also been enabled | ||
1897 | * for incoming ib_isert sessions. | ||
1898 | */ | ||
1899 | if (!tpg->tpg_attrib.t10_pi) | ||
1900 | return 0; | ||
1901 | |||
1902 | return tpg->tpg_attrib.fabric_prot_type; | ||
1903 | } | ||
1904 | |||
1885 | static void lio_tpg_release_fabric_acl( | 1905 | static void lio_tpg_release_fabric_acl( |
1886 | struct se_portal_group *se_tpg, | 1906 | struct se_portal_group *se_tpg, |
1887 | struct se_node_acl *se_acl) | 1907 | struct se_node_acl *se_acl) |
@@ -1997,6 +2017,8 @@ int iscsi_target_register_configfs(void) | |||
1997 | &lio_tpg_check_demo_mode_write_protect; | 2017 | &lio_tpg_check_demo_mode_write_protect; |
1998 | fabric->tf_ops.tpg_check_prod_mode_write_protect = | 2018 | fabric->tf_ops.tpg_check_prod_mode_write_protect = |
1999 | &lio_tpg_check_prod_mode_write_protect; | 2019 | &lio_tpg_check_prod_mode_write_protect; |
2020 | fabric->tf_ops.tpg_check_prot_fabric_only = | ||
2021 | &lio_tpg_check_prot_fabric_only; | ||
2000 | fabric->tf_ops.tpg_alloc_fabric_acl = &lio_tpg_alloc_fabric_acl; | 2022 | fabric->tf_ops.tpg_alloc_fabric_acl = &lio_tpg_alloc_fabric_acl; |
2001 | fabric->tf_ops.tpg_release_fabric_acl = &lio_tpg_release_fabric_acl; | 2023 | fabric->tf_ops.tpg_release_fabric_acl = &lio_tpg_release_fabric_acl; |
2002 | fabric->tf_ops.tpg_get_inst_index = &lio_tpg_get_inst_index; | 2024 | fabric->tf_ops.tpg_get_inst_index = &lio_tpg_get_inst_index; |