Lines Matching refs:sc_buf_pool
734 STAILQ_INIT(&oct->sc_buf_pool.head); in lio_setup_sc_buffer_pool()
735 mtx_init(&oct->sc_buf_pool.lock, "sc_pool_lock", NULL, MTX_DEF); in lio_setup_sc_buffer_pool()
736 atomic_store_rel_int(&oct->sc_buf_pool.alloc_buf_count, 0); in lio_setup_sc_buffer_pool()
749 STAILQ_INSERT_TAIL(&oct->sc_buf_pool.head, &sc->node, entries); in lio_setup_sc_buffer_pool()
761 mtx_lock(&oct->sc_buf_pool.lock); in lio_free_sc_buffer_pool()
763 STAILQ_FOREACH_SAFE(tmp, &oct->sc_buf_pool.head, entries, tmp2) { in lio_free_sc_buffer_pool()
764 sc = LIO_STAILQ_FIRST_ENTRY(&oct->sc_buf_pool.head, in lio_free_sc_buffer_pool()
767 STAILQ_REMOVE_HEAD(&oct->sc_buf_pool.head, entries); in lio_free_sc_buffer_pool()
772 STAILQ_INIT(&oct->sc_buf_pool.head); in lio_free_sc_buffer_pool()
774 mtx_unlock(&oct->sc_buf_pool.lock); in lio_free_sc_buffer_pool()
794 mtx_lock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
796 if (STAILQ_EMPTY(&oct->sc_buf_pool.head)) { in lio_alloc_soft_command()
797 mtx_unlock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
800 tmp = STAILQ_LAST(&oct->sc_buf_pool.head, lio_stailq_node, entries); in lio_alloc_soft_command()
802 STAILQ_REMOVE(&oct->sc_buf_pool.head, tmp, lio_stailq_node, entries); in lio_alloc_soft_command()
804 atomic_add_int(&oct->sc_buf_pool.alloc_buf_count, 1); in lio_alloc_soft_command()
806 mtx_unlock(&oct->sc_buf_pool.lock); in lio_alloc_soft_command()
851 mtx_lock(&oct->sc_buf_pool.lock); in lio_free_soft_command()
853 STAILQ_INSERT_TAIL(&oct->sc_buf_pool.head, &sc->node, entries); in lio_free_soft_command()
855 atomic_subtract_int(&oct->sc_buf_pool.alloc_buf_count, 1); in lio_free_soft_command()
857 mtx_unlock(&oct->sc_buf_pool.lock); in lio_free_soft_command()