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:
@@ -67,7 +67,7 @@ xfs_scrub_setup_inode(
|
||||
break;
|
||||
case -EFSCORRUPTED:
|
||||
case -EFSBADCRC:
|
||||
return xfs_scrub_trans_alloc(sc);
|
||||
return xfs_scrub_trans_alloc(sc, 0);
|
||||
default:
|
||||
return error;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ xfs_scrub_setup_inode(
|
||||
/* Got the inode, lock it and we're ready to go. */
|
||||
sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
|
||||
xfs_ilock(sc->ip, sc->ilock_flags);
|
||||
error = xfs_scrub_trans_alloc(sc);
|
||||
error = xfs_scrub_trans_alloc(sc, 0);
|
||||
if (error)
|
||||
goto out;
|
||||
sc->ilock_flags |= XFS_ILOCK_EXCL;
|
||||
|
Reference in New Issue
Block a user