提交 64ac4940 编写于 作者: H Huang Shijie 提交者: Linus Torvalds

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: NHuang Shijie <b32955@freescale.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2329d375
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册