summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/scrub.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-10-17 21:37:38 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-10-26 15:38:24 -0700
commitb6c1beb967b0a4a1b8297ee6f4bc067a0ba32b0b (patch)
tree0052a17a745929b09c337c3296eb9d9cc6861632 /fs/xfs/scrub/scrub.c
parent37f3fa7f161d41d3424231e9ce4bd58b62a56fca (diff)
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 <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/scrub.c')
-rw-r--r--fs/xfs/scrub/scrub.c4
1 files changed, 4 insertions, 0 deletions
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;