diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-29 22:18:10 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-30 08:03:14 -0700 |
commit | 04a2b7b254f9c72bdcb819a99d95df8504c9b639 (patch) | |
tree | d24ef043397075ac6f265c7d2397c5a40adc2466 /fs/xfs/scrub/repair.h | |
parent | 12c6510e2ff17cf94cae08ba7b6d2355760dfd1d (diff) | |
download | linux-04a2b7b254f9c72bdcb819a99d95df8504c9b639.tar.bz2 |
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>
Diffstat (limited to 'fs/xfs/scrub/repair.h')
-rw-r--r-- | fs/xfs/scrub/repair.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h index f14aaab7df9e..c922ef06b894 100644 --- a/fs/xfs/scrub/repair.h +++ b/fs/xfs/scrub/repair.h @@ -77,6 +77,26 @@ int xfs_repair_reap_btree_extents(struct xfs_scrub_context *sc, struct xfs_repair_extent_list *exlist, struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type); +struct xfs_repair_find_ag_btree { + /* in: rmap owner of the btree we're looking for */ + uint64_t rmap_owner; + + /* in: buffer ops */ + const struct xfs_buf_ops *buf_ops; + + /* in: magic number of the btree */ + uint32_t magic; + + /* out: the highest btree block found and the tree height */ + xfs_agblock_t root; + unsigned int height; +}; + +int xfs_repair_find_ag_btree_roots(struct xfs_scrub_context *sc, + struct xfs_buf *agf_bp, + struct xfs_repair_find_ag_btree *btree_info, + struct xfs_buf *agfl_bp); + /* Metadata repairers */ int xfs_repair_probe(struct xfs_scrub_context *sc); |