diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-09-06 23:50:36 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-09-10 23:23:30 -0400 |
commit | 12e4101af431b66c734efef9eb359a0b8c6ad90c (patch) | |
tree | 7b05b095437c1732c4d9e90052c7d31de24952d2 /drivers/target/iscsi | |
parent | 5ab41ca467546d18dc793195a7c9f8e307311dbf (diff) |
iscsi-target: Remove unnecessary wait_for_completion in iscsi_get_thread_set
This patch removes an unnecessary wait_for_completion within
iscsi_get_thread_set(), that would wait for 1 second before
trying to obtain an inactive struct iscsi_thread_set from
iscsi_get_ts_from_inactive_list().
Since iscsi_allocate_thread_sets() will already be adding the
newly allocated iscsi_thread_set to the inactive list directly,
there is no need to wait here.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tq.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tq.c b/drivers/target/iscsi/iscsi_target_tq.c index ba0ac41889af..151a585a0895 100644 --- a/drivers/target/iscsi/iscsi_target_tq.c +++ b/drivers/target/iscsi/iscsi_target_tq.c | |||
@@ -222,25 +222,12 @@ void iscsi_activate_thread_set(struct iscsi_conn *conn, struct iscsi_thread_set | |||
222 | 222 | ||
223 | struct iscsi_thread_set *iscsi_get_thread_set(void) | 223 | struct iscsi_thread_set *iscsi_get_thread_set(void) |
224 | { | 224 | { |
225 | int allocate_ts = 0; | 225 | struct iscsi_thread_set *ts; |
226 | struct completion comp; | 226 | |
227 | struct iscsi_thread_set *ts = NULL; | ||
228 | /* | ||
229 | * If no inactive thread set is available on the first call to | ||
230 | * iscsi_get_ts_from_inactive_list(), sleep for a second and | ||
231 | * try again. If still none are available after two attempts, | ||
232 | * allocate a set ourselves. | ||
233 | */ | ||
234 | get_set: | 227 | get_set: |
235 | ts = iscsi_get_ts_from_inactive_list(); | 228 | ts = iscsi_get_ts_from_inactive_list(); |
236 | if (!ts) { | 229 | if (!ts) { |
237 | if (allocate_ts == 2) | 230 | iscsi_allocate_thread_sets(1); |
238 | iscsi_allocate_thread_sets(1); | ||
239 | |||
240 | init_completion(&comp); | ||
241 | wait_for_completion_timeout(&comp, 1 * HZ); | ||
242 | |||
243 | allocate_ts++; | ||
244 | goto get_set; | 231 | goto get_set; |
245 | } | 232 | } |
246 | 233 | ||