]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: recover AG btree roots from rmap data
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 30 May 2018 05:18:10 +0000 (22:18 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 30 May 2018 15:03:14 +0000 (08:03 -0700)
commit70d3800f74b6a45b66fd6a94fc4c5af61761e55c
treed24ef043397075ac6f265c7d2397c5a40adc2466
parentf6086650d803bc4fe2f2610fd220d09b05849317
xfs: recover AG btree roots from rmap data

Add a helper function to help us recover btree roots from the rmap data.
Callers pass in a list of rmap owner codes, buffer ops, and magic
numbers.  We iterate the rmap records looking for owner matches, and
then read the matching blocks to see if the magic number & uuid match.
If so, we then read-verify the block, and if that passes then we retain
a pointer to the block with the highest level, assuming that by the end
of the call we will have found the root.  This will be used to reset the
AGF/AGI btree root fields during their rebuild procedures.

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