Linux XFS filesystem development
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] xfs: add handle for reflink in dax
@ 2019-04-17  1:27 Shiyang Ruan
  2019-04-17  1:27 ` [RFC PATCH 1/4] fs/iomap: Introduce src_addr for COW in fsdax mode Shiyang Ruan
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Shiyang Ruan @ 2019-04-17  1:27 UTC (permalink / raw)
  To: linux-xfs, linux-nvdimm

In XFS (under fsdax mode), reflink did not work correctly because xfs
iomap operators did not handle the inode with both reflink and dax flag.

This patchset aims to take care of this issue to make COW operation work
correctly in XFS.

XFS uses iomap to do read/write/mmap operations:
  vfs interface       xfs:
    iomap_bengin();     --> xfs_iomap_begin();
    actor();            --> dax_iomap_actor() / mmap actor function
    iomap_end();        --> xfs_iomap_end();

In xfs_iomap_begin(), COW operation is detected but not told to actor
function.  To resolve this, a new field 'src_addr' is added into
'struct iomap' to pass this COW info.  It means the start address of
source blocks in a COW operation, for actor functions to copy data
before writing.

In actor functions, the value of iomap->src_addr determines if it is a
COW operation.  If it is, copy data from source blocks to destination
blocks first, and then write user data.

After the COW operation, it is supposed to update the metadata of the
inode.  Added in xfs_iomap_end().


Shiyang Ruan (4):
  fs/iomap: Introduce src_addr for COW in fsdax mode.
  fs/xfs: iomap: add handle for reflink in fsdax mode
  fs/dax: copy source blocks before writing when COW
  fs/xfs: iomap: update the extent list after a COW

 fs/dax.c              | 70 +++++++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_iomap.c    | 23 +++++++++++---
 include/linux/iomap.h |  4 +++
 3 files changed, 93 insertions(+), 4 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-17  2:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-17  1:27 [RFC PATCH 0/4] xfs: add handle for reflink in dax Shiyang Ruan
2019-04-17  1:27 ` [RFC PATCH 1/4] fs/iomap: Introduce src_addr for COW in fsdax mode Shiyang Ruan
2019-04-17  1:27 ` [RFC PATCH 2/4] fs/xfs: iomap: add handle for reflink " Shiyang Ruan
2019-04-17  1:27 ` [RFC PATCH 3/4] fs/dax: copy source blocks before writing when COW Shiyang Ruan
2019-04-17  1:27 ` [RFC PATCH 4/4] fs/xfs: iomap: update the extent list after a COW Shiyang Ruan
2019-04-17  1:34 ` [RFC PATCH 0/4] xfs: add handle for reflink in dax Darrick J. Wong
2019-04-17  2:06   ` Shiyang Ruan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox