mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-24 17:12:51 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
+12
-10
@@ -429,8 +429,8 @@ static void __iscsi_state_change(struct sock *sk)
|
||||
|
||||
if (unlikely(sk->sk_state != TCP_ESTABLISHED)) {
|
||||
if (!conn->closing) {
|
||||
PRINT_ERROR("Connection with initiator %s "
|
||||
"unexpectedly closed!",
|
||||
PRINT_ERROR("Connection %p with initiator %s "
|
||||
"unexpectedly closed!", conn,
|
||||
conn->session->initiator_name);
|
||||
TRACE_MGMT_DBG("conn %p, sk state %d", conn,
|
||||
sk->sk_state);
|
||||
@@ -534,11 +534,11 @@ static void conn_rsp_timer_fn(unsigned long arg)
|
||||
if (!conn->closing) {
|
||||
PRINT_ERROR("Timeout %ld sec sending data/waiting "
|
||||
"for reply to/from initiator "
|
||||
"%s (SID %llx), closing connection",
|
||||
"%s (SID %llx), closing connection %p",
|
||||
iscsi_get_timeout(cmnd)/HZ,
|
||||
conn->session->initiator_name,
|
||||
(unsigned long long int)
|
||||
conn->session->sid);
|
||||
(unsigned long long int) conn->session->sid,
|
||||
conn);
|
||||
/*
|
||||
* We must call mark_conn_closed() outside of
|
||||
* write_list_lock or we will have a circular
|
||||
@@ -812,8 +812,9 @@ void conn_free(struct iscsi_conn *conn)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_MGMT_DBG("Freeing conn %p (sess=%p, %#Lx %u)", conn,
|
||||
session, (unsigned long long int)session->sid, conn->cid);
|
||||
TRACE(TRACE_MGMT, "Freeing conn %p (sess=%p, %#Lx %u, initiator %s)",
|
||||
conn, session, (unsigned long long int)session->sid, conn->cid,
|
||||
session->scst_sess->initiator_name);
|
||||
|
||||
lockdep_assert_held(&conn->target->target_mutex);
|
||||
|
||||
@@ -928,8 +929,9 @@ int iscsi_conn_alloc(struct iscsi_session *session,
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
TRACE_MGMT_DBG("Creating connection %p for sid %#Lx, cid %u", conn,
|
||||
(unsigned long long int)session->sid, info->cid);
|
||||
TRACE(TRACE_MGMT, "Creating connection %p for sid %#Lx, cid %u "
|
||||
"(initiator %s)", conn, (unsigned long long int)session->sid,
|
||||
info->cid, session->scst_sess->initiator_name);
|
||||
|
||||
conn->transport = t;
|
||||
|
||||
@@ -1010,7 +1012,7 @@ int __add_conn(struct iscsi_session *session, struct iscsi_kern_conn_info *info)
|
||||
goto out;
|
||||
|
||||
if (reinstatement) {
|
||||
TRACE_MGMT_DBG("Reinstating conn (old %p, new %p)", conn,
|
||||
TRACE(TRACE_MGMT, "Reinstating conn (old %p, new %p)", conn,
|
||||
new_conn);
|
||||
conn->conn_reinst_successor = new_conn;
|
||||
__set_bit(ISCSI_CONN_REINSTATING, &new_conn->conn_aflags);
|
||||
|
||||
+14
-13
@@ -1408,7 +1408,7 @@ static int cmnd_insert_data_wait_hash(struct iscsi_cmnd *cmnd)
|
||||
|
||||
TRACE_DBG("%p:%x", cmnd, itt);
|
||||
if (unlikely(itt == ISCSI_RESERVED_TAG)) {
|
||||
PRINT_ERROR("%s", "ITT is RESERVED_TAG");
|
||||
PRINT_ERROR("ITT is RESERVED_TAG (conn %p)", cmnd->conn);
|
||||
PRINT_BUFFER("Incorrect BHS", &cmnd->pdu.bhs,
|
||||
sizeof(cmnd->pdu.bhs));
|
||||
err = -ISCSI_REASON_PROTOCOL_ERROR;
|
||||
@@ -1426,7 +1426,8 @@ static int cmnd_insert_data_wait_hash(struct iscsi_cmnd *cmnd)
|
||||
list_add_tail(&cmnd->hash_list_entry, head);
|
||||
cmnd->hashed = 1;
|
||||
} else {
|
||||
PRINT_ERROR("Task %x in progress, cmnd %p", itt, cmnd);
|
||||
PRINT_ERROR("Task %x in progress, cmnd %p (conn %p)",
|
||||
itt, cmnd, cmnd->conn);
|
||||
err = -ISCSI_REASON_TASK_IN_PROGRESS;
|
||||
}
|
||||
|
||||
@@ -1644,8 +1645,8 @@ static int cmnd_prepare_recv_pdu(struct iscsi_conn *conn,
|
||||
if (unlikely(i >= ISCSI_CONN_IOV_MAX)) {
|
||||
PRINT_ERROR("Initiator %s violated negotiated "
|
||||
"parameters by sending too much data (size "
|
||||
"left %d)", conn->session->initiator_name,
|
||||
size);
|
||||
"left %d), conn %p", conn->session->initiator_name,
|
||||
size, conn);
|
||||
mark_conn_closed(conn);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
@@ -1883,8 +1884,8 @@ int iscsi_cmnd_set_write_buf(struct iscsi_cmnd *req)
|
||||
unsolicited_data_expected)) {
|
||||
PRINT_ERROR("Initiator %s violated negotiated "
|
||||
"parameters: initial R2T is required (ITT %x, "
|
||||
"op %x)", session->initiator_name,
|
||||
req->pdu.bhs.itt, req_hdr->scb[0]);
|
||||
"op %x, conn %p)", session->initiator_name,
|
||||
req->pdu.bhs.itt, req_hdr->scb[0], conn);
|
||||
res = -EINVAL;
|
||||
goto out_close;
|
||||
}
|
||||
@@ -1893,8 +1894,8 @@ int iscsi_cmnd_set_write_buf(struct iscsi_cmnd *req)
|
||||
req->pdu.datasize)) {
|
||||
PRINT_ERROR("Initiator %s violated negotiated "
|
||||
"parameters: forbidden immediate data sent "
|
||||
"(ITT %x, op %x)", session->initiator_name,
|
||||
req->pdu.bhs.itt, req_hdr->scb[0]);
|
||||
"(ITT %x, op %x, conn %p)", session->initiator_name,
|
||||
req->pdu.bhs.itt, req_hdr->scb[0], conn);
|
||||
res = -EINVAL;
|
||||
goto out_close;
|
||||
}
|
||||
@@ -1902,11 +1903,11 @@ int iscsi_cmnd_set_write_buf(struct iscsi_cmnd *req)
|
||||
if (unlikely(session->sess_params.first_burst_length < req->pdu.datasize)) {
|
||||
PRINT_ERROR("Initiator %s violated negotiated "
|
||||
"parameters: immediate data len (%d) > "
|
||||
"first_burst_length (%d) (ITT %x, op %x)",
|
||||
"first_burst_length (%d) (ITT %x, op %x, conn %p)",
|
||||
session->initiator_name,
|
||||
req->pdu.datasize,
|
||||
session->sess_params.first_burst_length,
|
||||
req->pdu.bhs.itt, req_hdr->scb[0]);
|
||||
req->pdu.bhs.itt, req_hdr->scb[0], conn);
|
||||
res = -EINVAL;
|
||||
goto out_close;
|
||||
}
|
||||
@@ -3192,10 +3193,10 @@ static int check_segment_length(struct iscsi_cmnd *cmnd)
|
||||
struct iscsi_session *session = conn->session;
|
||||
|
||||
if (unlikely(cmnd->pdu.datasize > session->sess_params.max_recv_data_length)) {
|
||||
PRINT_ERROR("Initiator %s violated negotiated parameters: "
|
||||
PRINT_ERROR("Initiator %s (conn %p) violated negotiated parameters: "
|
||||
"data too long (ITT %x, datasize %u, "
|
||||
"max_recv_data_length %u", session->initiator_name,
|
||||
cmnd->pdu.bhs.itt, cmnd->pdu.datasize,
|
||||
"max_recv_data_length %u)", session->initiator_name,
|
||||
conn, cmnd->pdu.bhs.itt, cmnd->pdu.datasize,
|
||||
session->sess_params.max_recv_data_length);
|
||||
mark_conn_closed(conn);
|
||||
return -EINVAL;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_DEBUG | \
|
||||
TRACE_MINOR | TRACE_SPECIAL | TRACE_CONN_OC)
|
||||
#else
|
||||
#define ISCSI_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define ISCSI_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ int iscsit_reg_transport(struct iscsit_transport *t)
|
||||
mutex_lock(&transport_mutex);
|
||||
tmp = __iscsit_get_transport(t->transport_type);
|
||||
if (tmp) {
|
||||
PRINT_ERROR("Unable to register transport type %d - Already registered\n",
|
||||
PRINT_ERROR("Unable to register transport type %d - Already registered",
|
||||
t->transport_type);
|
||||
ret = -EEXIST;
|
||||
} else {
|
||||
list_add_tail(&t->transport_list_entry, &transport_list);
|
||||
PRINT_INFO("Registered iSCSI transport: %s\n", t->name);
|
||||
PRINT_INFO("Registered iSCSI transport: %s", t->name);
|
||||
}
|
||||
mutex_unlock(&transport_mutex);
|
||||
|
||||
@@ -63,7 +63,7 @@ void iscsit_unreg_transport(struct iscsit_transport *t)
|
||||
list_del(&t->transport_list_entry);
|
||||
mutex_unlock(&transport_mutex);
|
||||
|
||||
PRINT_INFO("Unregistered iSCSI transport: %s\n", t->name);
|
||||
PRINT_INFO("Unregistered iSCSI transport: %s", t->name);
|
||||
}
|
||||
EXPORT_SYMBOL(iscsit_unreg_transport);
|
||||
|
||||
|
||||
@@ -220,12 +220,15 @@ int isert_wr_init(struct isert_wr *wr,
|
||||
enum ib_wr_opcode send_wr_op = IB_WR_SEND;
|
||||
struct scatterlist *sg_tmp;
|
||||
int i;
|
||||
u32 send_flags = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
switch (wr_op) {
|
||||
case ISER_WR_RECV:
|
||||
break;
|
||||
case ISER_WR_SEND:
|
||||
send_flags = IB_SEND_SIGNALED;
|
||||
break;
|
||||
case ISER_WR_RDMA_READ:
|
||||
send_wr_op = IB_WR_RDMA_READ;
|
||||
@@ -280,7 +283,7 @@ int isert_wr_init(struct isert_wr *wr,
|
||||
wr->send_wr.sg_list = wr->sge_list;
|
||||
wr->send_wr.num_sge = sg_cnt;
|
||||
wr->send_wr.opcode = send_wr_op;
|
||||
wr->send_wr.send_flags = IB_SEND_SIGNALED;
|
||||
wr->send_wr.send_flags = send_flags;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -214,10 +214,6 @@ static inline void isert_link_send_wrs(struct isert_wr *from_wr,
|
||||
struct isert_wr *to_wr)
|
||||
{
|
||||
from_wr->send_wr.next = &to_wr->send_wr;
|
||||
from_wr->send_wr.send_flags = 0; /* not signaled */
|
||||
|
||||
to_wr->send_wr.next = NULL;
|
||||
to_wr->send_wr.send_flags = IB_SEND_SIGNALED;
|
||||
}
|
||||
|
||||
static inline void isert_link_send_pdu_wrs(struct isert_cmnd *from_pdu,
|
||||
@@ -225,6 +221,7 @@ static inline void isert_link_send_pdu_wrs(struct isert_cmnd *from_pdu,
|
||||
int wr_cnt)
|
||||
{
|
||||
isert_link_send_wrs(&from_pdu->wr[wr_cnt - 1], &to_pdu->wr[0]);
|
||||
to_pdu->wr[0].send_wr.next = NULL;
|
||||
}
|
||||
|
||||
int isert_prepare_rdma(struct isert_cmnd *isert_pdu,
|
||||
@@ -282,6 +279,11 @@ int isert_prepare_rdma(struct isert_cmnd *isert_pdu,
|
||||
for (i = 1; i < wr_cnt; ++i)
|
||||
isert_link_send_wrs(&isert_pdu->wr[i - 1], &isert_pdu->wr[i]);
|
||||
|
||||
if (op == ISER_WR_RDMA_READ) {
|
||||
isert_pdu->wr[wr_cnt - 1].send_wr.send_flags = IB_SEND_SIGNALED;
|
||||
isert_pdu->wr[wr_cnt - 1].send_wr.next = NULL;
|
||||
}
|
||||
|
||||
out:
|
||||
TRACE_EXIT_RES(wr_cnt);
|
||||
return wr_cnt;
|
||||
|
||||
@@ -393,8 +393,8 @@ int isert_pdu_sent(struct iscsi_cmnd *pdu)
|
||||
target_del_all_sess(target, 0);
|
||||
mutex_unlock(&target->target_mutex);
|
||||
} else {
|
||||
PRINT_INFO("Closing connection at initiator's %s "
|
||||
"request", conn->session->initiator_name);
|
||||
PRINT_INFO("Closing connection %p at initiator's %s "
|
||||
"request", conn, conn->session->initiator_name);
|
||||
mark_conn_closed(conn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_DEBUG | \
|
||||
TRACE_MINOR | TRACE_SPECIAL)
|
||||
#else
|
||||
#define ISERT_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define ISERT_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -753,7 +753,8 @@ restart:
|
||||
goto restart;
|
||||
default:
|
||||
if (!conn->closing) {
|
||||
PRINT_ERROR("sock_recvmsg() failed: %d", res);
|
||||
PRINT_ERROR("sock_recvmsg() failed: %d (conn %p)",
|
||||
res, conn);
|
||||
mark_conn_closed(conn);
|
||||
}
|
||||
if (res == 0)
|
||||
@@ -961,9 +962,9 @@ static int process_read_io(struct iscsi_conn *conn, int *closed)
|
||||
res = digest_rx_header(cmnd);
|
||||
if (unlikely(res != 0)) {
|
||||
PRINT_ERROR("rx header digest for "
|
||||
"initiator %s failed (%d)",
|
||||
"initiator %s (conn %p) failed (%d)",
|
||||
conn->session->initiator_name,
|
||||
res);
|
||||
conn, res);
|
||||
mark_conn_closed(conn);
|
||||
} else
|
||||
conn->read_state = RX_CMD_START;
|
||||
@@ -1086,7 +1087,7 @@ int istrd(void *arg)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Read thread for pool %p started, PID %d", p, current->pid);
|
||||
PRINT_INFO("Read thread for pool %p started", p);
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
rc = set_cpus_allowed_ptr(current, &p->cpu_mask);
|
||||
@@ -1107,7 +1108,7 @@ int istrd(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&p->rd_list));
|
||||
|
||||
PRINT_INFO("Read thread for PID %d for pool %p finished", current->pid, p);
|
||||
PRINT_INFO("Read thread for pool %p finished", p);
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
@@ -1594,9 +1595,9 @@ static int exit_tx(struct iscsi_conn *conn, int res)
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
PRINT_ERROR("Sending data failed: initiator %s, "
|
||||
PRINT_ERROR("Sending data failed: initiator %s (conn %p), "
|
||||
"write_size %d, write_state %d, res %d",
|
||||
conn->session->initiator_name,
|
||||
conn->session->initiator_name, conn,
|
||||
conn->write_size,
|
||||
conn->write_state, res);
|
||||
}
|
||||
@@ -1854,7 +1855,7 @@ int istwr(void *arg)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Write thread for pool %p started, PID %d", p, current->pid);
|
||||
PRINT_INFO("Write thread for pool %p started", p);
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
rc = set_cpus_allowed_ptr(current, &p->cpu_mask);
|
||||
@@ -1875,7 +1876,7 @@ int istwr(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&p->wr_list));
|
||||
|
||||
PRINT_INFO("Write thread PID %d for pool %p finished", current->pid, p);
|
||||
PRINT_INFO("Write thread for pool %p finished", p);
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
|
||||
@@ -98,17 +98,20 @@ static int iscsi_session_alloc(struct iscsi_target *target,
|
||||
goto err;
|
||||
}
|
||||
|
||||
err = iscsi_threads_pool_get(&session->scst_sess->acg->acg_cpu_mask,
|
||||
&session->sess_thr_pool);
|
||||
if (err != 0)
|
||||
goto err_unreg;
|
||||
if (!session->sess_params.rdma_extensions) {
|
||||
err = iscsi_threads_pool_get(&session->scst_sess->acg->acg_cpu_mask,
|
||||
&session->sess_thr_pool);
|
||||
if (err != 0)
|
||||
goto err_unreg;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCST_PROC
|
||||
kfree(name);
|
||||
#endif
|
||||
|
||||
TRACE_MGMT_DBG("Session %p created: target %p, tid %u, sid %#Lx",
|
||||
session, target, target->tid, info->sid);
|
||||
TRACE(TRACE_MGMT, "Session %p created: target %p, tid %u, sid %#Lx, "
|
||||
"initiator %s", session, target, target->tid, info->sid,
|
||||
session->scst_sess->initiator_name);
|
||||
|
||||
*result = session;
|
||||
return 0;
|
||||
@@ -309,7 +312,7 @@ int session_free(struct iscsi_session *session, bool del)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
TRACE_MGMT_DBG("Freeing session %p (SID %llx)",
|
||||
TRACE(TRACE_MGMT, "Freeing session %p (SID %llx)",
|
||||
session, session->sid);
|
||||
|
||||
lockdep_assert_held(&session->target->target_mutex);
|
||||
@@ -392,11 +395,11 @@ void iscsi_sess_force_close(struct iscsi_session *sess)
|
||||
|
||||
lockdep_assert_held(&sess->target->target_mutex);
|
||||
|
||||
PRINT_INFO("Deleting session %llx with initiator %s (%p)",
|
||||
PRINT_INFO("Force closing session %llx with initiator %s (%p)",
|
||||
(unsigned long long int)sess->sid, sess->initiator_name, sess);
|
||||
|
||||
list_for_each_entry(conn, &sess->conn_list, conn_list_entry) {
|
||||
TRACE_MGMT_DBG("Deleting connection with initiator %p", conn);
|
||||
TRACE(TRACE_MGMT, "Force closing connection %p", conn);
|
||||
__mark_conn_closed(conn, ISCSI_CONN_ACTIVE_CLOSE|ISCSI_CONN_DELETING);
|
||||
}
|
||||
|
||||
|
||||
@@ -291,7 +291,8 @@ void target_del_session(struct iscsi_target *target,
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_MGMT_DBG("Deleting session %p", session);
|
||||
TRACE(TRACE_MGMT, "Deleting session %p (initiator %s)", session,
|
||||
session->scst_sess->initiator_name);
|
||||
|
||||
lockdep_assert_held(&target->target_mutex);
|
||||
|
||||
@@ -299,7 +300,7 @@ void target_del_session(struct iscsi_target *target,
|
||||
struct iscsi_conn *conn, *tc;
|
||||
list_for_each_entry_safe(conn, tc, &session->conn_list,
|
||||
conn_list_entry) {
|
||||
TRACE_MGMT_DBG("Mark conn %p closing", conn);
|
||||
TRACE_MGMT_DBG("Del session: closing conn %p", conn);
|
||||
__mark_conn_closed(conn, flags);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
ABT_DETAILS="x86_64"
|
||||
ABT_JOBS=5
|
||||
ABT_KERNELS=" \
|
||||
4.1.5 \
|
||||
4.1.6 \
|
||||
4.0.9-nc \
|
||||
3.19.7-nc \
|
||||
3.18.19-nc \
|
||||
3.17.8-nc \
|
||||
3.16.7-nc \
|
||||
3.15.10-nc \
|
||||
3.14.50-nc \
|
||||
3.14.51-nc \
|
||||
3.13.11-nc \
|
||||
3.12.44-nc \
|
||||
3.11.10-nc \
|
||||
3.10.86-nc \
|
||||
3.10.87-nc \
|
||||
3.9.11-nc \
|
||||
3.8.13-nc \
|
||||
3.7.10-nc \
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
TRACE_MINOR | TRACE_SPECIAL)
|
||||
#else
|
||||
# ifdef CONFIG_SCST_TRACING
|
||||
#define Q2T_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define Q2T_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+51
-51
@@ -220,6 +220,26 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_LOG_FLAG(log_flag, format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_INFO, __LOG_PREFIX, \
|
||||
__func__, __LINE__, format, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_WARNING, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***WARNING***: " format, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_ERR, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_CRIT, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***CRITICAL ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_INFO, __LOG_PREFIX, \
|
||||
__func__, __LINE__, format, ## args)
|
||||
|
||||
#else /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
|
||||
|
||||
#define TRACING_MINOR() (false)
|
||||
@@ -231,6 +251,37 @@ do { \
|
||||
#define PRINT_BUFF_FLAG(flag, message, buff, len) \
|
||||
((void)(flag), (void)(message), (void)(buff), (void)(len))
|
||||
|
||||
#ifdef LOG_PREFIX
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
PRINT(KERN_INFO, "%s: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
PRINT(KERN_WARNING, "%s: ***WARNING***: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
PRINT(KERN_ERR, "%s: ***ERROR***: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
PRINT(KERN_CRIT, "%s: ***CRITICAL ERROR***: " \
|
||||
format, LOG_PREFIX, ## args)
|
||||
|
||||
#else /* LOG_PREFIX */
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
PRINT(KERN_INFO, format, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
PRINT(KERN_WARNING, "***WARNING***: " format, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
PRINT(KERN_ERR, "***ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
PRINT(KERN_CRIT, "***CRITICAL ERROR***: " format, ## args)
|
||||
|
||||
#endif /* LOG_PREFIX */
|
||||
|
||||
#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
|
||||
|
||||
#ifdef CONFIG_SCST_DEBUG
|
||||
@@ -278,26 +329,6 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_LOG_FLAG(log_flag, format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_INFO, __LOG_PREFIX, \
|
||||
__func__, __LINE__, format, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_WARNING, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***WARNING***: " format, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_ERR, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_CRIT, __LOG_PREFIX, \
|
||||
__func__, __LINE__, "***CRITICAL ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_INFO, __LOG_PREFIX, \
|
||||
__func__, __LINE__, format, ## args)
|
||||
|
||||
#ifndef GENERATING_UPSTREAM_PATCH
|
||||
#define TRACE_ENTRY() \
|
||||
do { \
|
||||
@@ -378,37 +409,6 @@ do { \
|
||||
#define TRACE_EXIT_HRES(res) do {} while (0)
|
||||
#endif
|
||||
|
||||
#ifdef LOG_PREFIX
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
PRINT(KERN_INFO, "%s: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
PRINT(KERN_WARNING, "%s: ***WARNING***: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
PRINT(KERN_ERR, "%s: ***ERROR***: " format, LOG_PREFIX, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
PRINT(KERN_CRIT, "%s: ***CRITICAL ERROR***: " \
|
||||
format, LOG_PREFIX, ## args)
|
||||
|
||||
#else
|
||||
|
||||
#define PRINT_INFO(format, args...) \
|
||||
PRINT(KERN_INFO, format, ## args)
|
||||
|
||||
#define PRINT_WARNING(format, args...) \
|
||||
PRINT(KERN_WARNING, "***WARNING***: " format, ## args)
|
||||
|
||||
#define PRINT_ERROR(format, args...) \
|
||||
PRINT(KERN_ERR, "***ERROR***: " format, ## args)
|
||||
|
||||
#define PRINT_CRIT_ERROR(format, args...) \
|
||||
PRINT(KERN_CRIT, "***CRITICAL ERROR***: " format, ## args)
|
||||
|
||||
#endif /* LOG_PREFIX */
|
||||
|
||||
#endif /* CONFIG_SCST_DEBUG */
|
||||
|
||||
#if defined(CONFIG_SCST_DEBUG) && defined(CONFIG_DEBUG_SLAB)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
TRACE_LINE | TRACE_FUNCTION | TRACE_MGMT | TRACE_MINOR | \
|
||||
TRACE_MGMT_DEBUG | TRACE_SPECIAL)
|
||||
#else
|
||||
#define SCST_DEFAULT_DEV_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define SCST_DEFAULT_DEV_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3753,7 +3753,7 @@ static int dev_user_cleanup_thread(void *arg)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Cleanup thread started, PID %d", current->pid);
|
||||
PRINT_INFO("Cleanup thread started");
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -3811,7 +3811,7 @@ static int dev_user_cleanup_thread(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&cleanup_list));
|
||||
|
||||
PRINT_INFO("Cleanup thread PID %d finished", current->pid);
|
||||
PRINT_INFO("Cleanup thread finished");
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
|
||||
@@ -54,7 +54,7 @@ static inline int get_current_tid(void)
|
||||
* Unfortunately, task_pid_vnr() isn't IRQ-safe, so otherwise
|
||||
* it can oops. ToDo.
|
||||
*/
|
||||
return 0;
|
||||
return current->pid;
|
||||
}
|
||||
return task_pid_vnr(current);
|
||||
#endif
|
||||
|
||||
+3
-4
@@ -4768,8 +4768,7 @@ static int scst_ioc_keeper_thread(void *arg)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_MGMT_DBG("AIC %p keeper thread %s (PID %d) started", aic_keeper,
|
||||
current->comm, current->pid);
|
||||
TRACE_MGMT_DBG("AIC %p keeper thread %s started", aic_keeper, current->comm);
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -4795,8 +4794,8 @@ static int scst_ioc_keeper_thread(void *arg)
|
||||
wait_event_interruptible(aic_keeper->aic_keeper_waitQ,
|
||||
kthread_should_stop());
|
||||
|
||||
TRACE_MGMT_DBG("AIC %p keeper thread %s (PID %d) finished", aic_keeper,
|
||||
current->comm, current->pid);
|
||||
TRACE_MGMT_DBG("AIC %p keeper thread %s finished", aic_keeper,
|
||||
current->comm);
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
|
||||
@@ -861,7 +861,7 @@ static void __printf(2, 3) scst_to_syslog(void *arg, const char *fmt, ...)
|
||||
}
|
||||
|
||||
va_start(args, fmt);
|
||||
printk(KERN_INFO " ");
|
||||
pr_info(" ");
|
||||
vprintk(fmt, args);
|
||||
va_end(args);
|
||||
return;
|
||||
|
||||
@@ -62,7 +62,7 @@ extern unsigned long scst_trace_flag;
|
||||
#else /* CONFIG_SCST_DEBUG */
|
||||
|
||||
# ifdef CONFIG_SCST_TRACING
|
||||
#define SCST_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define SCST_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
# else
|
||||
#define SCST_DEFAULT_LOG_FLAGS 0
|
||||
|
||||
@@ -493,7 +493,7 @@ static int sysfs_work_thread_fn(void *arg)
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (!one_time_only)
|
||||
PRINT_INFO("User interface thread started, PID %d", current->pid);
|
||||
PRINT_INFO("User interface thread started");
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -516,7 +516,7 @@ static int sysfs_work_thread_fn(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&sysfs_work_list));
|
||||
|
||||
PRINT_INFO("User interface thread PID %d finished", current->pid);
|
||||
PRINT_INFO("User interface thread finished");
|
||||
}
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
+8
-10
@@ -4687,7 +4687,7 @@ int scst_init_thread(void *arg)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Init thread started, PID %d", current->pid);
|
||||
PRINT_INFO("Init thread started");
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -4708,7 +4708,7 @@ int scst_init_thread(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&scst_init_cmd_list));
|
||||
|
||||
PRINT_INFO("Init thread PID %d finished", current->pid);
|
||||
PRINT_INFO("Init thread finished");
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
@@ -5029,8 +5029,7 @@ int scst_cmd_thread(void *arg)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE(TRACE_MINOR, "Processing thread %s (PID %d) started",
|
||||
current->comm, current->pid);
|
||||
TRACE(TRACE_MINOR, "Processing thread %s started", current->comm);
|
||||
|
||||
#if 0
|
||||
set_user_nice(current, 10);
|
||||
@@ -5058,8 +5057,7 @@ int scst_cmd_thread(void *arg)
|
||||
|
||||
scst_ioctx_put(p_cmd_threads);
|
||||
|
||||
TRACE(TRACE_MINOR, "Processing thread %s (PID %d) finished",
|
||||
current->comm, current->pid);
|
||||
TRACE(TRACE_MINOR, "Processing thread %s finished", current->comm);
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
@@ -6677,7 +6675,7 @@ int scst_tm_thread(void *arg)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Task management thread started, PID %d", current->pid);
|
||||
PRINT_INFO("Task management thread started");
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -6727,7 +6725,7 @@ int scst_tm_thread(void *arg)
|
||||
*/
|
||||
sBUG_ON(!list_empty(&scst_active_mgmt_cmd_list));
|
||||
|
||||
PRINT_INFO("Task management thread PID %d finished", current->pid);
|
||||
PRINT_INFO("Task management thread finished");
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
@@ -7497,7 +7495,7 @@ int scst_global_mgmt_thread(void *arg)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_INFO("Management thread started, PID %d", current->pid);
|
||||
PRINT_INFO("Management thread started");
|
||||
|
||||
current->flags |= PF_NOFREEZE;
|
||||
|
||||
@@ -7568,7 +7566,7 @@ int scst_global_mgmt_thread(void *arg)
|
||||
sBUG_ON(!list_empty(&scst_sess_init_list));
|
||||
sBUG_ON(!list_empty(&scst_sess_shut_list));
|
||||
|
||||
PRINT_INFO("Management thread PID %d finished", current->pid);
|
||||
PRINT_INFO("Management thread finished");
|
||||
|
||||
TRACE_EXIT();
|
||||
return 0;
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
TRACE_MINOR | TRACE_SPECIAL)
|
||||
#else
|
||||
# ifdef CONFIG_SCST_TRACING
|
||||
#define SCST_LOCAL_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define SCST_LOCAL_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_SPECIAL)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ char *app_name;
|
||||
#else /* DEBUG */
|
||||
|
||||
# ifdef TRACING
|
||||
#define DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | \
|
||||
#define DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_PID | \
|
||||
TRACE_TIME | TRACE_SPECIAL)
|
||||
# else
|
||||
#define DEFAULT_LOG_FLAGS 0
|
||||
|
||||
Reference in New Issue
Block a user