diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 16:48:08 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 16:48:08 +0200 |
commit | 294012fb070e33fb4a0aace7ac8d26357b705cf4 (patch) | |
tree | 9f7238f717a67b2968c5f561563754b3dae61754 /fs/xfs/scrub/quota.c | |
parent | xfs: get our own reference to inodes that we want to scrub (diff) | |
download | linux-294012fb070e33fb4a0aace7ac8d26357b705cf4.tar.xz linux-294012fb070e33fb4a0aace7ac8d26357b705cf4.zip |
xfs: wrap ilock/iunlock operations on sc->ip
Scrub tracks the resources that it's holding onto in the xfs_scrub
structure. This includes the inode being checked (if applicable) and
the inode lock state of that inode. Replace the open-coded structure
manipulation with a trivial helper to eliminate sources of error.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/quota.c')
-rw-r--r-- | fs/xfs/scrub/quota.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c index 19bf7f1182d4..5671c8153433 100644 --- a/fs/xfs/scrub/quota.c +++ b/fs/xfs/scrub/quota.c @@ -64,8 +64,7 @@ xchk_setup_quota( if (error) return error; - xfs_ilock(sc->ip, XFS_ILOCK_EXCL); - sc->ilock_flags = XFS_ILOCK_EXCL; + xchk_ilock(sc, XFS_ILOCK_EXCL); return 0; } @@ -239,13 +238,11 @@ xchk_quota( * data fork we have to drop ILOCK_EXCL to use the regular dquot * functions. */ - xfs_iunlock(sc->ip, sc->ilock_flags); - sc->ilock_flags = 0; + xchk_iunlock(sc, sc->ilock_flags); sqi.sc = sc; sqi.last_id = 0; error = xfs_qm_dqiterate(mp, dqtype, xchk_quota_item, &sqi); - sc->ilock_flags = XFS_ILOCK_EXCL; - xfs_ilock(sc->ip, sc->ilock_flags); + xchk_ilock(sc, XFS_ILOCK_EXCL); if (error == -ECANCELED) error = 0; if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, |