diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -336,14 +336,13 @@ vma_address(struct page *page, struct vm_area_struct *vma) | |||
336 | 336 | ||
337 | /* | 337 | /* |
338 | * At what user virtual address is page expected in vma? | 338 | * At what user virtual address is page expected in vma? |
339 | * checking that the page matches the vma. | 339 | * Caller should check the page is actually part of the vma. |
340 | */ | 340 | */ |
341 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) | 341 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) |
342 | { | 342 | { |
343 | if (PageAnon(page)) { | 343 | if (PageAnon(page)) |
344 | if (vma->anon_vma != page_anon_vma(page)) | 344 | ; |
345 | return -EFAULT; | 345 | else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { |
346 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { | ||
347 | if (!vma->vm_file || | 346 | if (!vma->vm_file || |
348 | vma->vm_file->f_mapping != page->mapping) | 347 | vma->vm_file->f_mapping != page->mapping) |
349 | return -EFAULT; | 348 | return -EFAULT; |