diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-02-27 01:19:15 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-03-26 17:49:42 -0400 |
commit | 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca (patch) | |
tree | 6bf86917539a632bf8c7425d23e17ecefac83b69 /include/target | |
parent | 5bc6510f919be9875fbbea3d8c1f6f33f9265a31 (diff) |
iscsi-target: Convert iscsi_thread_set usage to kthread.h
This patch converts iscsi-target code to use modern kthread.h API
callers for creating RX/TX threads for each new iscsi_conn descriptor,
and releasing associated RX/TX threads during connection shutdown.
This is done using iscsit_start_kthreads() -> kthread_run() to start
new kthreads from within iscsi_post_login_handler(), and invoking
kthread_stop() from existing iscsit_close_connection() code.
Also, convert iscsit_logout_post_handler_closesession() code to use
cmpxchg when determing when iscsit_cause_connection_reinstatement()
needs to sleep waiting for completion.
Reported-by: Sagi Grimberg <sagig@mellanox.com>
Tested-by: Sagi Grimberg <sagig@mellanox.com>
Cc: Slava Shwartsman <valyushash@gmail.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/iscsi/iscsi_target_core.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h index d3583d3ee193..dd0f3abde75d 100644 --- a/include/target/iscsi/iscsi_target_core.h +++ b/include/target/iscsi/iscsi_target_core.h | |||
@@ -602,6 +602,11 @@ struct iscsi_conn { | |||
602 | struct iscsi_session *sess; | 602 | struct iscsi_session *sess; |
603 | /* Pointer to thread_set in use for this conn's threads */ | 603 | /* Pointer to thread_set in use for this conn's threads */ |
604 | struct iscsi_thread_set *thread_set; | 604 | struct iscsi_thread_set *thread_set; |
605 | int bitmap_id; | ||
606 | int rx_thread_active; | ||
607 | struct task_struct *rx_thread; | ||
608 | int tx_thread_active; | ||
609 | struct task_struct *tx_thread; | ||
605 | /* list_head for session connection list */ | 610 | /* list_head for session connection list */ |
606 | struct list_head conn_list; | 611 | struct list_head conn_list; |
607 | } ____cacheline_aligned; | 612 | } ____cacheline_aligned; |
@@ -871,10 +876,12 @@ struct iscsit_global { | |||
871 | /* Unique identifier used for the authentication daemon */ | 876 | /* Unique identifier used for the authentication daemon */ |
872 | u32 auth_id; | 877 | u32 auth_id; |
873 | u32 inactive_ts; | 878 | u32 inactive_ts; |
879 | #define ISCSIT_BITMAP_BITS 262144 | ||
874 | /* Thread Set bitmap count */ | 880 | /* Thread Set bitmap count */ |
875 | int ts_bitmap_count; | 881 | int ts_bitmap_count; |
876 | /* Thread Set bitmap pointer */ | 882 | /* Thread Set bitmap pointer */ |
877 | unsigned long *ts_bitmap; | 883 | unsigned long *ts_bitmap; |
884 | spinlock_t ts_bitmap_lock; | ||
878 | /* Used for iSCSI discovery session authentication */ | 885 | /* Used for iSCSI discovery session authentication */ |
879 | struct iscsi_node_acl discovery_acl; | 886 | struct iscsi_node_acl discovery_acl; |
880 | struct iscsi_portal_group *discovery_tpg; | 887 | struct iscsi_portal_group *discovery_tpg; |