Re: [PATCH v2 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-03 Thread ruansy.f...@fujitsu.com
> On Wed, Mar 03, 2021 at 09:57:48AM +, ruansy.f...@fujitsu.com wrote: > > > What is the advantage of the ioemap_end handler here? It adds another > > > indirect funtion call to the fast path, so if we can avoid it, I'd > > > rather do that. > > > > These code were in xfs_file_dax_write(). I

Re: [PATCH v2 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-03 Thread ruansy.f...@fujitsu.com
> > On Fri, Feb 26, 2021 at 08:20:29AM +0800, Shiyang Ruan wrote: > > error = iomap_zero_range(VFS_I(ip), offset, len, NULL, > > - &xfs_buffered_write_iomap_ops); > > + IS_DAX(VFS_I(ip)) ? > > + &xfs_dax_write_iomap_ops : &xfs_buffered_write_io

Re: [PATCH v2 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-03 Thread Christoph Hellwig
On Wed, Mar 03, 2021 at 09:57:48AM +, ruansy.f...@fujitsu.com wrote: > > What is the advantage of the ioemap_end handler here? It adds another > > indirect funtion call to the fast path, so if we can avoid it, I'd > > rather do that. > > These code were in xfs_file_dax_write(). I moved them

Re: [PATCH v2 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-03-03 Thread Christoph Hellwig
On Fri, Feb 26, 2021 at 08:20:29AM +0800, Shiyang Ruan wrote: > error = iomap_zero_range(VFS_I(ip), offset, len, NULL, > - &xfs_buffered_write_iomap_ops); > + IS_DAX(VFS_I(ip)) ? > + &xfs_dax_write_iomap_ops : &xfs_buffered_write_iomap_ops); Pl

[PATCH v2 09/10] fs/xfs: Handle CoW for fsdax write() path

2021-02-25 Thread Shiyang Ruan
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After CoW, new allocated extents needs to be remapped to the file. So, add an iomap_end for dax write ops to do the remapping work. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_bmap_util.c | 3 ++- fs/xfs/xfs_file.c | 9 +