• Shiyang Ruan's avatar
    fsdax: introduce dax_iomap_cow_copy() · ff17b8df
    Shiyang Ruan authored
    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 better to copy the head and tail ranges which is outside of
    the non-aligned area instead of copying the whole aligned range.  But in
    dax page fault, it will always be an aligned range.  So copy the whole
    range in this case.
    
    Link: https://lkml.kernel.org/r/20220603053738.1218681-10-ruansy.fnst@fujitsu.comSigned-off-by: default avatarShiyang Ruan <ruansy.fnst@fujitsu.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Dan Williams <dan.j.wiliams@intel.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
    Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
    Cc: Jane Chu <jane.chu@oracle.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
    Cc: Ritesh Harjani <riteshh@linux.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    ff17b8df
dax.c 49.9 KB