]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - repair/bulkload.c
xfs_repair: sync bulkload data structures with kernel newbt code
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:49 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:28 +0000 (14:06 -0700)
commite88445180ea303cb9ae700061dce9c7d495d40f9
tree121002b989cadd45cef4eab896dc8e2c2bd2080e
parent164a5514c89f8aec82133207c1114c318631b494
xfs_repair: sync bulkload data structures with kernel newbt code

A lot of the code in repair/bulkload.c was backwardsported from new code
that eventually turned into newbt.c in online repair.  Since the offline
repair version got merged upstream years before the online repair code,
we now need to bring the offline version up to date with the kernel
again.

Right now, the bulkload.c code is just a fancy way to track space
extents that are fed to it by its callers.  The only caller, of course,
is phase 5, which builds new btrees in AG space that wasn't claimed by
any other data structure.  Hence there's no need to allocate
reservations out of the bnobt or put them back there.

However, the next patch adds the ability to generate new file-based
btrees.  For that we need to reorganize the code to allocate and free
space for new file-based btrees.  Let's just crib from the kernel
version.  Make each bulkload space reservation hold a reference to an AG
and track the space reservation in terms of per-AG extents instead of
fsblock extents.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
libxfs/libxfs_api_defs.h
repair/agbtree.c
repair/bulkload.c
repair/bulkload.h
repair/phase5.c