summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/common.c7
-rw-r--r--fs/xfs/scrub/fscounters.c4
2 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 48bcaa4c328a..9c49c90055f5 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -28,6 +28,7 @@
#include "xfs_reflink.h"
#include "xfs_ag.h"
#include "xfs_error.h"
+#include "xfs_rtalloc.h"
#include "scrub/scrub.h"
#include "scrub/common.h"
#include "scrub/trace.h"
@@ -609,8 +610,7 @@ xchk_rt_init(
struct xfs_scrub *sc,
struct xchk_rt *sr)
{
- xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP);
- xfs_ilock(sc->mp->m_rsumip, XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM);
+ xfs_rtlock(NULL, sc->mp, XFS_RTLOCK_ALL);
sr->locked = true;
}
@@ -626,8 +626,7 @@ xchk_rt_unlock(
if (!sr->locked)
return;
- xfs_iunlock(sc->mp->m_rsumip, XFS_ILOCK_EXCL);
- xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_EXCL);
+ xfs_rtunlock(sc->mp, XFS_RTLOCK_ALL);
sr->locked = false;
}
diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c
index 3d81d808464e..22bb734fb81a 100644
--- a/fs/xfs/scrub/fscounters.c
+++ b/fs/xfs/scrub/fscounters.c
@@ -317,7 +317,7 @@ xchk_fscount_check_frextents(
}
fsc->frextents = 0;
- xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_EXCL);
+ xfs_rtlock(NULL, sc->mp, XFS_RTLOCK_ALL);
error = xfs_rtalloc_query_all(sc->tp, xchk_fscount_add_frextent, fsc);
if (error)
goto out_unlock;
@@ -336,7 +336,7 @@ xchk_fscount_check_frextents(
spin_unlock(&mp->m_sb_lock);
out_unlock:
- xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_EXCL);
+ xfs_rtunlock(sc->mp, XFS_RTLOCK_ALL);
return error;
}
#else