mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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: Huang Shijie <shijie8@gmail.com> Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
03f6462a3a
commit
cdf7b3418a
1 changed files with 1 additions and 3 deletions
|
@ -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) |
|
||||
mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
|
||||
|
||||
if (flags & MAP_LOCKED) {
|
||||
if (flags & MAP_LOCKED)
|
||||
if (!can_do_mlock())
|
||||
return -EPERM;
|
||||
vm_flags |= VM_LOCKED;
|
||||
}
|
||||
|
||||
/* mlock MCL_FUTURE? */
|
||||
if (vm_flags & VM_LOCKED) {
|
||||
|
|
Loading…
Reference in a new issue