xfs: reintroduce reaping of file metadata blocks to xrep_reap_extents
authorDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:38 +0000 (10:03 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:38 +0000 (10:03 -0800)
commit66da11280f7ecd77abd999c469efc0dd643f26f5
tree5eab1aa9ee0113dfaae9917a889791474a45f573
parentc3a22c2e4b45fcf3184e7dd1c755e6b45dc9f499
xfs: reintroduce reaping of file metadata blocks to xrep_reap_extents

Back in commit a55e07308831b ("xfs: only allow reaping of per-AG
blocks in xrep_reap_extents"), we removed from the reaping code the
ability to handle bmbt blocks.  At the time, the reaping code only
walked single blocks, didn't correctly detect crosslinked blocks, and
the special casing made the function hard to understand.  It was easier
to remove unneeded functionality prior to fixing all the bugs.

Now that we've fixed the problems, we want again the ability to reap
file metadata blocks.  Reintroduce the per-file reaping functionality
atop the current implementation.  We require that sc->sa is
uninitialized, so that we can use it to hold all the per-AG context for
a given extent.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/fsb_bitmap.h [new file with mode: 0644]
fs/xfs/scrub/reap.c
fs/xfs/scrub/reap.h
fs/xfs/scrub/repair.h