diff options
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index f0e8249722d4..db4acc1c3e73 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -1514,18 +1514,27 @@ xfs_filemap_fault( | |||
1514 | struct vm_area_struct *vma, | 1514 | struct vm_area_struct *vma, |
1515 | struct vm_fault *vmf) | 1515 | struct vm_fault *vmf) |
1516 | { | 1516 | { |
1517 | struct xfs_inode *ip = XFS_I(file_inode(vma->vm_file)); | 1517 | struct inode *inode = file_inode(vma->vm_file); |
1518 | int ret; | 1518 | int ret; |
1519 | 1519 | ||
1520 | trace_xfs_filemap_fault(ip); | 1520 | trace_xfs_filemap_fault(XFS_I(inode)); |
1521 | 1521 | ||
1522 | /* DAX can shortcut the normal fault path on write faults! */ | 1522 | /* DAX can shortcut the normal fault path on write faults! */ |
1523 | if ((vmf->flags & FAULT_FLAG_WRITE) && IS_DAX(VFS_I(ip))) | 1523 | if ((vmf->flags & FAULT_FLAG_WRITE) && IS_DAX(inode)) |
1524 | return xfs_filemap_page_mkwrite(vma, vmf); | 1524 | return xfs_filemap_page_mkwrite(vma, vmf); |
1525 | 1525 | ||
1526 | xfs_ilock(ip, XFS_MMAPLOCK_SHARED); | 1526 | xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED); |
1527 | ret = filemap_fault(vma, vmf); | 1527 | if (IS_DAX(inode)) { |
1528 | xfs_iunlock(ip, XFS_MMAPLOCK_SHARED); | 1528 | /* |
1529 | * we do not want to trigger unwritten extent conversion on read | ||
1530 | * faults - that is unnecessary overhead and would also require | ||
1531 | * changes to xfs_get_blocks_direct() to map unwritten extent | ||
1532 | * ioend for conversion on read-only mappings. | ||
1533 | */ | ||
1534 | ret = __dax_fault(vma, vmf, xfs_get_blocks_direct, NULL); | ||
1535 | } else | ||
1536 | ret = filemap_fault(vma, vmf); | ||
1537 | xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED); | ||
1529 | 1538 | ||
1530 | return ret; | 1539 | return ret; |
1531 | } | 1540 | } |