[PATCH] target: do not request backend modules on startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We only need one of them, and they don't have to be modular.  Nevermind
that we generally never request optional modules.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: lio-core/drivers/target/target_core_configfs.c
===================================================================
--- lio-core.orig/drivers/target/target_core_configfs.c	2011-10-18 11:11:56.981853524 +0200
+++ lio-core/drivers/target/target_core_configfs.c	2011-10-18 11:12:06.412355341 +0200
@@ -131,13 +131,6 @@ static struct config_group *target_core_
 
 	pr_debug("Target_Core_ConfigFS: REGISTER -> group: %p name:"
 			" %s\n", group, name);
-	/*
-	 * Ensure that TCM subsystem plugins are loaded at this point for
-	 * using the RAMDISK_DR virtual LUN 0 and all other struct se_port
-	 * LUN symlinks.
-	 */
-	if (transport_subsystem_check_init() < 0)
-		return ERR_PTR(-EINVAL);
 
 	/*
 	 * Below are some hardcoded request_module() calls to automatically
@@ -3076,11 +3069,6 @@ static struct config_group *target_core_
 				" plugin_dep_id\n", ret);
 		return ERR_PTR(-EINVAL);
 	}
-	/*
-	 * Load up TCM subsystem plugins if they have not already been loaded.
-	 */
-	if (transport_subsystem_check_init() < 0)
-		return ERR_PTR(-EINVAL);
 
 	hba = core_alloc_hba(se_plugin_str, plugin_dep_id, 0);
 	if (IS_ERR(hba))
Index: lio-core/drivers/target/target_core_transport.c
===================================================================
--- lio-core.orig/drivers/target/target_core_transport.c	2011-10-18 11:10:59.313853571 +0200
+++ lio-core/drivers/target/target_core_transport.c	2011-10-18 11:11:49.076353146 +0200
@@ -57,8 +57,6 @@
 #include "target_core_pr.h"
 #include "target_core_ua.h"
 
-static int sub_api_initialized;
-
 static struct workqueue_struct *target_completion_wq;
 static struct kmem_cache *se_cmd_cache;
 static struct kmem_cache *se_sess_cache;
@@ -235,46 +233,6 @@ void transport_init_queue_obj(struct se_
 }
 EXPORT_SYMBOL(transport_init_queue_obj);
 
-static int transport_subsystem_reqmods(void)
-{
-	int ret;
-
-	ret = request_module("target_core_iblock");
-	if (ret != 0)
-		pr_err("Unable to load target_core_iblock\n");
-
-	ret = request_module("target_core_file");
-	if (ret != 0)
-		pr_err("Unable to load target_core_file\n");
-
-	ret = request_module("target_core_pscsi");
-	if (ret != 0)
-		pr_err("Unable to load target_core_pscsi\n");
-
-	ret = request_module("target_core_stgt");
-	if (ret != 0)
-		pr_err("Unable to load target_core_stgt\n");
-
-	return 0;
-}
-
-int transport_subsystem_check_init(void)
-{
-	int ret;
-
-	if (sub_api_initialized)
-		return 0;
-	/*
-	 * Request the loading of known TCM subsystem plugins..
-	 */
-	ret = transport_subsystem_reqmods();
-	if (ret < 0)
-		return ret;
-
-	sub_api_initialized = 1;
-	return 0;
-}
-
 struct se_session *transport_init_session(void)
 {
 	struct se_session *se_sess;
Index: lio-core/include/target/target_core_transport.h
===================================================================
--- lio-core.orig/include/target/target_core_transport.h	2011-10-18 11:12:09.868352883 +0200
+++ lio-core/include/target/target_core_transport.h	2011-10-18 11:12:12.732436987 +0200
@@ -113,7 +113,6 @@ extern int init_se_kmem_caches(void);
 extern void release_se_kmem_caches(void);
 extern u32 scsi_get_new_index(scsi_index_t);
 extern void transport_init_queue_obj(struct se_queue_obj *);
-extern int transport_subsystem_check_init(void);
 extern int transport_subsystem_register(struct se_subsystem_api *);
 extern void transport_subsystem_release(struct se_subsystem_api *);
 extern void transport_load_plugins(void);
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux