/* Allocate a page and add it freelist of given pool.  */
static int grow_pool(struct xv_pool *pool, gfp_t flags)
/* Allocate a page and add it freelist of given pool.  */
static int grow_pool(struct xv_pool *pool, gfp_t flags)
{
	struct page *page;
	struct block_header *block;
	page = alloc_page(flags);
	if (unlikely(!page))
		return -ENOMEM;
	stat_inc(&pool->total_pages);
	spin_lock(&pool->lock);
	block = get_ptr_atomic(page, 0, KM_USER0);
	block->size = PAGE_SIZE - XV_ALIGN;
	set_flag(block, BLOCK_FREE);
	clear_flag(block, PREV_FREE);
	set_blockprev(block, 0);
	insert_block(pool, page, 0, block);
	put_ptr_atomic(block, KM_USER0);
	spin_unlock(&pool->lock);
	return 0;
}