Skip to content

Commit 64ac494

Browse files
Huang Shijietorvalds
authored andcommitted
mm/mmap.c: remove the first mapping check
Remove the first mapping check for vma_link. Move the mutex_lock into the braces when vma->vm_file is true. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2329d37 commit 64ac494

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎mm/mmap.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,10 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
640640
{
641641
struct address_space *mapping = NULL;
642642

643-
if (vma->vm_file)
643+
if (vma->vm_file) {
644644
mapping = vma->vm_file->f_mapping;
645-
646-
if (mapping)
647645
mutex_lock(&mapping->i_mmap_mutex);
646+
}
648647

649648
__vma_link(mm, vma, prev, rb_link, rb_parent);
650649
__vma_link_file(vma);

0 commit comments

Comments
 (0)