dma_pool_alloc (struct dma_pool *pool, unsigned int __nocast mem_flags, dma_addr_t *handle) 
dma_pool_alloc (struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle) 
dma_pool_alloc (struct dma_pool *pool, unsigned int __nocast mem_flags,		dma_addr_t *handle){	unsigned long		flags;	struct dma_page		*page;	int			map, block;	size_t			offset;	void			*retval;restart:	spin_lock_irqsave (&pool->lock, flags);	list_for_each_entry(page, &pool->page_list, page_list) {		int		i;		/* only cachable accesses here ... */		for (map = 0, i = 0;				i < pool->blocks_per_page;				i += BITS_PER_LONG, map++) {			if (page->bitmap [map] == 0)				continue;			block = ffz (~ page->bitmap [map]);			if ((i + block) < pool->blocks_per_page) {				clear_bit (block, &page->bitmap [map]);				offset = (BITS_PER_LONG * map) + block;				offset *= pool->size;				goto ready;			}		}	}	if (!(page = pool_alloc_page (pool, SLAB_ATOMIC))) {		if (mem_flags & __GFP_WAIT) {			DECLARE_WAITQUEUE (wait, current);			current->state = TASK_INTERRUPTIBLE;			add_wait_queue (&pool->waitq, &wait);			spin_unlock_irqrestore (&pool->lock, flags);			schedule_timeout (POOL_TIMEOUT_JIFFIES);			remove_wait_queue (&pool->waitq, &wait);			goto restart;		}		retval = NULL;		goto done;	}	clear_bit (0, &page->bitmap [0]);	offset = 0;ready:	page->in_use++;	retval = offset + page->vaddr;	*handle = offset + page->dma;#ifdef	CONFIG_DEBUG_SLAB	memset (retval, POOL_POISON_ALLOCATED, pool->size);#endifdone:	spin_unlock_irqrestore (&pool->lock, flags);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7/dmapool.c/buggy/drivers/base/dmapool.c