mm, mpx: add "vm_flags_t vm_flags" arg to do_mmap_pgoff()

Add the additional "vm_flags_t vm_flags" argument to do_mmap_pgoff(),
rename it to do_mmap(), and re-introduce do_mmap_pgoff() as a simple
wrapper on top of do_mmap().  Perhaps we should update the callers of
do_mmap_pgoff() and kill it later.

This way mpx_mmap() can simply call do_mmap(vm_flags => VM_MPX) and do not
play with vm internals.

After this change mmap_region() has a single user outside of mmap.c,
arch/tile/mm/elf.c:arch_setup_additional_pages().  It would be nice to
change arch/tile/ and unexport mmap_region().

Signed-off-by: Oleg Nesterov <>
Acked-by: Dave Hansen <>
Tested-by: Dave Hansen <>
Signed-off-by: Kirill A. Shutemov <>
Cc: "H. Peter Anvin" <>
Cc: Andy Lutomirski <>
Cc: Ingo Molnar <>
Cc: Minchan Kim <>
Cc: Thomas Gleixner <>
Signed-off-by: Andrew Morton <>
4 files changed