xfs: rewrite xfs_reflink_end_cow to use intents
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Apr 2022 01:38:15 +0000 (18:38 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 28 Apr 2022 17:25:50 +0000 (10:25 -0700)
commitdf2fd88f8ac77f75a603d9fa5015225cc6c30edb
treecc07999d8751035b2e78b521c59be85f6e8ca842
parentb037c4eed2df4568a7702cd512d26625962f95b9
xfs: rewrite xfs_reflink_end_cow to use intents

Currently, the code that performs CoW remapping after a write has this
odd behavior where it walks /backwards/ through the data fork to remap
extents in reverse order.  Earlier, we rewrote the reflink remap
function to use deferred bmap log items instead of trying to cram as
much into the first transaction that we could.  Now do the same for the
CoW remap code.  There doesn't seem to be any performance impact; we're
just making better use of code that we added for the benefit of reflink.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_reflink.c
fs/xfs/xfs_trace.h