Gitweb: http://git.kernel.org/linus/cdf7b3418ad5a8783efe8f9124023d9b869fec0f Commit: cdf7b3418ad5a8783efe8f9124023d9b869fec0f Parent: 03f6462a3ae78f36eb1f0ee8b4d5ae2f7859c1d5 Author: Huang Shijie <shijie8@gmail.com> AuthorDate: Mon Sep 21 17:03:36 2009 -0700 Committer: Linus Torvalds <torvalds@linux-foundation.org> CommitDate: Tue Sep 22 07:17:41 2009 -0700 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> --- mm/mmap.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 6eed98c..56eb871 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -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) { -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
