|
@@ -212,10 +212,6 @@ static struct config_group *target_core_register_fabric(
|
|
|
|
|
|
pr_debug("Target_Core_ConfigFS: REGISTER -> Allocated Fabric:"
|
|
|
" %s\n", tf->tf_group.cg_item.ci_name);
|
|
|
- /*
|
|
|
- * Setup tf_ops.tf_subsys pointer for usage with configfs_depend_item()
|
|
|
- */
|
|
|
- tf->tf_ops.tf_subsys = tf->tf_subsys;
|
|
|
tf->tf_fabric = &tf->tf_group.cg_item;
|
|
|
pr_debug("Target_Core_ConfigFS: REGISTER -> Set tf->tf_fabric"
|
|
|
" for %s\n", name);
|
|
@@ -291,10 +287,17 @@ static struct configfs_subsystem target_core_fabrics = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
-struct configfs_subsystem *target_core_subsystem[] = {
|
|
|
- &target_core_fabrics,
|
|
|
- NULL,
|
|
|
-};
|
|
|
+int target_depend_item(struct config_item *item)
|
|
|
+{
|
|
|
+ return configfs_depend_item(&target_core_fabrics, item);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(target_depend_item);
|
|
|
+
|
|
|
+void target_undepend_item(struct config_item *item)
|
|
|
+{
|
|
|
+ return configfs_undepend_item(&target_core_fabrics, item);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(target_undepend_item);
|
|
|
|
|
|
/*##############################################################################
|
|
|
// Start functions called by external Target Fabrics Modules
|
|
@@ -467,7 +470,6 @@ int target_register_template(const struct target_core_fabric_ops *fo)
|
|
|
* struct target_fabric_configfs->tf_cit_tmpl
|
|
|
*/
|
|
|
tf->tf_module = fo->module;
|
|
|
- tf->tf_subsys = target_core_subsystem[0];
|
|
|
snprintf(tf->tf_name, TARGET_FABRIC_NAME_SIZE, "%s", fo->name);
|
|
|
|
|
|
tf->tf_ops = *fo;
|
|
@@ -2870,7 +2872,7 @@ static int __init target_core_init_configfs(void)
|
|
|
{
|
|
|
struct config_group *target_cg, *hba_cg = NULL, *alua_cg = NULL;
|
|
|
struct config_group *lu_gp_cg = NULL;
|
|
|
- struct configfs_subsystem *subsys;
|
|
|
+ struct configfs_subsystem *subsys = &target_core_fabrics;
|
|
|
struct t10_alua_lu_gp *lu_gp;
|
|
|
int ret;
|
|
|
|
|
@@ -2878,7 +2880,6 @@ static int __init target_core_init_configfs(void)
|
|
|
" Engine: %s on %s/%s on "UTS_RELEASE"\n",
|
|
|
TARGET_CORE_VERSION, utsname()->sysname, utsname()->machine);
|
|
|
|
|
|
- subsys = target_core_subsystem[0];
|
|
|
config_group_init(&subsys->su_group);
|
|
|
mutex_init(&subsys->su_mutex);
|
|
|
|
|
@@ -3008,13 +3009,10 @@ out_global:
|
|
|
|
|
|
static void __exit target_core_exit_configfs(void)
|
|
|
{
|
|
|
- struct configfs_subsystem *subsys;
|
|
|
struct config_group *hba_cg, *alua_cg, *lu_gp_cg;
|
|
|
struct config_item *item;
|
|
|
int i;
|
|
|
|
|
|
- subsys = target_core_subsystem[0];
|
|
|
-
|
|
|
lu_gp_cg = &alua_lu_gps_group;
|
|
|
for (i = 0; lu_gp_cg->default_groups[i]; i++) {
|
|
|
item = &lu_gp_cg->default_groups[i]->cg_item;
|
|
@@ -3045,8 +3043,8 @@ static void __exit target_core_exit_configfs(void)
|
|
|
* We expect subsys->su_group.default_groups to be released
|
|
|
* by configfs subsystem provider logic..
|
|
|
*/
|
|
|
- configfs_unregister_subsystem(subsys);
|
|
|
- kfree(subsys->su_group.default_groups);
|
|
|
+ configfs_unregister_subsystem(&target_core_fabrics);
|
|
|
+ kfree(target_core_fabrics.su_group.default_groups);
|
|
|
|
|
|
core_alua_free_lu_gp(default_lu_gp);
|
|
|
default_lu_gp = NULL;
|