|
@@ -176,6 +176,8 @@ struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *conn, int state)
|
|
|
spin_lock_init(&cmd->istate_lock);
|
|
|
spin_lock_init(&cmd->error_lock);
|
|
|
spin_lock_init(&cmd->r2t_lock);
|
|
|
+ setup_timer(&cmd->dataout_timer, iscsit_handle_dataout_timeout,
|
|
|
+ (unsigned long)cmd);
|
|
|
|
|
|
return cmd;
|
|
|
}
|
|
@@ -880,7 +882,7 @@ static int iscsit_add_nopin(struct iscsi_conn *conn, int want_response)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static void iscsit_handle_nopin_response_timeout(unsigned long data)
|
|
|
+void iscsit_handle_nopin_response_timeout(unsigned long data)
|
|
|
{
|
|
|
struct iscsi_conn *conn = (struct iscsi_conn *) data;
|
|
|
|
|
@@ -949,14 +951,10 @@ void iscsit_start_nopin_response_timer(struct iscsi_conn *conn)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- init_timer(&conn->nopin_response_timer);
|
|
|
- conn->nopin_response_timer.expires =
|
|
|
- (get_jiffies_64() + na->nopin_response_timeout * HZ);
|
|
|
- conn->nopin_response_timer.data = (unsigned long)conn;
|
|
|
- conn->nopin_response_timer.function = iscsit_handle_nopin_response_timeout;
|
|
|
conn->nopin_response_timer_flags &= ~ISCSI_TF_STOP;
|
|
|
conn->nopin_response_timer_flags |= ISCSI_TF_RUNNING;
|
|
|
- add_timer(&conn->nopin_response_timer);
|
|
|
+ mod_timer(&conn->nopin_response_timer,
|
|
|
+ jiffies + na->nopin_response_timeout * HZ);
|
|
|
|
|
|
pr_debug("Started NOPIN Response Timer on CID: %d to %u"
|
|
|
" seconds\n", conn->cid, na->nopin_response_timeout);
|
|
@@ -980,7 +978,7 @@ void iscsit_stop_nopin_response_timer(struct iscsi_conn *conn)
|
|
|
spin_unlock_bh(&conn->nopin_timer_lock);
|
|
|
}
|
|
|
|
|
|
-static void iscsit_handle_nopin_timeout(unsigned long data)
|
|
|
+void iscsit_handle_nopin_timeout(unsigned long data)
|
|
|
{
|
|
|
struct iscsi_conn *conn = (struct iscsi_conn *) data;
|
|
|
|
|
@@ -1015,13 +1013,9 @@ void __iscsit_start_nopin_timer(struct iscsi_conn *conn)
|
|
|
if (conn->nopin_timer_flags & ISCSI_TF_RUNNING)
|
|
|
return;
|
|
|
|
|
|
- init_timer(&conn->nopin_timer);
|
|
|
- conn->nopin_timer.expires = (get_jiffies_64() + na->nopin_timeout * HZ);
|
|
|
- conn->nopin_timer.data = (unsigned long)conn;
|
|
|
- conn->nopin_timer.function = iscsit_handle_nopin_timeout;
|
|
|
conn->nopin_timer_flags &= ~ISCSI_TF_STOP;
|
|
|
conn->nopin_timer_flags |= ISCSI_TF_RUNNING;
|
|
|
- add_timer(&conn->nopin_timer);
|
|
|
+ mod_timer(&conn->nopin_timer, jiffies + na->nopin_timeout * HZ);
|
|
|
|
|
|
pr_debug("Started NOPIN Timer on CID: %d at %u second"
|
|
|
" interval\n", conn->cid, na->nopin_timeout);
|
|
@@ -1043,13 +1037,9 @@ void iscsit_start_nopin_timer(struct iscsi_conn *conn)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- init_timer(&conn->nopin_timer);
|
|
|
- conn->nopin_timer.expires = (get_jiffies_64() + na->nopin_timeout * HZ);
|
|
|
- conn->nopin_timer.data = (unsigned long)conn;
|
|
|
- conn->nopin_timer.function = iscsit_handle_nopin_timeout;
|
|
|
conn->nopin_timer_flags &= ~ISCSI_TF_STOP;
|
|
|
conn->nopin_timer_flags |= ISCSI_TF_RUNNING;
|
|
|
- add_timer(&conn->nopin_timer);
|
|
|
+ mod_timer(&conn->nopin_timer, jiffies + na->nopin_timeout * HZ);
|
|
|
|
|
|
pr_debug("Started NOPIN Timer on CID: %d at %u second"
|
|
|
" interval\n", conn->cid, na->nopin_timeout);
|