summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/common.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-08-30 15:45:48 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-10-09 09:39:32 -0700
commitbc1330ac5d09e7f21da88717b6351cb6187442db (patch)
tree9c0b8700b10a9d28f43de843130484f15aa14d6c /fs/xfs/scrub/common.c
parentb43a96391099d8a508ca2d9151cab96a04582040 (diff)
xfs: cross-reference the realtime rmapbtrealtime-rmap_2019-10-09
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.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index c825239dd2a3..385d4a509a71 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -26,6 +26,7 @@
#include "xfs_trans_priv.h"
#include "xfs_attr.h"
#include "xfs_reflink.h"
+#include "xfs_rtrmap_btree.h"
#include "scrub/scrub.h"
#include "scrub/common.h"
#include "scrub/trace.h"
@@ -584,6 +585,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 */
/*