Commit cdf7b341 authored by Huang Shijie's avatar Huang Shijie Committed by Linus Torvalds

mmap: remove unnecessary code

If (flags & MAP_LOCKED) is true, it means vm_flags has already contained
the bit VM_LOCKED which is set by calc_vm_flag_bits().

So there is no need to reset it again, just remove it.
Signed-off-by: default avatarHuang Shijie <shijie8@gmail.com>
Acked-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 03f6462a
...@@ -963,11 +963,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, ...@@ -963,11 +963,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) | vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) |
mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
if (flags & MAP_LOCKED) { if (flags & MAP_LOCKED)
if (!can_do_mlock()) if (!can_do_mlock())
return -EPERM; return -EPERM;
vm_flags |= VM_LOCKED;
}
/* mlock MCL_FUTURE? */ /* mlock MCL_FUTURE? */
if (vm_flags & VM_LOCKED) { if (vm_flags & VM_LOCKED) {
......
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