From b6c1beb967b0a4a1b8297ee6f4bc067a0ba32b0b Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 17 Oct 2017 21:37:38 -0700 Subject: xfs: create helpers to scan an allocation group Add some helpers to enable us to lock an AG's headers, create btree cursors for all btrees in that allocation group, and clean up afterwards. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner --- fs/xfs/scrub/scrub.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/xfs/scrub/scrub.c') diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index 71183a8678aa..1d0d609f9cf6 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -44,6 +44,8 @@ #include "scrub/scrub.h" #include "scrub/common.h" #include "scrub/trace.h" +#include "scrub/scrub.h" +#include "scrub/btree.h" /* * Online Scrub and Repair @@ -141,6 +143,7 @@ xfs_scrub_teardown( struct xfs_scrub_context *sc, int error) { + xfs_scrub_ag_free(sc, &sc->sa); if (sc->tp) { xfs_trans_cancel(sc->tp); sc->tp = NULL; @@ -241,6 +244,7 @@ retry_op: sc.sm = sm; sc.ops = ops; sc.try_harder = try_harder; + sc.sa.agno = NULLAGNUMBER; error = sc.ops->setup(&sc, ip); if (error) goto out_teardown; -- cgit v1.2.3