diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-11 16:29:47 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-16 20:35:14 -0400 |
commit | 182a9e2cef7bb7017f95bd1b9f27fb81b97f07de (patch) | |
tree | 261c5a6729c13b39d8fb6a865c71c2bce80ccad6 /drivers/target | |
parent | 14150a6bbe9e15ce8e7a4f79047c2b4284a51b3d (diff) |
Revert "target: Do not special-case loop and iscsi fabric module loads"
Existing lio_dump.py code expects this to be in place for /iscsi.
Revert for now to avoid userspace breakage in lio-utils
This reverts commit fd88a785f9ac5d6be437c528571ccd85cdf2d493.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_configfs.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 37c4bf3be43a..801efa892046 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -122,9 +122,47 @@ static struct config_group *target_core_register_fabric( | |||
122 | const char *name) | 122 | const char *name) |
123 | { | 123 | { |
124 | struct target_fabric_configfs *tf; | 124 | struct target_fabric_configfs *tf; |
125 | int ret; | ||
125 | 126 | ||
126 | pr_debug("Target_Core_ConfigFS: REGISTER -> group: %p name:" | 127 | pr_debug("Target_Core_ConfigFS: REGISTER -> group: %p name:" |
127 | " %s\n", group, name); | 128 | " %s\n", group, name); |
129 | /* | ||
130 | * Below are some hardcoded request_module() calls to automatically | ||
131 | * local fabric modules when the following is called: | ||
132 | * | ||
133 | * mkdir -p /sys/kernel/config/target/$MODULE_NAME | ||
134 | * | ||
135 | * Note that this does not limit which TCM fabric module can be | ||
136 | * registered, but simply provids auto loading logic for modules with | ||
137 | * mkdir(2) system calls with known TCM fabric modules. | ||
138 | */ | ||
139 | if (!strncmp(name, "iscsi", 5)) { | ||
140 | /* | ||
141 | * Automatically load the LIO Target fabric module when the | ||
142 | * following is called: | ||
143 | * | ||
144 | * mkdir -p $CONFIGFS/target/iscsi | ||
145 | */ | ||
146 | ret = request_module("iscsi_target_mod"); | ||
147 | if (ret < 0) { | ||
148 | pr_err("request_module() failed for" | ||
149 | " iscsi_target_mod.ko: %d\n", ret); | ||
150 | return ERR_PTR(-EINVAL); | ||
151 | } | ||
152 | } else if (!strncmp(name, "loopback", 8)) { | ||
153 | /* | ||
154 | * Automatically load the tcm_loop fabric module when the | ||
155 | * following is called: | ||
156 | * | ||
157 | * mkdir -p $CONFIGFS/target/loopback | ||
158 | */ | ||
159 | ret = request_module("tcm_loop"); | ||
160 | if (ret < 0) { | ||
161 | pr_err("request_module() failed for" | ||
162 | " tcm_loop.ko: %d\n", ret); | ||
163 | return ERR_PTR(-EINVAL); | ||
164 | } | ||
165 | } | ||
128 | 166 | ||
129 | tf = target_core_get_fabric(name); | 167 | tf = target_core_get_fabric(name); |
130 | if (!tf) { | 168 | if (!tf) { |