mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-20 06:52:18 +00:00
Convert setup_timer() into timer_setup() calls
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -579,9 +579,9 @@ static void iscsi_write_space_ready(struct sock *sk)
|
||||
return;
|
||||
}
|
||||
|
||||
static void conn_rsp_timer_fn(unsigned long arg)
|
||||
static void conn_rsp_timer_fn(struct timer_list *timer)
|
||||
{
|
||||
struct iscsi_conn *conn = (struct iscsi_conn *)arg;
|
||||
struct iscsi_conn *conn = container_of(timer, typeof(*conn), rsp_timer);
|
||||
struct iscsi_cmnd *cmnd;
|
||||
unsigned long j = jiffies;
|
||||
|
||||
@@ -952,7 +952,7 @@ int iscsi_init_conn(struct iscsi_session *session,
|
||||
spin_lock_init(&conn->write_list_lock);
|
||||
INIT_LIST_HEAD(&conn->write_list);
|
||||
INIT_LIST_HEAD(&conn->write_timeout_list);
|
||||
setup_timer(&conn->rsp_timer, conn_rsp_timer_fn, (unsigned long)conn);
|
||||
timer_setup(&conn->rsp_timer, conn_rsp_timer_fn, 0);
|
||||
init_waitqueue_head(&conn->read_state_waitQ);
|
||||
init_completion(&conn->ready_to_free);
|
||||
INIT_LIST_HEAD(&conn->reinst_pending_cmd_list);
|
||||
|
||||
@@ -135,9 +135,10 @@ static void isert_close_conn_fn(struct work_struct *work)
|
||||
isert_close_connection(conn);
|
||||
}
|
||||
|
||||
static void isert_conn_timer_fn(unsigned long arg)
|
||||
static void isert_conn_timer_fn(struct timer_list *timer)
|
||||
{
|
||||
struct isert_conn_dev *conn_dev = (struct isert_conn_dev *)arg;
|
||||
struct isert_conn_dev *conn_dev = container_of(timer, typeof(*conn_dev),
|
||||
tmo_timer);
|
||||
struct iscsi_conn *conn = conn_dev->conn;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -171,8 +172,7 @@ static int add_new_connection(struct isert_listener_dev *dev,
|
||||
INIT_WORK(&conn->close_work, isert_close_conn_fn);
|
||||
#endif
|
||||
|
||||
setup_timer(&conn_dev->tmo_timer, isert_conn_timer_fn,
|
||||
(unsigned long)conn_dev);
|
||||
timer_setup(&conn_dev->tmo_timer, isert_conn_timer_fn, 0);
|
||||
conn_dev->tmo_timer.expires = jiffies + 60 * HZ;
|
||||
add_timer(&conn_dev->tmo_timer);
|
||||
conn_dev->timer_active = 1;
|
||||
|
||||
+2
-3
@@ -43,10 +43,9 @@ int qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *, fc_port_t *);
|
||||
|
||||
/* SRB Extensions ---------------------------------------------------------- */
|
||||
|
||||
void
|
||||
qla2x00_sp_timeout(unsigned long __data)
|
||||
void qla2x00_sp_timeout(struct timer_list *timer)
|
||||
{
|
||||
srb_t *sp = (srb_t *)__data;
|
||||
srb_t *sp = container_of(timer, typeof(*sp), u.iocb_cmd.timer);
|
||||
struct srb_iocb *iocb;
|
||||
fc_port_t *fcport = sp->fcport;
|
||||
struct qla_hw_data *ha = fcport->vha->hw;
|
||||
|
||||
@@ -171,8 +171,7 @@ done:
|
||||
static inline void
|
||||
qla2x00_init_timer(srb_t *sp, unsigned long tmo)
|
||||
{
|
||||
setup_timer(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout,
|
||||
(unsigned long)sp);
|
||||
timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0);
|
||||
sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ;
|
||||
add_timer(&sp->u.iocb_cmd.timer);
|
||||
sp->free = qla2x00_sp_free;
|
||||
|
||||
@@ -680,6 +680,21 @@ struct t10_pi_tuple {
|
||||
};
|
||||
#endif
|
||||
|
||||
/* <linux/timer.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
/*
|
||||
* See also commit 686fef928bba ("timer: Prepare to change timer callback
|
||||
* argument type").
|
||||
*/
|
||||
#define timer_setup(_timer, _fn, _flags) do { \
|
||||
init_timer(_timer); \
|
||||
(_timer)->function = (void (*)(unsigned long))(_fn); \
|
||||
(_timer)->data = (unsigned long)(_timer); \
|
||||
(_timer)->flags = (_flags); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* <linux/types.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
|
||||
|
||||
+4
-4
@@ -1685,7 +1685,7 @@ static void scst_release_space(struct scst_cmd *cmd);
|
||||
static void scst_clear_reservation(struct scst_tgt_dev *tgt_dev);
|
||||
static int scst_alloc_add_tgt_dev(struct scst_session *sess,
|
||||
struct scst_acg_dev *acg_dev, struct scst_tgt_dev **out_tgt_dev);
|
||||
static void scst_tgt_retry_timer_fn(unsigned long arg);
|
||||
static void scst_tgt_retry_timer_fn(struct timer_list *timer);
|
||||
|
||||
#ifdef CONFIG_SCST_DEBUG_TM
|
||||
static void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev);
|
||||
@@ -4091,7 +4091,7 @@ int scst_alloc_tgt(struct scst_tgt_template *tgtt, struct scst_tgt **tgt)
|
||||
t->tgt_supported_dif_block_sizes = tgtt->supported_dif_block_sizes;
|
||||
spin_lock_init(&t->tgt_lock);
|
||||
INIT_LIST_HEAD(&t->retry_cmd_list);
|
||||
setup_timer(&t->retry_timer, scst_tgt_retry_timer_fn, (unsigned long)t);
|
||||
timer_setup(&t->retry_timer, scst_tgt_retry_timer_fn, 0);
|
||||
atomic_set(&t->tgt_dif_app_failed_tgt, 0);
|
||||
atomic_set(&t->tgt_dif_ref_failed_tgt, 0);
|
||||
atomic_set(&t->tgt_dif_guard_failed_tgt, 0);
|
||||
@@ -7480,9 +7480,9 @@ void scst_check_retries(struct scst_tgt *tgt)
|
||||
return;
|
||||
}
|
||||
|
||||
static void scst_tgt_retry_timer_fn(unsigned long arg)
|
||||
static void scst_tgt_retry_timer_fn(struct timer_list *timer)
|
||||
{
|
||||
struct scst_tgt *tgt = (struct scst_tgt *)arg;
|
||||
struct scst_tgt *tgt = container_of(timer, typeof(*tgt), retry_timer);
|
||||
unsigned long flags;
|
||||
|
||||
TRACE_RETRY("Retry timer expired (retry_cmds %d)", tgt->retry_cmds);
|
||||
|
||||
Reference in New Issue
Block a user