diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index 8916ce211..f774ebcd3 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -14,6 +14,7 @@ */ #include +#include "iscsi_trace_flag.h" #include "iscsi.h" /* Protected by target_mgmt_mutex */ diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 7fffc6a41..c7397c1c0 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -22,6 +22,7 @@ #else #include "iscsit_transport.h" #endif +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h" diff --git a/iscsi-scst/kernel/digest.c b/iscsi-scst/kernel/digest.c index 29f9e645d..5d682aab5 100644 --- a/iscsi-scst/kernel/digest.c +++ b/iscsi-scst/kernel/digest.c @@ -19,6 +19,7 @@ #include #include +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h" #include diff --git a/iscsi-scst/kernel/event.c b/iscsi-scst/kernel/event.c index 568f24108..4be91d429 100644 --- a/iscsi-scst/kernel/event.c +++ b/iscsi-scst/kernel/event.c @@ -22,6 +22,7 @@ #else #include "iscsi_scst.h" #endif +#include "iscsi_trace_flag.h" #include "iscsi.h" static struct sock *nl; diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 39f4de61e..bd9251016 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -28,6 +28,7 @@ #else #include "iscsit_transport.h" #endif +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h" diff --git a/iscsi-scst/kernel/iscsi_dbg.h b/iscsi-scst/kernel/iscsi_dbg.h index 408cdc4c8..499f01373 100644 --- a/iscsi-scst/kernel/iscsi_dbg.h +++ b/iscsi-scst/kernel/iscsi_dbg.h @@ -55,13 +55,6 @@ extern unsigned long iscsi_get_flow_ctrl_or_mgmt_dbg_log_flag( #define iscsi_get_flow_ctrl_or_mgmt_dbg_log_flag(x) 0 #endif -#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) -extern unsigned long iscsi_trace_flag; -#ifndef trace_flag -#define trace_flag iscsi_trace_flag -#endif -#endif - #define TRACE_CONN_CLOSE(args...) TRACE_DBG_FLAG(TRACE_DEBUG|TRACE_CONN_OC, args) #define TRACE_CONN_CLOSE_DBG(args...) TRACE(TRACE_CONN_OC_DBG, args) #define TRACE_NET_PAGE(args...) TRACE_DBG_FLAG(TRACE_NET_PG, args) diff --git a/iscsi-scst/kernel/iscsi_trace_flag.h b/iscsi-scst/kernel/iscsi_trace_flag.h new file mode 100644 index 000000000..046edd696 --- /dev/null +++ b/iscsi-scst/kernel/iscsi_trace_flag.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2007 - 2014 Vladislav Bolkhovitin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, version 2 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef ISCSI_TRACE_FLAG_H +#define ISCSI_TRACE_FLAG_H + +/* + * Only include this header file from iscsi-scst source files and not from + * isert-scst source files. + */ + +#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) +extern unsigned long iscsi_trace_flag; +#define trace_flag iscsi_trace_flag +#endif + +#endif /* ISCSI_TRACE_FLAG_H */ diff --git a/iscsi-scst/kernel/iscsit_transport.c b/iscsi-scst/kernel/iscsit_transport.c index 35cf66ba6..6b08d9673 100644 --- a/iscsi-scst/kernel/iscsit_transport.c +++ b/iscsi-scst/kernel/iscsit_transport.c @@ -1,5 +1,6 @@ #include +#include "iscsi_trace_flag.h" #ifdef INSIDE_KERNEL_TREE #include #else diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c index 39aaff733..540c14a8f 100644 --- a/iscsi-scst/kernel/isert-scst/iser_buf.c +++ b/iscsi-scst/kernel/isert-scst/iser_buf.c @@ -37,6 +37,7 @@ #include +#include "isert_dbg.h" #include "iser.h" static int isert_buf_alloc_pg(struct ib_device *ib_dev, diff --git a/iscsi-scst/kernel/isert-scst/iser_datamover.c b/iscsi-scst/kernel/isert-scst/iser_datamover.c index 7c6809b6b..7d175241b 100644 --- a/iscsi-scst/kernel/isert-scst/iser_datamover.c +++ b/iscsi-scst/kernel/isert-scst/iser_datamover.c @@ -37,6 +37,7 @@ #include +#include "isert_dbg.h" #include "iser.h" #include "iser_datamover.h" diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index 71f85cd6e..31fe1f306 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -37,6 +37,7 @@ #include +#include "isert_dbg.h" #include "iser.h" static struct isert_global isert_glob; diff --git a/iscsi-scst/kernel/isert-scst/iser_pdu.c b/iscsi-scst/kernel/isert-scst/iser_pdu.c index 667052048..44da27172 100644 --- a/iscsi-scst/kernel/isert-scst/iser_pdu.c +++ b/iscsi-scst/kernel/isert-scst/iser_pdu.c @@ -37,6 +37,7 @@ #include +#include "isert_dbg.h" #include "iser.h" #include "../iscsi.h" #include "iser_datamover.h" diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 93b865400..a2b763ba5 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -39,6 +39,7 @@ #include #include +#include "isert_dbg.h" #include "iser.h" #include "iser_datamover.h" diff --git a/iscsi-scst/kernel/isert-scst/isert.c b/iscsi-scst/kernel/isert-scst/isert.c index 324ebefa9..f3b11ca2b 100644 --- a/iscsi-scst/kernel/isert-scst/isert.c +++ b/iscsi-scst/kernel/isert-scst/isert.c @@ -44,13 +44,12 @@ #else #include "iscsit_transport.h" #endif -#include "isert.h" #include "isert_dbg.h" +#include "isert.h" #include "iser_datamover.h" #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) unsigned long isert_trace_flag = ISERT_DEFAULT_LOG_FLAGS; -unsigned long iscsi_trace_flag = ISERT_DEFAULT_LOG_FLAGS; #endif static unsigned int isert_nr_devs = ISERT_NR_DEVS; diff --git a/iscsi-scst/kernel/isert-scst/isert_dbg.h b/iscsi-scst/kernel/isert-scst/isert_dbg.h index 064c714bf..482c81ca7 100644 --- a/iscsi-scst/kernel/isert-scst/isert_dbg.h +++ b/iscsi-scst/kernel/isert-scst/isert_dbg.h @@ -41,9 +41,6 @@ #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) extern unsigned long isert_trace_flag; -#ifdef trace_flag -#undef trace_flag -#endif #define trace_flag isert_trace_flag #endif diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 688fd637b..f0d6c25bf 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -40,9 +40,9 @@ #include #include #include +#include "isert_dbg.h" #include "../iscsi.h" #include "isert.h" -#include "isert_dbg.h" #include "iser_datamover.h" static unsigned int n_devs; diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index ae4ff7b40..1a0405a41 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -25,6 +25,7 @@ #else #include "iscsit_transport.h" #endif +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h" diff --git a/iscsi-scst/kernel/param.c b/iscsi-scst/kernel/param.c index 3a703bf3b..0e300231f 100644 --- a/iscsi-scst/kernel/param.c +++ b/iscsi-scst/kernel/param.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h" diff --git a/iscsi-scst/kernel/session.c b/iscsi-scst/kernel/session.c index d892e5907..4c68f83f9 100644 --- a/iscsi-scst/kernel/session.c +++ b/iscsi-scst/kernel/session.c @@ -14,12 +14,14 @@ * GNU General Public License for more details. */ -#include "iscsi.h" - +#include #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) #include #endif +#include "iscsi_trace_flag.h" +#include "iscsi.h" + /* target_mutex supposed to be locked */ struct iscsi_session *session_lookup(struct iscsi_target *target, u64 sid) { diff --git a/iscsi-scst/kernel/target.c b/iscsi-scst/kernel/target.c index b12fa6889..32adf116a 100644 --- a/iscsi-scst/kernel/target.c +++ b/iscsi-scst/kernel/target.c @@ -17,6 +17,7 @@ #include #include +#include "iscsi_trace_flag.h" #include "iscsi.h" #include "digest.h"