xfs: use struct iomap based DAX PMD fault path
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Tue, 8 Nov 2016 00:35:02 +0000 (11:35 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 8 Nov 2016 00:35:02 +0000 (11:35 +1100)
Switch xfs_filemap_pmd_fault() from using dax_pmd_fault() to the new and
improved dax_iomap_pmd_fault().  Also, now that it has no more users,
remove xfs_get_blocks_dax_fault().

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_aops.c
fs/xfs/xfs_aops.h
fs/xfs/xfs_file.c

index 3e57a56cf8294770475e5edd04d03ee5565516fa..561cf1456c6ca1ed07484e5daf455c6f40015959 100644 (file)
@@ -1298,8 +1298,7 @@ __xfs_get_blocks(
        sector_t                iblock,
        struct buffer_head      *bh_result,
        int                     create,
-       bool                    direct,
-       bool                    dax_fault)
+       bool                    direct)
 {
        struct xfs_inode        *ip = XFS_I(inode);
        struct xfs_mount        *mp = ip->i_mount;
@@ -1420,13 +1419,8 @@ __xfs_get_blocks(
                if (ISUNWRITTEN(&imap))
                        set_buffer_unwritten(bh_result);
                /* direct IO needs special help */
-               if (create) {
-                       if (dax_fault)
-                               ASSERT(!ISUNWRITTEN(&imap));
-                       else
-                               xfs_map_direct(inode, bh_result, &imap, offset,
-                                               is_cow);
-               }
+               if (create)
+                       xfs_map_direct(inode, bh_result, &imap, offset, is_cow);
        }
 
        /*
@@ -1466,7 +1460,7 @@ xfs_get_blocks(
        struct buffer_head      *bh_result,
        int                     create)
 {
-       return __xfs_get_blocks(inode, iblock, bh_result, create, false, false);
+       return __xfs_get_blocks(inode, iblock, bh_result, create, false);
 }
 
 int
@@ -1476,17 +1470,7 @@ xfs_get_blocks_direct(
        struct buffer_head      *bh_result,
        int                     create)
 {
-       return __xfs_get_blocks(inode, iblock, bh_result, create, true, false);
-}
-
-int
-xfs_get_blocks_dax_fault(
-       struct inode            *inode,
-       sector_t                iblock,
-       struct buffer_head      *bh_result,
-       int                     create)
-{
-       return __xfs_get_blocks(inode, iblock, bh_result, create, true, true);
+       return __xfs_get_blocks(inode, iblock, bh_result, create, true);
 }
 
 /*
index b3c6634f9518484d3e0d1691a53e7ff705a5f380..34dc00dfb91d803e074f99077eb89b98354f04d4 100644 (file)
@@ -59,9 +59,6 @@ int   xfs_get_blocks(struct inode *inode, sector_t offset,
                       struct buffer_head *map_bh, int create);
 int    xfs_get_blocks_direct(struct inode *inode, sector_t offset,
                              struct buffer_head *map_bh, int create);
-int    xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset,
-                                struct buffer_head *map_bh, int create);
-
 int    xfs_end_io_direct_write(struct kiocb *iocb, loff_t offset,
                ssize_t size, void *private);
 int    xfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size);
index e7f35d548cfc3fa4c36061aacfd1a91b7e9dfb66..ca2ab738fae24406d9fee1b1fada77e57436be29 100644 (file)
@@ -1711,7 +1711,7 @@ xfs_filemap_pmd_fault(
        }
 
        xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
-       ret = dax_pmd_fault(vma, addr, pmd, flags, xfs_get_blocks_dax_fault);
+       ret = dax_iomap_pmd_fault(vma, addr, pmd, flags, &xfs_iomap_ops);
        xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
 
        if (flags & FAULT_FLAG_WRITE)