Skip to content

Commit d4efd79

Browse files
Christoph Hellwigtorvalds
authored andcommitted
mm: remove the prot argument from vm_map_ram
This is always PAGE_KERNEL - for long term mappings with other properties vmap should be used. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: David Airlie <[email protected]> Cc: Gao Xiang <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Haiyang Zhang <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: "K. Y. Srinivasan" <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Kelley <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Nitin Gupta <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Sakari Ailus <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Wei Liu <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Will Deacon <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 855e57a commit d4efd79

File tree

8 files changed

+9
-12
lines changed

8 files changed

+9
-12
lines changed

drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void *mock_dmabuf_vmap(struct dma_buf *dma_buf)
6666
{
6767
struct mock_dmabuf *mock = to_mock(dma_buf);
6868

69-
return vm_map_ram(mock->pages, mock->npages, 0, PAGE_KERNEL);
69+
return vm_map_ram(mock->pages, mock->npages, 0);
7070
}
7171

7272
static void mock_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr)

drivers/media/common/videobuf2/videobuf2-dma-sg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ static void *vb2_dma_sg_vaddr(void *buf_priv)
309309
if (buf->db_attach)
310310
buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf);
311311
else
312-
buf->vaddr = vm_map_ram(buf->pages,
313-
buf->num_pages, -1, PAGE_KERNEL);
312+
buf->vaddr = vm_map_ram(buf->pages, buf->num_pages, -1);
314313
}
315314

316315
/* add offset in case userptr is not page-aligned */

drivers/media/common/videobuf2/videobuf2-vmalloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ static void *vb2_vmalloc_get_userptr(struct device *dev, unsigned long vaddr,
107107
buf->vaddr = (__force void *)
108108
ioremap(__pfn_to_phys(nums[0]), size + offset);
109109
} else {
110-
buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1,
111-
PAGE_KERNEL);
110+
buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1);
112111
}
113112

114113
if (!buf->vaddr)

fs/erofs/decompressor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int z_erofs_decompress_generic(struct z_erofs_decompress_req *rq,
274274

275275
i = 0;
276276
while (1) {
277-
dst = vm_map_ram(rq->out, nrpages_out, -1, PAGE_KERNEL);
277+
dst = vm_map_ram(rq->out, nrpages_out, -1);
278278

279279
/* retry two more times (totally 3 times) */
280280
if (dst || ++i >= 3)

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ _xfs_buf_map_pages(
477477
nofs_flag = memalloc_nofs_save();
478478
do {
479479
bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
480-
-1, PAGE_KERNEL);
480+
-1);
481481
if (bp->b_addr)
482482
break;
483483
vm_unmap_aliases();

include/linux/vmalloc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ struct vmap_area {
8888
* Highlevel APIs for driver use
8989
*/
9090
extern void vm_unmap_ram(const void *mem, unsigned int count);
91-
extern void *vm_map_ram(struct page **pages, unsigned int count,
92-
int node, pgprot_t prot);
91+
extern void *vm_map_ram(struct page **pages, unsigned int count, int node);
9392
extern void vm_unmap_aliases(void);
9493

9594
#ifdef CONFIG_MMU

mm/nommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void vunmap(const void *addr)
351351
}
352352
EXPORT_SYMBOL(vunmap);
353353

354-
void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)
354+
void *vm_map_ram(struct page **pages, unsigned int count, int node)
355355
{
356356
BUG();
357357
return NULL;

mm/vmalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ EXPORT_SYMBOL(vm_unmap_ram);
18351835
*
18361836
* Returns: a pointer to the address that has been mapped, or %NULL on failure
18371837
*/
1838-
void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)
1838+
void *vm_map_ram(struct page **pages, unsigned int count, int node)
18391839
{
18401840
unsigned long size = (unsigned long)count << PAGE_SHIFT;
18411841
unsigned long addr;
@@ -1859,7 +1859,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
18591859

18601860
kasan_unpoison_vmalloc(mem, size);
18611861

1862-
if (map_kernel_range(addr, size, prot, pages) < 0) {
1862+
if (map_kernel_range(addr, size, PAGE_KERNEL, pages) < 0) {
18631863
vm_unmap_ram(mem, count);
18641864
return NULL;
18651865
}

0 commit comments

Comments
 (0)