summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-05-07 06:12:59 +0000
committertrasz <trasz@FreeBSD.org>2014-05-07 06:12:59 +0000
commit3c0db90228687833016cd2ff8ec8d23f8e7223bc (patch)
tree5c46206bba1bba30e9dba4b81d77f5bb28117cb9
parent7ccc1ec9419baa312c5d5ee07c35d2b2108e0571 (diff)
downloadFreeBSD-src-3c0db90228687833016cd2ff8ec8d23f8e7223bc.zip
FreeBSD-src-3c0db90228687833016cd2ff8ec8d23f8e7223bc.tar.gz
MFC r263743:
Move the ic_outstanding_count under #ifdef DIAGNOSTIC. Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/dev/iscsi/icl.c8
-rw-r--r--sys/dev/iscsi/icl.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index 5739028..76f4af1 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -135,11 +135,15 @@ icl_pdu_new(struct icl_conn *ic, int flags)
{
struct icl_pdu *ip;
+#ifdef DIAGNOSTIC
refcount_acquire(&ic->ic_outstanding_pdus);
+#endif
ip = uma_zalloc(icl_pdu_zone, flags | M_ZERO);
if (ip == NULL) {
ICL_WARN("failed to allocate %zd bytes", sizeof(*ip));
+#ifdef DIAGNOSTIC
refcount_release(&ic->ic_outstanding_pdus);
+#endif
return (NULL);
}
@@ -159,7 +163,9 @@ icl_pdu_free(struct icl_pdu *ip)
m_freem(ip->ip_ahs_mbuf);
m_freem(ip->ip_data_mbuf);
uma_zfree(icl_pdu_zone, ip);
+#ifdef DIAGNOSTIC
refcount_release(&ic->ic_outstanding_pdus);
+#endif
}
/*
@@ -977,7 +983,9 @@ icl_conn_new(void)
mtx_init(&ic->ic_lock, "icl_lock", NULL, MTX_DEF);
cv_init(&ic->ic_send_cv, "icl_tx");
cv_init(&ic->ic_receive_cv, "icl_rx");
+#ifdef DIAGNOSTIC
refcount_init(&ic->ic_outstanding_pdus, 0);
+#endif
ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH;
return (ic);
diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h
index 87a5652..ab61cd8 100644
--- a/sys/dev/iscsi/icl.h
+++ b/sys/dev/iscsi/icl.h
@@ -76,7 +76,9 @@ void icl_pdu_free(struct icl_pdu *ip);
struct icl_conn {
struct mtx ic_lock;
struct socket *ic_socket;
+#ifdef DIAGNOSTIC
volatile u_int ic_outstanding_pdus;
+#endif
TAILQ_HEAD(, icl_pdu) ic_to_send;
size_t ic_receive_len;
int ic_receive_state;
OpenPOWER on IntegriCloud