Lines Matching full:index
207 xbd_added_qentry(struct xbd_softc *sc, xbd_q_index_t index) in xbd_added_qentry() argument
211 cmq = &sc->xbd_cm_q[index]; in xbd_added_qentry()
218 xbd_removed_qentry(struct xbd_softc *sc, xbd_q_index_t index) in xbd_removed_qentry() argument
220 sc->xbd_cm_q[index].q_length--; in xbd_removed_qentry()
224 xbd_queue_length(struct xbd_softc *sc, xbd_q_index_t index) in xbd_queue_length() argument
226 return (sc->xbd_cm_q[index].q_length); in xbd_queue_length()
230 xbd_initq_cm(struct xbd_softc *sc, xbd_q_index_t index) in xbd_initq_cm() argument
234 cmq = &sc->xbd_cm_q[index]; in xbd_initq_cm()
241 xbd_enqueue_cm(struct xbd_command *cm, xbd_q_index_t index) in xbd_enqueue_cm() argument
243 KASSERT(index != XBD_Q_BIO, in xbd_enqueue_cm()
248 TAILQ_INSERT_TAIL(&cm->cm_sc->xbd_cm_q[index].q_tailq, cm, cm_link); in xbd_enqueue_cm()
250 cm->cm_flags |= index; in xbd_enqueue_cm()
251 xbd_added_qentry(cm->cm_sc, index); in xbd_enqueue_cm()
255 xbd_requeue_cm(struct xbd_command *cm, xbd_q_index_t index) in xbd_requeue_cm() argument
257 KASSERT(index != XBD_Q_BIO, in xbd_requeue_cm()
262 TAILQ_INSERT_HEAD(&cm->cm_sc->xbd_cm_q[index].q_tailq, cm, cm_link); in xbd_requeue_cm()
264 cm->cm_flags |= index; in xbd_requeue_cm()
265 xbd_added_qentry(cm->cm_sc, index); in xbd_requeue_cm()
269 xbd_dequeue_cm(struct xbd_softc *sc, xbd_q_index_t index) in xbd_dequeue_cm() argument
273 KASSERT(index != XBD_Q_BIO, in xbd_dequeue_cm()
276 if ((cm = TAILQ_FIRST(&sc->xbd_cm_q[index].q_tailq)) != NULL) { in xbd_dequeue_cm()
277 if ((cm->cm_flags & XBDCF_Q_MASK) != index) { in xbd_dequeue_cm()
282 index); in xbd_dequeue_cm()
284 TAILQ_REMOVE(&sc->xbd_cm_q[index].q_tailq, cm, cm_link); in xbd_dequeue_cm()
287 xbd_removed_qentry(cm->cm_sc, index); in xbd_dequeue_cm()
295 xbd_q_index_t index; in xbd_remove_cm() local
297 index = cm->cm_flags & XBDCF_Q_MASK; in xbd_remove_cm()
299 KASSERT(index != XBD_Q_BIO, in xbd_remove_cm()
302 if (index != expected_index) { in xbd_remove_cm()
304 __func__, cm, index, expected_index); in xbd_remove_cm()
306 TAILQ_REMOVE(&cm->cm_sc->xbd_cm_q[index].q_tailq, cm, cm_link); in xbd_remove_cm()
309 xbd_removed_qentry(cm->cm_sc, index); in xbd_remove_cm()
347 u_int index; in xbd_initqs() local
349 for (index = 0; index < XBD_Q_COUNT; index++) in xbd_initqs()
350 xbd_initq_cm(sc, index); in xbd_initqs()