diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2010-08-09 20:19:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:44:59 -0400 |
commit | 21d0d443cdc1658a8c1484fdcece4803f0f96d0e (patch) | |
tree | 1ee41c66f24972ed427ce43780cb53efca82dcaf /mm | |
parent | 288468c334e98aacbb7e2fb8bde6bc1adcd55e05 (diff) |
rmap: resurrect page_address_in_vma anon_vma check
With root anon-vma it's trivial to keep doing the usual check as in
old-anon-vma code.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/rmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -364,9 +364,10 @@ vma_address(struct page *page, struct vm_area_struct *vma) | |||
364 | */ | 364 | */ |
365 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) | 365 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) |
366 | { | 366 | { |
367 | if (PageAnon(page)) | 367 | if (PageAnon(page)) { |
368 | ; | 368 | if (vma->anon_vma->root != page_anon_vma(page)->root) |
369 | else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { | 369 | return -EFAULT; |
370 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { | ||
370 | if (!vma->vm_file || | 371 | if (!vma->vm_file || |
371 | vma->vm_file->f_mapping != page->mapping) | 372 | vma->vm_file->f_mapping != page->mapping) |
372 | return -EFAULT; | 373 | return -EFAULT; |