Message ID | 20180404191831.5378-31-jglisse@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/mm/internal.h b/mm/internal.h index e6bd35182dae..43e9ed27362f 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -336,7 +336,9 @@ extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma); static inline unsigned long __vma_address(struct page *page, struct vm_area_struct *vma) { - pgoff_t pgoff = page_to_pgoff(page); + struct address_space *mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL; + + pgoff_t pgoff = _page_to_pgoff(page, mapping); return vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); }