xfs: add helpers to collect and sift btree block pointers during repair
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 30 May 2018 05:18:09 +0000 (22:18 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 30 May 2018 15:03:14 +0000 (08:03 -0700)
commit64a39d876e77264dbd06ec27564d9e4eed1c6786
tree0120120ceb502bd8d6dd4ee6554f8cba76bc873c
parent73d6b42aa4dcdd7cdc07a945f035b0c1ca48f891
xfs: add helpers to collect and sift btree block pointers during repair

Add some helpers to assemble a list of fs block extents.  Generally,
repair functions will iterate the rmapbt to make a list (1) of all
extents owned by the nominal owner of the metadata structure; then they
will iterate all other structures with the same rmap owner to make a
list (2) of active blocks; and finally we have a subtraction function to
subtract all the blocks in (2) from (1), with the result that (1) is now
a list of blocks that were owned by the old btree and must be disposed.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/repair.c
fs/xfs/scrub/repair.h