diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2017-05-23 19:48:50 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-01 14:44:49 -0400 |
commit | 8a47aa9dc636db851254615ea79ba91a52cf9206 (patch) | |
tree | c757f3585118dc416048c693dd7b8a9c7e7d0494 | |
parent | d744644ad7088ec04c0e1ad7c6c1adcec849c51c (diff) |
target/iscsi: Simplify timer manipulation code
Move timer initialization from before add_timer() to the context
where the containing object is initialized. Use setup_timer() and
mod_timer() instead of open coding these. Use 'jiffies' instead
of get_jiffies_64() when calculating expiry times because expiry
times have type unsigned long, just like 'jiffies'.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
-rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 3 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl0.c | 10 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl0.h | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl1.c | 8 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl1.h | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 16 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.h | 1 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_nego.c | 8 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_util.c | 26 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_util.h | 2 |
10 files changed, 34 insertions, 42 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 5001261f5d69..7d619160b3d3 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -372,6 +372,9 @@ struct iscsi_np *iscsit_add_np( | |||
372 | init_completion(&np->np_restart_comp); | 372 | init_completion(&np->np_restart_comp); |
373 | INIT_LIST_HEAD(&np->np_list); | 373 | INIT_LIST_HEAD(&np->np_list); |
374 | 374 | ||
375 | setup_timer(&np->np_login_timer, iscsi_handle_login_thread_timeout, | ||
376 | (unsigned long)np); | ||
377 | |||
375 | ret = iscsi_target_setup_login_socket(np, sockaddr); | 378 | ret = iscsi_target_setup_login_socket(np, sockaddr); |
376 | if (ret != 0) { | 379 | if (ret != 0) { |
377 | kfree(np); | 380 | kfree(np); |
diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c index 7fe2aa73cff6..f164098594e9 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.c +++ b/drivers/target/iscsi/iscsi_target_erl0.c | |||
@@ -749,7 +749,7 @@ int iscsit_check_post_dataout( | |||
749 | } | 749 | } |
750 | } | 750 | } |
751 | 751 | ||
752 | static void iscsit_handle_time2retain_timeout(unsigned long data) | 752 | void iscsit_handle_time2retain_timeout(unsigned long data) |
753 | { | 753 | { |
754 | struct iscsi_session *sess = (struct iscsi_session *) data; | 754 | struct iscsi_session *sess = (struct iscsi_session *) data; |
755 | struct iscsi_portal_group *tpg = sess->tpg; | 755 | struct iscsi_portal_group *tpg = sess->tpg; |
@@ -809,14 +809,10 @@ void iscsit_start_time2retain_handler(struct iscsi_session *sess) | |||
809 | pr_debug("Starting Time2Retain timer for %u seconds on" | 809 | pr_debug("Starting Time2Retain timer for %u seconds on" |
810 | " SID: %u\n", sess->sess_ops->DefaultTime2Retain, sess->sid); | 810 | " SID: %u\n", sess->sess_ops->DefaultTime2Retain, sess->sid); |
811 | 811 | ||
812 | init_timer(&sess->time2retain_timer); | ||
813 | sess->time2retain_timer.expires = | ||
814 | (get_jiffies_64() + sess->sess_ops->DefaultTime2Retain * HZ); | ||
815 | sess->time2retain_timer.data = (unsigned long)sess; | ||
816 | sess->time2retain_timer.function = iscsit_handle_time2retain_timeout; | ||
817 | sess->time2retain_timer_flags &= ~ISCSI_TF_STOP; | 812 | sess->time2retain_timer_flags &= ~ISCSI_TF_STOP; |
818 | sess->time2retain_timer_flags |= ISCSI_TF_RUNNING; | 813 | sess->time2retain_timer_flags |= ISCSI_TF_RUNNING; |
819 | add_timer(&sess->time2retain_timer); | 814 | mod_timer(&sess->time2retain_timer, |
815 | jiffies + sess->sess_ops->DefaultTime2Retain * HZ); | ||
820 | } | 816 | } |
821 | 817 | ||
822 | /* | 818 | /* |
diff --git a/drivers/target/iscsi/iscsi_target_erl0.h b/drivers/target/iscsi/iscsi_target_erl0.h index 3822d9cd1230..97e4ae728926 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.h +++ b/drivers/target/iscsi/iscsi_target_erl0.h | |||
@@ -11,6 +11,7 @@ extern void iscsit_set_dataout_sequence_values(struct iscsi_cmd *); | |||
11 | extern int iscsit_check_pre_dataout(struct iscsi_cmd *, unsigned char *); | 11 | extern int iscsit_check_pre_dataout(struct iscsi_cmd *, unsigned char *); |
12 | extern int iscsit_check_post_dataout(struct iscsi_cmd *, unsigned char *, u8); | 12 | extern int iscsit_check_post_dataout(struct iscsi_cmd *, unsigned char *, u8); |
13 | extern void iscsit_start_time2retain_handler(struct iscsi_session *); | 13 | extern void iscsit_start_time2retain_handler(struct iscsi_session *); |
14 | extern void iscsit_handle_time2retain_timeout(unsigned long data); | ||
14 | extern int iscsit_stop_time2retain_timer(struct iscsi_session *); | 15 | extern int iscsit_stop_time2retain_timer(struct iscsi_session *); |
15 | extern void iscsit_connection_reinstatement_rcfr(struct iscsi_conn *); | 16 | extern void iscsit_connection_reinstatement_rcfr(struct iscsi_conn *); |
16 | extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int); | 17 | extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int); |
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c index fe9b7f1e44ac..19b28255b687 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.c +++ b/drivers/target/iscsi/iscsi_target_erl1.c | |||
@@ -1148,7 +1148,7 @@ static int iscsit_set_dataout_timeout_values( | |||
1148 | /* | 1148 | /* |
1149 | * NOTE: Called from interrupt (timer) context. | 1149 | * NOTE: Called from interrupt (timer) context. |
1150 | */ | 1150 | */ |
1151 | static void iscsit_handle_dataout_timeout(unsigned long data) | 1151 | void iscsit_handle_dataout_timeout(unsigned long data) |
1152 | { | 1152 | { |
1153 | u32 pdu_length = 0, pdu_offset = 0; | 1153 | u32 pdu_length = 0, pdu_offset = 0; |
1154 | u32 r2t_length = 0, r2t_offset = 0; | 1154 | u32 r2t_length = 0, r2t_offset = 0; |
@@ -1264,13 +1264,9 @@ void iscsit_start_dataout_timer( | |||
1264 | pr_debug("Starting DataOUT timer for ITT: 0x%08x on" | 1264 | pr_debug("Starting DataOUT timer for ITT: 0x%08x on" |
1265 | " CID: %hu.\n", cmd->init_task_tag, conn->cid); | 1265 | " CID: %hu.\n", cmd->init_task_tag, conn->cid); |
1266 | 1266 | ||
1267 | init_timer(&cmd->dataout_timer); | ||
1268 | cmd->dataout_timer.expires = (get_jiffies_64() + na->dataout_timeout * HZ); | ||
1269 | cmd->dataout_timer.data = (unsigned long)cmd; | ||
1270 | cmd->dataout_timer.function = iscsit_handle_dataout_timeout; | ||
1271 | cmd->dataout_timer_flags &= ~ISCSI_TF_STOP; | 1267 | cmd->dataout_timer_flags &= ~ISCSI_TF_STOP; |
1272 | cmd->dataout_timer_flags |= ISCSI_TF_RUNNING; | 1268 | cmd->dataout_timer_flags |= ISCSI_TF_RUNNING; |
1273 | add_timer(&cmd->dataout_timer); | 1269 | mod_timer(&cmd->dataout_timer, jiffies + na->dataout_timeout * HZ); |
1274 | } | 1270 | } |
1275 | 1271 | ||
1276 | void iscsit_stop_dataout_timer(struct iscsi_cmd *cmd) | 1272 | void iscsit_stop_dataout_timer(struct iscsi_cmd *cmd) |
diff --git a/drivers/target/iscsi/iscsi_target_erl1.h b/drivers/target/iscsi/iscsi_target_erl1.h index 54d36bd25bea..0ff6e310ca36 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.h +++ b/drivers/target/iscsi/iscsi_target_erl1.h | |||
@@ -29,6 +29,7 @@ extern int iscsit_execute_ooo_cmdsns(struct iscsi_session *); | |||
29 | extern int iscsit_execute_cmd(struct iscsi_cmd *, int); | 29 | extern int iscsit_execute_cmd(struct iscsi_cmd *, int); |
30 | extern int iscsit_handle_ooo_cmdsn(struct iscsi_session *, struct iscsi_cmd *, u32); | 30 | extern int iscsit_handle_ooo_cmdsn(struct iscsi_session *, struct iscsi_cmd *, u32); |
31 | extern void iscsit_remove_ooo_cmdsn(struct iscsi_session *, struct iscsi_ooo_cmdsn *); | 31 | extern void iscsit_remove_ooo_cmdsn(struct iscsi_session *, struct iscsi_ooo_cmdsn *); |
32 | extern void iscsit_handle_dataout_timeout(unsigned long data); | ||
32 | extern void iscsit_mod_dataout_timer(struct iscsi_cmd *); | 33 | extern void iscsit_mod_dataout_timer(struct iscsi_cmd *); |
33 | extern void iscsit_start_dataout_timer(struct iscsi_cmd *, struct iscsi_conn *); | 34 | extern void iscsit_start_dataout_timer(struct iscsi_cmd *, struct iscsi_conn *); |
34 | extern void iscsit_stop_dataout_timer(struct iscsi_cmd *); | 35 | extern void iscsit_stop_dataout_timer(struct iscsi_cmd *); |
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index dc13afbd4c88..8be9221b6b9d 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c | |||
@@ -333,6 +333,9 @@ static int iscsi_login_zero_tsih_s1( | |||
333 | spin_lock_init(&sess->session_usage_lock); | 333 | spin_lock_init(&sess->session_usage_lock); |
334 | spin_lock_init(&sess->ttt_lock); | 334 | spin_lock_init(&sess->ttt_lock); |
335 | 335 | ||
336 | setup_timer(&sess->time2retain_timer, iscsit_handle_time2retain_timeout, | ||
337 | (unsigned long)sess); | ||
338 | |||
336 | idr_preload(GFP_KERNEL); | 339 | idr_preload(GFP_KERNEL); |
337 | spin_lock_bh(&sess_idr_lock); | 340 | spin_lock_bh(&sess_idr_lock); |
338 | ret = idr_alloc(&sess_idr, NULL, 0, 0, GFP_NOWAIT); | 341 | ret = idr_alloc(&sess_idr, NULL, 0, 0, GFP_NOWAIT); |
@@ -839,7 +842,7 @@ void iscsi_post_login_handler( | |||
839 | iscsit_dec_conn_usage_count(conn); | 842 | iscsit_dec_conn_usage_count(conn); |
840 | } | 843 | } |
841 | 844 | ||
842 | static void iscsi_handle_login_thread_timeout(unsigned long data) | 845 | void iscsi_handle_login_thread_timeout(unsigned long data) |
843 | { | 846 | { |
844 | struct iscsi_np *np = (struct iscsi_np *) data; | 847 | struct iscsi_np *np = (struct iscsi_np *) data; |
845 | 848 | ||
@@ -866,13 +869,9 @@ static void iscsi_start_login_thread_timer(struct iscsi_np *np) | |||
866 | * point we do not have access to ISCSI_TPG_ATTRIB(tpg)->login_timeout | 869 | * point we do not have access to ISCSI_TPG_ATTRIB(tpg)->login_timeout |
867 | */ | 870 | */ |
868 | spin_lock_bh(&np->np_thread_lock); | 871 | spin_lock_bh(&np->np_thread_lock); |
869 | init_timer(&np->np_login_timer); | ||
870 | np->np_login_timer.expires = (get_jiffies_64() + TA_LOGIN_TIMEOUT * HZ); | ||
871 | np->np_login_timer.data = (unsigned long)np; | ||
872 | np->np_login_timer.function = iscsi_handle_login_thread_timeout; | ||
873 | np->np_login_timer_flags &= ~ISCSI_TF_STOP; | 872 | np->np_login_timer_flags &= ~ISCSI_TF_STOP; |
874 | np->np_login_timer_flags |= ISCSI_TF_RUNNING; | 873 | np->np_login_timer_flags |= ISCSI_TF_RUNNING; |
875 | add_timer(&np->np_login_timer); | 874 | mod_timer(&np->np_login_timer, jiffies + TA_LOGIN_TIMEOUT * HZ); |
876 | 875 | ||
877 | pr_debug("Added timeout timer to iSCSI login request for" | 876 | pr_debug("Added timeout timer to iSCSI login request for" |
878 | " %u seconds.\n", TA_LOGIN_TIMEOUT); | 877 | " %u seconds.\n", TA_LOGIN_TIMEOUT); |
@@ -1266,6 +1265,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | |||
1266 | pr_debug("Moving to TARG_CONN_STATE_FREE.\n"); | 1265 | pr_debug("Moving to TARG_CONN_STATE_FREE.\n"); |
1267 | conn->conn_state = TARG_CONN_STATE_FREE; | 1266 | conn->conn_state = TARG_CONN_STATE_FREE; |
1268 | 1267 | ||
1268 | setup_timer(&conn->nopin_response_timer, | ||
1269 | iscsit_handle_nopin_response_timeout, (unsigned long)conn); | ||
1270 | setup_timer(&conn->nopin_timer, iscsit_handle_nopin_timeout, | ||
1271 | (unsigned long)conn); | ||
1272 | |||
1269 | if (iscsit_conn_set_transport(conn, np->np_transport) < 0) { | 1273 | if (iscsit_conn_set_transport(conn, np->np_transport) < 0) { |
1270 | kfree(conn); | 1274 | kfree(conn); |
1271 | return 1; | 1275 | return 1; |
diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h index 0e1fd6cedd54..f77850bf3e58 100644 --- a/drivers/target/iscsi/iscsi_target_login.h +++ b/drivers/target/iscsi/iscsi_target_login.h | |||
@@ -24,5 +24,6 @@ extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8) | |||
24 | extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *, | 24 | extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *, |
25 | bool, bool); | 25 | bool, bool); |
26 | extern int iscsi_target_login_thread(void *); | 26 | extern int iscsi_target_login_thread(void *); |
27 | extern void iscsi_handle_login_thread_timeout(unsigned long data); | ||
27 | 28 | ||
28 | #endif /*** ISCSI_TARGET_LOGIN_H ***/ | 29 | #endif /*** ISCSI_TARGET_LOGIN_H ***/ |
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 7a6751fecd32..c851bd9f3175 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c | |||
@@ -618,11 +618,9 @@ static void iscsi_target_do_login_rx(struct work_struct *work) | |||
618 | conn->login_kworker = current; | 618 | conn->login_kworker = current; |
619 | allow_signal(SIGINT); | 619 | allow_signal(SIGINT); |
620 | 620 | ||
621 | init_timer(&login_timer); | 621 | setup_timer_on_stack(&login_timer, iscsi_target_login_timeout, |
622 | login_timer.expires = (get_jiffies_64() + TA_LOGIN_TIMEOUT * HZ); | 622 | (unsigned long)conn); |
623 | login_timer.data = (unsigned long)conn; | 623 | mod_timer(&login_timer, jiffies + TA_LOGIN_TIMEOUT * HZ); |
624 | login_timer.function = iscsi_target_login_timeout; | ||
625 | add_timer(&login_timer); | ||
626 | pr_debug("Starting login_timer for %s/%d\n", current->comm, current->pid); | 624 | pr_debug("Starting login_timer for %s/%d\n", current->comm, current->pid); |
627 | 625 | ||
628 | rc = conn->conn_transport->iscsit_get_login_rx(conn, login); | 626 | rc = conn->conn_transport->iscsit_get_login_rx(conn, login); |
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 1e36f83b5961..505dad5dab7f 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
@@ -176,6 +176,8 @@ struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *conn, int state) | |||
176 | spin_lock_init(&cmd->istate_lock); | 176 | spin_lock_init(&cmd->istate_lock); |
177 | spin_lock_init(&cmd->error_lock); | 177 | spin_lock_init(&cmd->error_lock); |
178 | spin_lock_init(&cmd->r2t_lock); | 178 | spin_lock_init(&cmd->r2t_lock); |
179 | setup_timer(&cmd->dataout_timer, iscsit_handle_dataout_timeout, | ||
180 | (unsigned long)cmd); | ||
179 | 181 | ||
180 | return cmd; | 182 | return cmd; |
181 | } | 183 | } |
@@ -880,7 +882,7 @@ static int iscsit_add_nopin(struct iscsi_conn *conn, int want_response) | |||
880 | return 0; | 882 | return 0; |
881 | } | 883 | } |
882 | 884 | ||
883 | static void iscsit_handle_nopin_response_timeout(unsigned long data) | 885 | void iscsit_handle_nopin_response_timeout(unsigned long data) |
884 | { | 886 | { |
885 | struct iscsi_conn *conn = (struct iscsi_conn *) data; | 887 | struct iscsi_conn *conn = (struct iscsi_conn *) data; |
886 | 888 | ||
@@ -949,14 +951,10 @@ void iscsit_start_nopin_response_timer(struct iscsi_conn *conn) | |||
949 | return; | 951 | return; |
950 | } | 952 | } |
951 | 953 | ||
952 | init_timer(&conn->nopin_response_timer); | ||
953 | conn->nopin_response_timer.expires = | ||
954 | (get_jiffies_64() + na->nopin_response_timeout * HZ); | ||
955 | conn->nopin_response_timer.data = (unsigned long)conn; | ||
956 | conn->nopin_response_timer.function = iscsit_handle_nopin_response_timeout; | ||
957 | conn->nopin_response_timer_flags &= ~ISCSI_TF_STOP; | 954 | conn->nopin_response_timer_flags &= ~ISCSI_TF_STOP; |
958 | conn->nopin_response_timer_flags |= ISCSI_TF_RUNNING; | 955 | conn->nopin_response_timer_flags |= ISCSI_TF_RUNNING; |
959 | add_timer(&conn->nopin_response_timer); | 956 | mod_timer(&conn->nopin_response_timer, |
957 | jiffies + na->nopin_response_timeout * HZ); | ||
960 | 958 | ||
961 | pr_debug("Started NOPIN Response Timer on CID: %d to %u" | 959 | pr_debug("Started NOPIN Response Timer on CID: %d to %u" |
962 | " seconds\n", conn->cid, na->nopin_response_timeout); | 960 | " seconds\n", conn->cid, na->nopin_response_timeout); |
@@ -980,7 +978,7 @@ void iscsit_stop_nopin_response_timer(struct iscsi_conn *conn) | |||
980 | spin_unlock_bh(&conn->nopin_timer_lock); | 978 | spin_unlock_bh(&conn->nopin_timer_lock); |
981 | } | 979 | } |
982 | 980 | ||
983 | static void iscsit_handle_nopin_timeout(unsigned long data) | 981 | void iscsit_handle_nopin_timeout(unsigned long data) |
984 | { | 982 | { |
985 | struct iscsi_conn *conn = (struct iscsi_conn *) data; | 983 | struct iscsi_conn *conn = (struct iscsi_conn *) data; |
986 | 984 | ||
@@ -1015,13 +1013,9 @@ void __iscsit_start_nopin_timer(struct iscsi_conn *conn) | |||
1015 | if (conn->nopin_timer_flags & ISCSI_TF_RUNNING) | 1013 | if (conn->nopin_timer_flags & ISCSI_TF_RUNNING) |
1016 | return; | 1014 | return; |
1017 | 1015 | ||
1018 | init_timer(&conn->nopin_timer); | ||
1019 | conn->nopin_timer.expires = (get_jiffies_64() + na->nopin_timeout * HZ); | ||
1020 | conn->nopin_timer.data = (unsigned long)conn; | ||
1021 | conn->nopin_timer.function = iscsit_handle_nopin_timeout; | ||
1022 | conn->nopin_timer_flags &= ~ISCSI_TF_STOP; | 1016 | conn->nopin_timer_flags &= ~ISCSI_TF_STOP; |
1023 | conn->nopin_timer_flags |= ISCSI_TF_RUNNING; | 1017 | conn->nopin_timer_flags |= ISCSI_TF_RUNNING; |
1024 | add_timer(&conn->nopin_timer); | 1018 | mod_timer(&conn->nopin_timer, jiffies + na->nopin_timeout * HZ); |
1025 | 1019 | ||
1026 | pr_debug("Started NOPIN Timer on CID: %d at %u second" | 1020 | pr_debug("Started NOPIN Timer on CID: %d at %u second" |
1027 | " interval\n", conn->cid, na->nopin_timeout); | 1021 | " interval\n", conn->cid, na->nopin_timeout); |
@@ -1043,13 +1037,9 @@ void iscsit_start_nopin_timer(struct iscsi_conn *conn) | |||
1043 | return; | 1037 | return; |
1044 | } | 1038 | } |
1045 | 1039 | ||
1046 | init_timer(&conn->nopin_timer); | ||
1047 | conn->nopin_timer.expires = (get_jiffies_64() + na->nopin_timeout * HZ); | ||
1048 | conn->nopin_timer.data = (unsigned long)conn; | ||
1049 | conn->nopin_timer.function = iscsit_handle_nopin_timeout; | ||
1050 | conn->nopin_timer_flags &= ~ISCSI_TF_STOP; | 1040 | conn->nopin_timer_flags &= ~ISCSI_TF_STOP; |
1051 | conn->nopin_timer_flags |= ISCSI_TF_RUNNING; | 1041 | conn->nopin_timer_flags |= ISCSI_TF_RUNNING; |
1052 | add_timer(&conn->nopin_timer); | 1042 | mod_timer(&conn->nopin_timer, jiffies + na->nopin_timeout * HZ); |
1053 | 1043 | ||
1054 | pr_debug("Started NOPIN Timer on CID: %d at %u second" | 1044 | pr_debug("Started NOPIN Timer on CID: %d at %u second" |
1055 | " interval\n", conn->cid, na->nopin_timeout); | 1045 | " interval\n", conn->cid, na->nopin_timeout); |
diff --git a/drivers/target/iscsi/iscsi_target_util.h b/drivers/target/iscsi/iscsi_target_util.h index 425160565d0c..78b3b9d20963 100644 --- a/drivers/target/iscsi/iscsi_target_util.h +++ b/drivers/target/iscsi/iscsi_target_util.h | |||
@@ -47,9 +47,11 @@ extern struct iscsi_conn *iscsit_get_conn_from_cid_rcfr(struct iscsi_session *, | |||
47 | extern void iscsit_check_conn_usage_count(struct iscsi_conn *); | 47 | extern void iscsit_check_conn_usage_count(struct iscsi_conn *); |
48 | extern void iscsit_dec_conn_usage_count(struct iscsi_conn *); | 48 | extern void iscsit_dec_conn_usage_count(struct iscsi_conn *); |
49 | extern void iscsit_inc_conn_usage_count(struct iscsi_conn *); | 49 | extern void iscsit_inc_conn_usage_count(struct iscsi_conn *); |
50 | extern void iscsit_handle_nopin_response_timeout(unsigned long data); | ||
50 | extern void iscsit_mod_nopin_response_timer(struct iscsi_conn *); | 51 | extern void iscsit_mod_nopin_response_timer(struct iscsi_conn *); |
51 | extern void iscsit_start_nopin_response_timer(struct iscsi_conn *); | 52 | extern void iscsit_start_nopin_response_timer(struct iscsi_conn *); |
52 | extern void iscsit_stop_nopin_response_timer(struct iscsi_conn *); | 53 | extern void iscsit_stop_nopin_response_timer(struct iscsi_conn *); |
54 | extern void iscsit_handle_nopin_timeout(unsigned long data); | ||
53 | extern void __iscsit_start_nopin_timer(struct iscsi_conn *); | 55 | extern void __iscsit_start_nopin_timer(struct iscsi_conn *); |
54 | extern void iscsit_start_nopin_timer(struct iscsi_conn *); | 56 | extern void iscsit_start_nopin_timer(struct iscsi_conn *); |
55 | extern void iscsit_stop_nopin_timer(struct iscsi_conn *); | 57 | extern void iscsit_stop_nopin_timer(struct iscsi_conn *); |