Skip to content

Commit a7fd332

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: remove __xfs_filemap_fault
xfs_filemap_huge_fault only ever serves DAX faults, so hard code the call to xfs_dax_read_fault and open code __xfs_filemap_fault in the only remaining caller. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 1eb6fc0 commit a7fd332

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

fs/xfs/xfs_file.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,20 +1481,6 @@ xfs_write_fault(
14811481
return ret;
14821482
}
14831483

1484-
static vm_fault_t
1485-
__xfs_filemap_fault(
1486-
struct vm_fault *vmf,
1487-
unsigned int order)
1488-
{
1489-
struct inode *inode = file_inode(vmf->vma->vm_file);
1490-
1491-
if (IS_DAX(inode))
1492-
return xfs_dax_read_fault(vmf, order);
1493-
1494-
trace_xfs_read_fault(XFS_I(inode), order);
1495-
return filemap_fault(vmf);
1496-
}
1497-
14981484
static inline bool
14991485
xfs_is_write_fault(
15001486
struct vm_fault *vmf)
@@ -1507,10 +1493,17 @@ static vm_fault_t
15071493
xfs_filemap_fault(
15081494
struct vm_fault *vmf)
15091495
{
1496+
struct inode *inode = file_inode(vmf->vma->vm_file);
1497+
15101498
/* DAX can shortcut the normal fault path on write faults! */
1511-
if (IS_DAX(file_inode(vmf->vma->vm_file)) && xfs_is_write_fault(vmf))
1512-
return xfs_write_fault(vmf, 0);
1513-
return __xfs_filemap_fault(vmf, 0);
1499+
if (IS_DAX(inode)) {
1500+
if (xfs_is_write_fault(vmf))
1501+
return xfs_write_fault(vmf, 0);
1502+
return xfs_dax_read_fault(vmf, 0);
1503+
}
1504+
1505+
trace_xfs_read_fault(XFS_I(inode), 0);
1506+
return filemap_fault(vmf);
15141507
}
15151508

15161509
static vm_fault_t
@@ -1524,7 +1517,7 @@ xfs_filemap_huge_fault(
15241517
/* DAX can shortcut the normal fault path on write faults! */
15251518
if (xfs_is_write_fault(vmf))
15261519
return xfs_write_fault(vmf, order);
1527-
return __xfs_filemap_fault(vmf, order);
1520+
return xfs_dax_read_fault(vmf, order);
15281521
}
15291522

15301523
static vm_fault_t

0 commit comments

Comments
 (0)