Lines Matching refs:sc_buf_pool
719 STAILQ_INIT(&oct->sc_buf_pool.head); in lio_setup_sc_buffer_pool()
720 mtx_init(&oct->sc_buf_pool.lock, "sc_pool_lock", NULL, MTX_DEF); in lio_setup_sc_buffer_pool()
721 atomic_store_rel_int(&oct->sc_buf_pool.alloc_buf_count, 0); in lio_setup_sc_buffer_pool()
734 STAILQ_INSERT_TAIL(&oct->sc_buf_pool.head, &sc->node, entries); in lio_setup_sc_buffer_pool()
746 mtx_lock(&oct->sc_buf_pool.lock); in lio_free_sc_buffer_pool()
748 STAILQ_FOREACH_SAFE(tmp, &oct->sc_buf_pool.head, entries, tmp2) { in lio_free_sc_buffer_pool()
749 sc = LIO_STAILQ_FIRST_ENTRY(&oct->sc_buf_pool.head, in lio_free_sc_buffer_pool()
752 STAILQ_REMOVE_HEAD(&oct->sc_buf_pool.head, entries); in lio_free_sc_buffer_pool()
757 STAILQ_INIT(&oct->sc_buf_pool.head); in lio_free_sc_buffer_pool()
759 mtx_unlock(&oct->sc_buf_pool.lock); in lio_free_sc_buffer_pool()
779 mtx_lock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
781 if (STAILQ_EMPTY(&oct->sc_buf_pool.head)) { in lio_alloc_soft_command()
782 mtx_unlock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
785 tmp = STAILQ_LAST(&oct->sc_buf_pool.head, lio_stailq_node, entries); in lio_alloc_soft_command()
787 STAILQ_REMOVE(&oct->sc_buf_pool.head, tmp, lio_stailq_node, entries); in lio_alloc_soft_command()
789 atomic_add_int(&oct->sc_buf_pool.alloc_buf_count, 1); in lio_alloc_soft_command()
791 mtx_unlock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
836 mtx_lock(&oct->sc_buf_pool.lock); in lio_free_soft_command()
838 STAILQ_INSERT_TAIL(&oct->sc_buf_pool.head, &sc->node, entries); in lio_free_soft_command()
840 atomic_subtract_int(&oct->sc_buf_pool.alloc_buf_count, 1); in lio_free_soft_command()
842 mtx_unlock(&oct->sc_buf_pool.lock); in lio_free_soft_command()