xfs: use per-AG bitmaps to reap unused AG metadata blocks during repair
authorDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:04 +0000 (07:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:04 +0000 (07:48 -0700)
commit014ad53732d2bac34d21a251f3622a4da516e21b
treef9b4992eb13d93d826ee20edcfd4cc2d95230fe2
parent1c7ce115e521060819f6e9b6b6eb26ae0aee6596
xfs: use per-AG bitmaps to reap unused AG metadata blocks during repair

The AGFL repair code uses a series of bitmaps to figure out where there
are OWN_AG blocks that are not claimed by the free space and rmap
btrees.  These blocks become the new AGFL, and any overflow is reaped.
The bitmaps current track xfs_fsblock_t even though we already know the
AG number.

In the last patch, we introduced a new bitmap "type" for tracking
xfs_agblock_t extents.  Port the reaping code and the AGFL repair to use
this new type, which makes it very obvious what we're tracking.  This
also eliminates a bunch of unnecessary agblock <-> fsblock conversions.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/agheader_repair.c
fs/xfs/scrub/bitmap.c
fs/xfs/scrub/bitmap.h
fs/xfs/scrub/reap.c
fs/xfs/scrub/reap.h