• Darrick J. Wong's avatar
    xfs: create delalloc extents in CoW fork · 2a06705c
    Darrick J. Wong authored
    Wire up iomap_begin to detect shared extents and create delayed allocation
    extents in the CoW fork:
    
     1) Check if we already have an extent in the COW fork for the area.
        If so nothing to do, we can move along.
     2) Look up block number for the current extent, and if there is none
        it's not shared move along.
     3) Unshare the current extent as far as we are going to write into it.
        For this we avoid an additional COW fork lookup and use the
        information we set aside in step 1) above.
     4) Goto 1) unless we've covered the whole range.
    
    Last but not least, this updates the xfs_reflink_reserve_cow_range calling
    convention to pass a byte offset and length, as that is what both callers
    expect anyway.  This patch has been refactored considerably as part of the
    iomap transition.
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    2a06705c
xfs_reflink.h 1.29 KB