History

target: Add se_portal_group->tpg_auth_group

This patch adds an optional /auth/ configfs group to TPG context that can be used by fabrics like iscsi-target for TPG demo-mode authentication.

Nicholas Bellinger committed 13 years ago

Commit e4b512e1 parent 66658894 files · +33 −3Browse files

Unified · Split

4 files
  1. drivers/target/target_core_fabric_configfs.c +19 −2
  2. include/target/target_core_base.h +2 −1
  3. include/target/target_core_configfs.h +1 −0
  4. include/target/target_core_fabric_configfs.h +11 −0
drivers/target/target_core_fabric_configfs.c+19−2
@@ -965,6 +965,19 @@ TF_CIT_SETUP(tpg_attrib, &target_fabric_tpg_attrib_item_ops, NULL, NULL); · 964 unmodified lines
965965
966966 /* End of tfc_tpg_attrib_cit */
967967
968+/* Start of tfc_tpg_auth_cit */
969+
970+CONFIGFS_EATTR_OPS(target_fabric_tpg_auth, se_portal_group, tpg_auth_group);
971+
972+static struct configfs_item_operations target_fabric_tpg_auth_item_ops = {
973+ .show_attribute = target_fabric_tpg_auth_attr_show,
974+ .store_attribute = target_fabric_tpg_auth_attr_store,
975+};
976+
977+TF_CIT_SETUP(tpg_auth, &target_fabric_tpg_auth_item_ops, NULL, NULL);
978+
979+/* End of tfc_tpg_attrib_cit */
980+
968981 /* Start of tfc_tpg_param_cit */
969982
970983 CONFIGFS_EATTR_OPS(target_fabric_tpg_param, se_portal_group, tpg_param_group);
@@ -1030,8 +1043,9 @@ static struct config_group *target_fabric_make_tpg( · 59 unmodified lines
10301043 se_tpg->tpg_group.default_groups[1] = &se_tpg->tpg_np_group;
10311044 se_tpg->tpg_group.default_groups[2] = &se_tpg->tpg_acl_group;
10321045 se_tpg->tpg_group.default_groups[3] = &se_tpg->tpg_attrib_group;
1033− se_tpg->tpg_group.default_groups[4] = &se_tpg->tpg_param_group;
1034− se_tpg->tpg_group.default_groups[5] = NULL;
1046+ se_tpg->tpg_group.default_groups[4] = &se_tpg->tpg_auth_group;
1047+ se_tpg->tpg_group.default_groups[5] = &se_tpg->tpg_param_group;
1048+ se_tpg->tpg_group.default_groups[6] = NULL;
10351049
10361050 config_group_init_type_name(&se_tpg->tpg_group, name,
10371051 &TF_CIT_TMPL(tf)->tfc_tpg_base_cit);
@@ -1043,6 +1057,8 @@ static struct config_group *target_fabric_make_tpg( · 5 unmodified lines
10431057 &TF_CIT_TMPL(tf)->tfc_tpg_nacl_cit);
10441058 config_group_init_type_name(&se_tpg->tpg_attrib_group, "attrib",
10451059 &TF_CIT_TMPL(tf)->tfc_tpg_attrib_cit);
1060+ config_group_init_type_name(&se_tpg->tpg_auth_group, "auth",
1061+ &TF_CIT_TMPL(tf)->tfc_tpg_auth_cit);
10461062 config_group_init_type_name(&se_tpg->tpg_param_group, "param",
10471063 &TF_CIT_TMPL(tf)->tfc_tpg_param_cit);
10481064
@@ -1202,6 +1218,7 @@ int target_fabric_setup_cits(struct target_fabric_configfs *tf) · 153 unmodified lines
12021218 target_fabric_setup_tpg_np_cit(tf);
12031219 target_fabric_setup_tpg_np_base_cit(tf);
12041220 target_fabric_setup_tpg_attrib_cit(tf);
1221+ target_fabric_setup_tpg_auth_cit(tf);
12051222 target_fabric_setup_tpg_param_cit(tf);
12061223 target_fabric_setup_tpg_nacl_cit(tf);
12071224 target_fabric_setup_tpg_nacl_base_cit(tf);
include/target/target_core_base.h+2−1
@@ -795,11 +795,12 @@ struct se_portal_group { · 794 unmodified lines
795795 struct target_core_fabric_ops *se_tpg_tfo;
796796 struct se_wwn *se_tpg_wwn;
797797 struct config_group tpg_group;
798− struct config_group *tpg_default_groups[6];
798+ struct config_group *tpg_default_groups[7];
799799 struct config_group tpg_lun_group;
800800 struct config_group tpg_np_group;
801801 struct config_group tpg_acl_group;
802802 struct config_group tpg_attrib_group;
803+ struct config_group tpg_auth_group;
803804 struct config_group tpg_param_group;
804805 };
805806
include/target/target_core_configfs.h+1−0
@@ -23,6 +23,7 @@ struct target_fabric_configfs_template { · 22 unmodified lines
2323 struct config_item_type tfc_tpg_np_cit;
2424 struct config_item_type tfc_tpg_np_base_cit;
2525 struct config_item_type tfc_tpg_attrib_cit;
26+ struct config_item_type tfc_tpg_auth_cit;
2627 struct config_item_type tfc_tpg_param_cit;
2728 struct config_item_type tfc_tpg_nacl_cit;
2829 struct config_item_type tfc_tpg_nacl_base_cit;
include/target/target_core_fabric_configfs.h+11−0
@@ -62,6 +62,17 @@ static struct target_fabric_tpg_attrib_attribute _fabric##_tpg_attrib_##_name = · 61 unmodified lines
6262 _fabric##_tpg_attrib_show_##_name, \
6363 _fabric##_tpg_attrib_store_##_name);
6464
65+CONFIGFS_EATTR_STRUCT(target_fabric_tpg_auth, se_portal_group);
66+#define TF_TPG_AUTH_ATTR(_fabric, _name, _mode) \
67+static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
68+ __CONFIGFS_EATTR(_name, _mode, \
69+ _fabric##_tpg_auth_show_##_name, \
70+ _fabric##_tpg_auth_store_##_name);
71+
72+#define TF_TPG_AUTH_ATTR_RO(_fabric, _name) \
73+static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
74+ __CONFIGFS_EATTR_RO(_name, \
75+ _fabric##_tpg_auth_show_##_name);
6576
6677 CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group);
6778 #define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t