diff options
author | Huang Shijie <shijie8@gmail.com> | 2009-09-21 20:03:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:41 -0400 |
commit | cdf7b3418ad5a8783efe8f9124023d9b869fec0f (patch) | |
tree | 0504a26ba5d7cbbaa71bdd2911d55c6934de8be5 | |
parent | 03f6462a3ae78f36eb1f0ee8b4d5ae2f7859c1d5 (diff) |
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>
-rw-r--r-- | mm/mmap.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -963,11 +963,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
963 | vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) | | 963 | vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) | |
964 | mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; | 964 | mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC; |
965 | 965 | ||
966 | if (flags & MAP_LOCKED) { | 966 | if (flags & MAP_LOCKED) |
967 | if (!can_do_mlock()) | 967 | if (!can_do_mlock()) |
968 | return -EPERM; | 968 | return -EPERM; |
969 | vm_flags |= VM_LOCKED; | ||
970 | } | ||
971 | 969 | ||
972 | /* mlock MCL_FUTURE? */ | 970 | /* mlock MCL_FUTURE? */ |
973 | if (vm_flags & VM_LOCKED) { | 971 | if (vm_flags & VM_LOCKED) { |