| From: Shiyang Ruan <ruansy.fnst@fujitsu.com> |
| Subject: xfs: use dax ops for zero and truncate in fsdax mode |
| Date: Thu, 1 Dec 2022 15:32:10 +0000 |
| |
| Zero and truncate on a dax file may execute CoW. So use dax ops which |
| contains end work for CoW. |
| |
| Link: https://lkml.kernel.org/r/1669908730-131-1-git-send-email-ruansy.fnst@fujitsu.com |
| Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com> |
| Reviewed-by: Darrick J. Wong <djwong@kernel.org> |
| Cc: Alistair Popple <apopple@nvidia.com> |
| Cc: Dan Williams <dan.j.williams@intel.com> |
| Cc: Dave Chinner <david@fromorbit.com> |
| Cc: Jason Gunthorpe <jgg@nvidia.com> |
| Cc: John Hubbard <jhubbard@nvidia.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| fs/xfs/xfs_iomap.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| --- a/fs/xfs/xfs_iomap.c~xfs-use-dax-ops-for-zero-and-truncate-in-fsdax-mode |
| +++ a/fs/xfs/xfs_iomap.c |
| @@ -1370,7 +1370,7 @@ xfs_zero_range( |
| |
| if (IS_DAX(inode)) |
| return dax_zero_range(inode, pos, len, did_zero, |
| - &xfs_direct_write_iomap_ops); |
| + &xfs_dax_write_iomap_ops); |
| return iomap_zero_range(inode, pos, len, did_zero, |
| &xfs_buffered_write_iomap_ops); |
| } |
| @@ -1385,7 +1385,7 @@ xfs_truncate_page( |
| |
| if (IS_DAX(inode)) |
| return dax_truncate_page(inode, pos, did_zero, |
| - &xfs_direct_write_iomap_ops); |
| + &xfs_dax_write_iomap_ops); |
| return iomap_truncate_page(inode, pos, did_zero, |
| &xfs_buffered_write_iomap_ops); |
| } |
| _ |