diff options
author | Huang Shijie <b32955@freescale.com> | 2014-06-04 19:07:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:01 -0400 |
commit | 64ac4940d557df8caab602eaea679ec7eaf9a57f (patch) | |
tree | e4497bc71d3b43510beb12927e65adeb59391462 | |
parent | 2329d3751b082b4fd354f334a88662d72abac52d (diff) |
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>
-rw-r--r-- | mm/mmap.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -640,11 +640,10 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma, | |||
640 | { | 640 | { |
641 | struct address_space *mapping = NULL; | 641 | struct address_space *mapping = NULL; |
642 | 642 | ||
643 | if (vma->vm_file) | 643 | if (vma->vm_file) { |
644 | mapping = vma->vm_file->f_mapping; | 644 | mapping = vma->vm_file->f_mapping; |
645 | |||
646 | if (mapping) | ||
647 | mutex_lock(&mapping->i_mmap_mutex); | 645 | mutex_lock(&mapping->i_mmap_mutex); |
646 | } | ||
648 | 647 | ||
649 | __vma_link(mm, vma, prev, rb_link, rb_parent); | 648 | __vma_link(mm, vma, prev, rb_link, rb_parent); |
650 | __vma_link_file(vma); | 649 | __vma_link_file(vma); |