Commit a29adb62 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

mm: rename vmap_page_range to map_kernel_range

This matches the map_kernel_range_noflush API.  Also change to pass a size
instead of the end, similar to the noflush version.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Gao Xiang <xiang@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Kelley <mikelley@microsoft.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Link: http://lkml.kernel.org/r/20200414131348.444715-15-hch@lst.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b521c43f
...@@ -273,13 +273,13 @@ int map_kernel_range_noflush(unsigned long addr, unsigned long size, ...@@ -273,13 +273,13 @@ int map_kernel_range_noflush(unsigned long addr, unsigned long size,
return nr; return nr;
} }
static int vmap_page_range(unsigned long start, unsigned long end, static int map_kernel_range(unsigned long start, unsigned long size,
pgprot_t prot, struct page **pages) pgprot_t prot, struct page **pages)
{ {
int ret; int ret;
ret = map_kernel_range_noflush(start, end - start, prot, pages); ret = map_kernel_range_noflush(start, size, prot, pages);
flush_cache_vmap(start, end); flush_cache_vmap(start, start + size);
return ret; return ret;
} }
...@@ -1867,7 +1867,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro ...@@ -1867,7 +1867,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
kasan_unpoison_vmalloc(mem, size); kasan_unpoison_vmalloc(mem, size);
if (vmap_page_range(addr, addr + size, prot, pages) < 0) { if (map_kernel_range(addr, size, prot, pages) < 0) {
vm_unmap_ram(mem, count); vm_unmap_ram(mem, count);
return NULL; return NULL;
} }
...@@ -2031,10 +2031,9 @@ void unmap_kernel_range(unsigned long addr, unsigned long size) ...@@ -2031,10 +2031,9 @@ void unmap_kernel_range(unsigned long addr, unsigned long size)
int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page **pages) int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page **pages)
{ {
unsigned long addr = (unsigned long)area->addr; unsigned long addr = (unsigned long)area->addr;
unsigned long end = addr + get_vm_area_size(area);
int err; int err;
err = vmap_page_range(addr, end, prot, pages); err = map_kernel_range(addr, get_vm_area_size(area), prot, pages);
return err > 0 ? 0 : err; return err > 0 ? 0 : err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment