xfs: add helpers to deal with transaction allocation and rolling

For repairs, we need to reserve at least as many blocks as we think
we're going to need to rebuild the data structure, and we're going to
need some helpers to roll transactions while maintaining locks on the AG
headers so that other threads cannot wander into the middle of a repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
This commit is contained in:
Darrick J. Wong
2018-05-29 22:18:08 -07:00
parent 51863d7dd7
commit 0a9633fa2f
6 changed files with 194 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ xfs_scrub_should_terminate(
return false;
}
int xfs_scrub_trans_alloc(struct xfs_scrub_context *sc);
int xfs_scrub_trans_alloc(struct xfs_scrub_context *sc, uint resblks);
bool xfs_scrub_process_error(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
xfs_agblock_t bno, int *error);
bool xfs_scrub_fblock_process_error(struct xfs_scrub_context *sc, int whichfork,