diff options
author | Christoph Hellwig <hch@lst.de> | 2016-06-21 09:55:18 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-06-21 09:55:18 +1000 |
commit | 459f0fbc2a827da37bbfaf3cae8da4ad8884da12 (patch) | |
tree | 80b44e5d30d805ee99a6bfdcbadbb535c5cae506 /fs/xfs/xfs_file.c | |
parent | d2bb140e99e6710c1b46e38a6347ada364aadfc6 (diff) | |
download | lwn-459f0fbc2a827da37bbfaf3cae8da4ad8884da12.tar.gz lwn-459f0fbc2a827da37bbfaf3cae8da4ad8884da12.zip |
xfs: use iomap infrastructure for DAX zeroing
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 7316d3841c53..090a90f0d02c 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -80,34 +80,6 @@ xfs_rw_ilock_demote( inode_unlock(VFS_I(ip)); } -static int -xfs_dax_zero_range( - struct inode *inode, - loff_t pos, - size_t count) -{ - int status = 0; - - do { - unsigned offset, bytes; - - offset = (pos & (PAGE_SIZE -1)); /* Within page */ - bytes = PAGE_SIZE - offset; - if (bytes > count) - bytes = count; - - status = dax_zero_page_range(inode, pos, bytes, - xfs_get_blocks_direct); - if (status) - break; - - pos += bytes; - count -= bytes; - } while (count); - - return status; -} - /* * Clear the specified ranges to zero through either the pagecache or DAX. * Holes and unwritten extents will be left as-is as they already are zeroed. @@ -118,12 +90,7 @@ xfs_iozero( loff_t pos, size_t count) { - struct inode *inode = VFS_I(ip); - - if (IS_DAX(VFS_I(ip))) - return xfs_dax_zero_range(inode, pos, count); - else - return iomap_zero_range(inode, pos, count, NULL, &xfs_iomap_ops); + return iomap_zero_range(VFS_I(ip), pos, count, NULL, &xfs_iomap_ops); } int |