From 1656efe689f9f4aaaebf34238e8a795f3d9edc86 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 3 Jul 2015 04:21:52 +0000 Subject: [PATCH] iscsi-scst: small post-r6315 cleanup Avoid that rd_task declared when it is not used git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6408 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 8 ++++++-- iscsi-scst/kernel/iscsi.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index bd9251016..b1442504b 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -2309,6 +2309,11 @@ static void __cmnd_abort(struct iscsi_cmnd *cmnd) unsigned long timeout_time = jiffies + ISCSI_TM_DATA_WAIT_TIMEOUT + ISCSI_ADD_SCHED_TIME; struct iscsi_conn *conn = cmnd->conn; +#ifdef CONFIG_SCST_EXTRACHECKS + struct task_struct *rdt = cmnd->conn->rd_task; +#else + struct task_struct *rdt = NULL; +#endif TRACE_MGMT_DBG("Aborting cmd %p, scst_cmd %p (scst state %x, " "ref_cnt %d, on_write_timeout_list %d, write_start %ld, ITT %x, " @@ -2322,8 +2327,7 @@ static void __cmnd_abort(struct iscsi_cmnd *cmnd) cmnd->r2t_len_to_send, cmnd_scsicode(cmnd), cmnd_write_size(cmnd), cmnd->outstanding_r2t, cmnd->conn->session->exp_cmd_sn, cmnd->conn, - cmnd->conn->rd_task, cmnd->conn->read_cmnd, - cmnd->conn->read_state); + rdt, cmnd->conn->read_cmnd, cmnd->conn->read_state); #if defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION) TRACE_MGMT_DBG("net_ref_cnt %d", atomic_read(&cmnd->net_ref_cnt)); diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index 5875fbd2a..908068bd0 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -280,7 +280,9 @@ struct iscsi_conn { struct list_head rd_list_entry; +#ifdef CONFIG_SCST_EXTRACHECKS struct task_struct *rd_task; +#endif unsigned long last_rcv_time;