With dax we cannot deal with readpage() etc. So, we create a dax
comparison function which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
Reviewed-by: Darrick J. Wong
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed.
After that, new allocated extents needs to be remapped to the file. Add
an implementation of ->iomap_end() for dax write ops to do the remapping
work.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 39
Punch hole on a reflinked file needs dax_iomap_cow_copy() too.
Otherwise, data in not aligned area will be not correct. So, add the
srcmap to dax_iomap_zero() and replace memset() as dax_iomap_cow_copy().
Signed-off-by: Shiyang Ruan
Reviewed-by: Ritesh Harjani
Reviewed-by: Darrick J. Wong
---
We replace the existing entry to the newly allocated one in case of CoW.
Also, we mark the entry as PAGECACHE_TAG_TOWRITE so writeback marks this
entry as writeprotected. This helps us snapshots so new write
pagefaults after snapshots trigger a CoW.
Signed-off-by: Goldwyn Rodrigues
This patchset is attempt to add CoW support for fsdax, and take XFS,
which has both reflink and fsdax feature, as an example.
Changes from V7:
- Patch 3: Update to iter model[1]
- Patch 4: Add the missing memset() in CoW case
- Remove iomap_iter2(), use 2 nested iomap_iter() instead
- Patch
In the case where the iomap is a write operation and iomap is not equal
to srcmap after iomap_begin, we consider it is a CoW operation.
In this case, the destination (iomap->addr) points to a newly allocated
extent. It is needed to copy the data from srcmap to the extent. In
theory, it is
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
Reviewed-by: Dan Williams
---
Introduce xfs_mmaplock_two_inodes_and_break_dax_layout() for dax files
who are going to be deduped. After that, call compare range function
only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
Reviewed-by: Darrick J. Wong
---
fs/xfs/xfs_file.c| 2 +-
fs/xfs/xfs_inode.c | 57
8 matches
Mail list logo