Lines Matching refs:pool
89 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mem_alloc() local
123 pool->elements = kmalloc(sizeof(struct lpfc_dmabuf) * in lpfc_mem_alloc()
125 if (!pool->elements) in lpfc_mem_alloc()
128 pool->max_count = 0; in lpfc_mem_alloc()
129 pool->current_count = 0; in lpfc_mem_alloc()
131 pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool, in lpfc_mem_alloc()
132 GFP_KERNEL, &pool->elements[i].phys); in lpfc_mem_alloc()
133 if (!pool->elements[i].virt) in lpfc_mem_alloc()
135 pool->max_count++; in lpfc_mem_alloc()
136 pool->current_count++; in lpfc_mem_alloc()
204 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, in lpfc_mem_alloc()
205 pool->elements[i].phys); in lpfc_mem_alloc()
206 kfree(pool->elements); in lpfc_mem_alloc()
245 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mem_free() local
284 for (i = 0; i < pool->current_count; i++) in lpfc_mem_free()
285 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, in lpfc_mem_free()
286 pool->elements[i].phys); in lpfc_mem_free()
287 kfree(pool->elements); in lpfc_mem_free()
396 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mbuf_alloc() local
403 if (!ret && (mem_flags & MEM_PRI) && pool->current_count) { in lpfc_mbuf_alloc()
404 pool->current_count--; in lpfc_mbuf_alloc()
405 ret = pool->elements[pool->current_count].virt; in lpfc_mbuf_alloc()
406 *handle = pool->elements[pool->current_count].phys; in lpfc_mbuf_alloc()
429 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in __lpfc_mbuf_free() local
431 if (pool->current_count < pool->max_count) { in __lpfc_mbuf_free()
432 pool->elements[pool->current_count].virt = virt; in __lpfc_mbuf_free()
433 pool->elements[pool->current_count].phys = dma; in __lpfc_mbuf_free()
434 pool->current_count++; in __lpfc_mbuf_free()