summaryrefslogtreecommitdiffstats
path: root/fs/dax.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2015-09-08 14:59:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-08 15:35:28 -0700
commit3fdd1b479dbc03347e98f904f54133a9cef5521f (patch)
tree51a2c593661f4fa8272cc6882778f143a5eead17 /fs/dax.c
parent73a6ec47f68787df1b41869def52915da2f4a6b7 (diff)
downloadop-kernel-dev-3fdd1b479dbc03347e98f904f54133a9cef5521f.zip
op-kernel-dev-3fdd1b479dbc03347e98f904f54133a9cef5521f.tar.gz
dax: use linear_page_index()
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>
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 74838c4..9ef9b80 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -529,7 +529,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;
OpenPOWER on IntegriCloud