summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-04-04 08:43:23 +0000
committertrasz <trasz@FreeBSD.org>2014-04-04 08:43:23 +0000
commit56ca79568d3301f19ad863974183eb4d206db209 (patch)
treed0b48181c8e6c32bd35cc8bf8b793508beef7d62 /sys/dev/iscsi
parentda0c56cf243c2c28e5e40f6fbf81cf76c92bd745 (diff)
downloadFreeBSD-src-56ca79568d3301f19ad863974183eb4d206db209.zip
FreeBSD-src-56ca79568d3301f19ad863974183eb4d206db209.tar.gz
We don't need TAILQ for iSCSI PDUs; STAILQ is enough.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c18
-rw-r--r--sys/dev/iscsi/icl.h4
-rw-r--r--sys/dev/iscsi/iscsi.c30
-rw-r--r--sys/dev/iscsi/iscsi.h2
4 files changed, 27 insertions, 27 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index ba6e45d..35f7d5c 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -854,11 +854,11 @@ icl_conn_send_pdus(struct icl_conn *ic)
available = sbspace(&so->so_snd);
SOCKBUF_UNLOCK(&so->so_snd);
- while (!TAILQ_EMPTY(&ic->ic_to_send)) {
+ while (!STAILQ_EMPTY(&ic->ic_to_send)) {
if (ic->ic_disconnecting)
return;
- request = TAILQ_FIRST(&ic->ic_to_send);
+ request = STAILQ_FIRST(&ic->ic_to_send);
size = icl_pdu_size(request);
if (available < size) {
/*
@@ -877,7 +877,7 @@ icl_conn_send_pdus(struct icl_conn *ic)
return;
}
available -= size;
- TAILQ_REMOVE(&ic->ic_to_send, request, ip_next);
+ STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next);
error = icl_pdu_send(request);
if (error != 0) {
ICL_DEBUG("failed to send PDU; "
@@ -977,7 +977,7 @@ icl_pdu_queue(struct icl_pdu *ip)
icl_pdu_free(ip);
return;
}
- TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next);
+ STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next);
cv_signal(&ic->ic_send_cv);
}
@@ -990,7 +990,7 @@ icl_conn_new(const char *name, struct mtx *lock)
ic = uma_zalloc(icl_conn_zone, M_WAITOK | M_ZERO);
- TAILQ_INIT(&ic->ic_to_send);
+ STAILQ_INIT(&ic->ic_to_send);
ic->ic_lock = lock;
cv_init(&ic->ic_send_cv, "icl_tx");
cv_init(&ic->ic_receive_cv, "icl_rx");
@@ -1217,13 +1217,13 @@ icl_conn_close(struct icl_conn *ic)
/*
* Remove any outstanding PDUs from the send queue.
*/
- while (!TAILQ_EMPTY(&ic->ic_to_send)) {
- pdu = TAILQ_FIRST(&ic->ic_to_send);
- TAILQ_REMOVE(&ic->ic_to_send, pdu, ip_next);
+ while (!STAILQ_EMPTY(&ic->ic_to_send)) {
+ pdu = STAILQ_FIRST(&ic->ic_to_send);
+ STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next);
icl_pdu_free(pdu);
}
- KASSERT(TAILQ_EMPTY(&ic->ic_to_send),
+ KASSERT(STAILQ_EMPTY(&ic->ic_to_send),
("destroying session with non-empty send queue"));
#ifdef DIAGNOSTIC
KASSERT(ic->ic_outstanding_pdus == 0,
diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h
index e40c0ac..fd4abae 100644
--- a/sys/dev/iscsi/icl.h
+++ b/sys/dev/iscsi/icl.h
@@ -40,7 +40,7 @@
struct icl_conn;
struct icl_pdu {
- TAILQ_ENTRY(icl_pdu) ip_next;
+ STAILQ_ENTRY(icl_pdu) ip_next;
struct icl_conn *ip_conn;
struct iscsi_bhs *ip_bhs;
struct mbuf *ip_bhs_mbuf;
@@ -79,7 +79,7 @@ struct icl_conn {
#ifdef DIAGNOSTIC
volatile u_int ic_outstanding_pdus;
#endif
- TAILQ_HEAD(, icl_pdu) ic_to_send;
+ STAILQ_HEAD(, icl_pdu) ic_to_send;
size_t ic_receive_len;
int ic_receive_state;
struct icl_pdu *ic_receive_pdu;
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index 84037b9..8819b45 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -217,12 +217,12 @@ iscsi_session_send_postponed(struct iscsi_session *is)
ISCSI_SESSION_LOCK_ASSERT(is);
- while (!TAILQ_EMPTY(&is->is_postponed)) {
- request = TAILQ_FIRST(&is->is_postponed);
+ while (!STAILQ_EMPTY(&is->is_postponed)) {
+ request = STAILQ_FIRST(&is->is_postponed);
postpone = iscsi_pdu_prepare(request);
if (postpone)
break;
- TAILQ_REMOVE(&is->is_postponed, request, ip_next);
+ STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next);
icl_pdu_queue(request);
}
}
@@ -238,7 +238,7 @@ iscsi_pdu_queue_locked(struct icl_pdu *request)
iscsi_session_send_postponed(is);
postpone = iscsi_pdu_prepare(request);
if (postpone) {
- TAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next);
+ STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next);
return;
}
icl_pdu_queue(request);
@@ -326,9 +326,9 @@ iscsi_maintenance_thread_reconnect(struct iscsi_session *is)
/*
* Remove postponed PDUs.
*/
- while (!TAILQ_EMPTY(&is->is_postponed)) {
- pdu = TAILQ_FIRST(&is->is_postponed);
- TAILQ_REMOVE(&is->is_postponed, pdu, ip_next);
+ while (!STAILQ_EMPTY(&is->is_postponed)) {
+ pdu = STAILQ_FIRST(&is->is_postponed);
+ STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next);
icl_pdu_free(pdu);
}
@@ -340,7 +340,7 @@ iscsi_maintenance_thread_reconnect(struct iscsi_session *is)
KASSERT(TAILQ_EMPTY(&is->is_outstanding),
("destroying session with active tasks"));
- KASSERT(TAILQ_EMPTY(&is->is_postponed),
+ KASSERT(STAILQ_EMPTY(&is->is_postponed),
("destroying session with postponed PDUs"));
/*
@@ -395,9 +395,9 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
/*
* Remove postponed PDUs.
*/
- while (!TAILQ_EMPTY(&is->is_postponed)) {
- pdu = TAILQ_FIRST(&is->is_postponed);
- TAILQ_REMOVE(&is->is_postponed, pdu, ip_next);
+ while (!STAILQ_EMPTY(&is->is_postponed)) {
+ pdu = STAILQ_FIRST(&is->is_postponed);
+ STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next);
icl_pdu_free(pdu);
}
@@ -427,7 +427,7 @@ iscsi_maintenance_thread_terminate(struct iscsi_session *is)
KASSERT(TAILQ_EMPTY(&is->is_outstanding),
("destroying session with active tasks"));
- KASSERT(TAILQ_EMPTY(&is->is_postponed),
+ KASSERT(STAILQ_EMPTY(&is->is_postponed),
("destroying session with postponed PDUs"));
ISCSI_SESSION_UNLOCK(is);
@@ -458,7 +458,7 @@ iscsi_maintenance_thread(void *arg)
ISCSI_SESSION_LOCK(is);
if (is->is_reconnecting == false &&
is->is_terminating == false &&
- TAILQ_EMPTY(&is->is_postponed))
+ STAILQ_EMPTY(&is->is_postponed))
cv_wait(&is->is_maintenance_cv, &is->is_lock);
if (is->is_reconnecting) {
@@ -636,7 +636,7 @@ iscsi_pdu_update_statsn(const struct icl_pdu *response)
* Command window increased; kick the maintanance thread
* to send out postponed commands.
*/
- if (!TAILQ_EMPTY(&is->is_postponed))
+ if (!STAILQ_EMPTY(&is->is_postponed))
cv_signal(&is->is_maintenance_cv);
} else if (maxcmdsn < is->is_maxcmdsn) {
ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d < session MaxCmdSN %d; ignoring",
@@ -1646,7 +1646,7 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
is->is_conn->ic_error = iscsi_error_callback;
is->is_conn->ic_prv0 = is;
TAILQ_INIT(&is->is_outstanding);
- TAILQ_INIT(&is->is_postponed);
+ STAILQ_INIT(&is->is_postponed);
mtx_init(&is->is_lock, "iscsi_lock", NULL, MTX_DEF);
cv_init(&is->is_maintenance_cv, "iscsi_mt");
#ifdef ICL_KERNEL_PROXY
diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h
index dd78852..e18f7f8 100644
--- a/sys/dev/iscsi/iscsi.h
+++ b/sys/dev/iscsi/iscsi.h
@@ -69,7 +69,7 @@ struct iscsi_session {
char is_target_alias[ISCSI_ALIAS_LEN];
TAILQ_HEAD(, iscsi_outstanding) is_outstanding;
- TAILQ_HEAD(, icl_pdu) is_postponed;
+ STAILQ_HEAD(, icl_pdu) is_postponed;
struct callout is_callout;
unsigned int is_timeout;
OpenPOWER on IntegriCloud