]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dax: use linear_page_index()
authorMatthew Wilcox <willy@linux.intel.com>
Tue, 8 Sep 2015 21:59:39 +0000 (14:59 -0700)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:49 +0000 (12:19 -0500)
Orabug: 22913653

I was basically open-coding it (thanks to copying code from do_fault()
which probably also needs to be fixed).

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3fdd1b479dbc03347e98f904f54133a9cef5521f)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/dax.c

index b51b2124f30c2b20a67f40258070e2ec5ee75ccf..212040db70792e42392c2c6ceec17b0b84136951 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -542,7 +542,7 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
        if ((pmd_addr + PMD_SIZE) > vma->vm_end)
                return VM_FAULT_FALLBACK;
 
-       pgoff = ((pmd_addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
+       pgoff = linear_page_index(vma, pmd_addr);
        size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT;
        if (pgoff >= size)
                return VM_FAULT_SIGBUS;