Commit 2c60fda2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remap_file_pages: implement MAP_POPULATE for all protections

Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>

It seems eccentric to implement MAP_POPULATE only on PROT_NONE mappings:
do_mmap_pgoff is passing down prot, then sys_remap_file_pages verifies it's
not set.  I guess that's an oversight from when we realized that the prot arg
to sys_remap_file_pages was misdesigned.

There's another oddity whose heritage is harder for me to understand, so
please let me leave it to you: sys_remap_file_pages is declared as asmlinkage
in mm/fremap.c, but is the one syscall declared without asmlinkage in
include/linux/syscalls.h.
parent 5ca68834
...@@ -951,7 +951,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, ...@@ -951,7 +951,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
} }
if (flags & MAP_POPULATE) { if (flags & MAP_POPULATE) {
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
sys_remap_file_pages(addr, len, prot, sys_remap_file_pages(addr, len, 0,
pgoff, flags & MAP_NONBLOCK); pgoff, flags & MAP_NONBLOCK);
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
} }
......
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