diff options
author | Oleg Nesterov <oleg@redhat.com> | 2015-09-09 18:39:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | 1fcfd8db7f82fa1f533a6f0e4155614ff4144d56 (patch) | |
tree | 958b38ccd3bdd3bc97de154bf7bf322ff09637db /include/linux/mm.h | |
parent | 7cbea8dc0127a95226c7722a738ac6534950ef67 (diff) |
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().
[kirill@shutemov.name: fix build]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index f25a957bf0ab..fda728e3c27d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1873,11 +1873,19 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo | |||
1873 | 1873 | ||
1874 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1874 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
1875 | unsigned long len, vm_flags_t vm_flags, unsigned long pgoff); | 1875 | unsigned long len, vm_flags_t vm_flags, unsigned long pgoff); |
1876 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | 1876 | extern unsigned long do_mmap(struct file *file, unsigned long addr, |
1877 | unsigned long len, unsigned long prot, unsigned long flags, | 1877 | unsigned long len, unsigned long prot, unsigned long flags, |
1878 | unsigned long pgoff, unsigned long *populate); | 1878 | vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate); |
1879 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); | 1879 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); |
1880 | 1880 | ||
1881 | static inline unsigned long | ||
1882 | do_mmap_pgoff(struct file *file, unsigned long addr, | ||
1883 | unsigned long len, unsigned long prot, unsigned long flags, | ||
1884 | unsigned long pgoff, unsigned long *populate) | ||
1885 | { | ||
1886 | return do_mmap(file, addr, len, prot, flags, 0, pgoff, populate); | ||
1887 | } | ||
1888 | |||
1881 | #ifdef CONFIG_MMU | 1889 | #ifdef CONFIG_MMU |
1882 | extern int __mm_populate(unsigned long addr, unsigned long len, | 1890 | extern int __mm_populate(unsigned long addr, unsigned long len, |
1883 | int ignore_errors); | 1891 | int ignore_errors); |