Re: Subject: [PATCH 08/10 UPDATED] vmalloc: addun/map_kernel_range_noflush()

From: Andrew Morton
Date: Fri Feb 20 2009 - 03:33:21 EST


On Fri, 20 Feb 2009 16:15:39 +0900 Tejun Heo <tj@xxxxxxxxxx> wrote:

> +/**
> + * map_kernel_range_noflush - map kernel VM area with the specified pages
> + * @addr: start of the VM area to map
> + * @size: size of the VM area to map
> + * @prot: page protection flags to use
> + * @pages: pages to map
> + *
> + * Map PFN_UP(@size) pages at @addr. The VM area @addr and @size
> + * specify should have been allocated using get_vm_area() and its
> + * friends.
> + *
> + * NOTE:
> + * This function does NOT do any cache flushing. The caller is
> + * responsible for calling flush_cache_vmap() on to-be-mapped areas
> + * before calling this function.
> + *
> + * RETURNS:
> + * The number of pages mapped on success, -errno on failure.
> + */
> +int map_kernel_range_noflush(unsigned long addr, unsigned long size,
> + pgprot_t prot, struct page **pages)
> +{
> + return vmap_page_range_noflush(addr, addr + size, prot, pages);
> +}
> +
> +/**
> + * unmap_kernel_range_noflush - unmap kernel VM area
> + * @addr: start of the VM area to unmap
> + * @size: size of the VM area to unmap
> + *
> + * Unmap PFN_UP(@size) pages at @addr. The VM area @addr and @size
> + * specify should have been allocated using get_vm_area() and its
> + * friends.
> + *
> + * NOTE:
> + * This function does NOT do any cache flushing. The caller is
> + * responsible for calling flush_cache_vunmap() on to-be-mapped areas
> + * before calling this function and flush_tlb_kernel_range() after.
> + */
> +void unmap_kernel_range_noflush(unsigned long addr, unsigned long size)
> +{
> + vunmap_page_range(addr, addr + size);
> +}

Should these be called
vmap_kernel_range_noflush/vunmap_kernel_range_noflush?

<avoids pointing out the 2 gigapage limit>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/