diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-01-16 10:12:39 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-02-04 09:31:22 -0800 |
commit | babcf3e7ff0e5ac0cc5f583cc75278bc0ab633be (patch) | |
tree | 1afc5dbfcf6cd6677f8bf1d956429877425b66eb /fs/xfs/scrub/common.c | |
parent | d289cd66856e46b6eb56f5d6208daa131fd9da90 (diff) |
xfs: cross-reference the realtime rmapbtrealtime-rmap_2019-02-04
When we're scrubbing the realtime metadata, cross-reference
the rtrmapt.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/common.c')
-rw-r--r-- | fs/xfs/scrub/common.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index c5cbe245082c..3277c21bc914 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -32,6 +32,7 @@ #include "xfs_trans_priv.h" #include "xfs_attr.h" #include "xfs_reflink.h" +#include "xfs_rtrmap_btree.h" #include "scrub/xfs_scrub.h" #include "scrub/scrub.h" #include "scrub/common.h" @@ -574,6 +575,27 @@ xchk_perag_get( sa->pag = xfs_perag_get(mp, sa->agno); } +/* + * For scrubbing a realtime file, grab the rtrmapt. We follow the same + * resource release rules as xfs_scrub_ag_init. + */ +int +xchk_rt_init( + struct xfs_scrub *sc, + struct xchk_ag *sa) +{ + memset(sa, 0, sizeof(*sa)); + sa->agno = NULLAGNUMBER; + if (xfs_sb_version_hasrmapbt(&sc->mp->m_sb)) { + ASSERT(xfs_isilocked(sc->mp->m_rrmapip, + XFS_ILOCK_EXCL | XFS_ILOCK_SHARED)); + sa->rmap_cur = xfs_rtrmapbt_init_cursor(sc->mp, sc->tp, + sc->mp->m_rrmapip); + } + + return 0; +} + /* Per-scrubber setup functions */ /* |