xfs: condense directories after a mapping exchange operation
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:20 +0000 (14:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:20 +0000 (14:54 -0700)
commitda165fbde23b84591b6ccdf6749277d2d767b770
tree65d61bdc1c42aad216974e1c8d120fb4e33ff765
parent497d7a2608f8b7329e92bdaaf745ca127a582ad9
xfs: condense directories after a mapping exchange operation

The previous commit added a new file mapping exchange flag that enables
us to perform post-swap processing on file2 once we're done exchanging
extent mappings.  Now add this ability for directories.

This isn't used anywhere right now, but we need to have the basic ondisk
flags in place so that a future online directory repair feature can
create salvaged dirents in a temporary directory and exchange the data
fork mappings when ready.  If one file is in extents format and the
other is inline, we will have to promote both to extents format to
perform the exchange.  After the exchange, we can try to condense the
fixed directory down to inline format if possible.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_exchmaps.c