From 64ac4940d557df8caab602eaea679ec7eaf9a57f Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Wed, 4 Jun 2014 16:07:33 -0700 Subject: [PATCH] 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 6cdec3a6f4bf..8a56d39df4ed 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -640,11 +640,10 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma, { struct address_space *mapping = NULL; - if (vma->vm_file) + if (vma->vm_file) { mapping = vma->vm_file->f_mapping; - - if (mapping) mutex_lock(&mapping->i_mmap_mutex); + } __vma_link(mm, vma, prev, rb_link, rb_parent); __vma_link_file(vma); -- 2.39.5