/* Maps @count pages from @pages into contiguous kernel virtual space.  */
void* vmap(struct page **pages, unsigned int count, unsigned long flags, pgprot_t prot)
/* Maps @count pages from @pages into contiguous kernel virtual space.  */
void* vmap(struct page **pages, unsigned int count, unsigned long flags, pgprot_t prot)
{
	struct vm_struct *area;
	might_sleep();
	if (count > totalram_pages)
		return NULL;
	area = get_vm_area_caller((count << PAGE_SHIFT), flags,
					__builtin_return_address(0));
	if (!area)
		return NULL;
	if (map_vm_area(area, prot, &pages)) {
		vunmap(area->addr);
		return NULL;
	}
	return area->addr;
}