Lines Matching defs:pool

207 	 * Return the kioc to free pool
502 * First we search for a pool with smallest buffer that is >= @xferlen. If
503 * that pool has no free buffer, we will try for the next bigger size. If none
505 * @xferlen and attach it the pool.
510 mm_dmapool_t *pool;
527 pool = &adp->dma_pool_list[i];
529 if (xferlen > pool->buf_size)
535 spin_lock_irqsave(&pool->lock, flags);
537 if (!pool->in_use) {
539 pool->in_use = 1;
541 kioc->buf_vaddr = pool->vaddr;
542 kioc->buf_paddr = pool->paddr;
544 spin_unlock_irqrestore(&pool->lock, flags);
548 spin_unlock_irqrestore(&pool->lock, flags);
560 * We did not get any buffer from the preallocated pool. Let us try
563 pool = &adp->dma_pool_list[right_pool];
565 spin_lock_irqsave(&pool->lock, flags);
569 kioc->buf_vaddr = dma_pool_alloc(pool->handle, GFP_ATOMIC,
571 spin_unlock_irqrestore(&pool->lock, flags);
584 * free kioc pool. If the kioc pool is empty, this function blocks till
629 * mraid_mm_dealloc_kioc - Return kioc to free pool
631 * @kioc : uioc_t node to be returned to free pool
636 mm_dmapool_t *pool;
640 pool = &adp->dma_pool_list[kioc->pool_index];
643 spin_lock_irqsave(&pool->lock, flags);
647 * required buffer from the pool, we would have allocated
653 dma_pool_free(pool->handle, kioc->buf_vaddr,
656 pool->in_use = 0;
658 spin_unlock_irqrestore(&pool->lock, flags);
661 /* Return the kioc to the free pool */
941 adapter->pthru_dma_pool = dma_pool_create("megaraid mm pthru pool",
1061 * We maintain a pool of dma buffers per each adapter. Each pool has one
1063 * We have just one 4k buffer in 4k pool, one 8k buffer in 8k pool etc. We
1065 * pool.
1070 mm_dmapool_t *pool;
1081 pool = &adp->dma_pool_list[i];
1083 pool->buf_size = bufsize;
1084 spin_lock_init(&pool->lock);
1086 pool->handle = dma_pool_create("megaraid mm data buffer",
1090 if (!pool->handle) {
1094 pool->vaddr = dma_pool_alloc(pool->handle, GFP_KERNEL,
1095 &pool->paddr);
1097 if (!pool->vaddr)
1186 mm_dmapool_t *pool;
1190 pool = &adp->dma_pool_list[i];
1192 if (pool->handle) {
1194 if (pool->vaddr)
1195 dma_pool_free(pool->handle, pool->vaddr,
1196 pool->paddr);
1198 dma_pool_destroy(pool->handle);
1199 pool->handle = NULL;