iscsi-target: Add thread_set->ts_activate_sem + use common deallocate
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 5 Sep 2013 23:13:41 +0000 (16:13 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 11 Sep 2013 03:23:05 +0000 (20:23 -0700)
commit5ab41ca467546d18dc793195a7c9f8e307311dbf
treeef07b8dac736e04c7cfe0b4dd5b51add5aec9e6a
parentd5705c4ab5035be618a34c95505727acac2e70ec
iscsi-target: Add thread_set->ts_activate_sem + use common deallocate

This patch removes the iscsi_thread_set->[rx,tx]_post_start_comp that
was originally used synchronize startup between rx and tx threads within
a single thread_set.

Instead, use a single ->ts_activate_sem in iscsi_activate_thread_set()
to wait for both processes to awake in the RX/TX pre handlers.

Also, go ahead and refactor thread_set deallocate code into a common
iscsi_deallocate_thread_one(), and update iscsi_deallocate_thread_sets()
and iscsi_deallocate_extra_thread_sets() use this code

v3 changes:
  - Make iscsi_deallocate_thread_one defined as static (Fengguang)

v2 changes:
  - Set ISCSI_THREAD_SET_ACTIVE before calling complete in
    iscsi_activate_thread_set
  - Protect ts->conn sanity checks with ->ts_state_lock in
    RX/TX pre handlers
  - Add ->ts_activate_sem to save extra context switches per
    iscsi_activate_thread_set() call.
  - Refactor thread_set shutdown into iscsi_deallocate_thread_one()

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_tq.c
drivers/target/iscsi/iscsi_target_tq.h