diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 17:48:08 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 17:48:08 +0300 |
commit | 294012fb070e33fb4a0aace7ac8d26357b705cf4 (patch) | |
tree | 9f7238f717a67b2968c5f561563754b3dae61754 /fs/xfs/scrub/parent.c | |
parent | 17308539507c710682409d429746695c74c51336 (diff) | |
download | linux-294012fb070e33fb4a0aace7ac8d26357b705cf4.tar.xz |
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/parent.c')
-rw-r--r-- | fs/xfs/scrub/parent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c index 58d5dfb7ea21..e6155d86f791 100644 --- a/fs/xfs/scrub/parent.c +++ b/fs/xfs/scrub/parent.c @@ -150,8 +150,8 @@ xchk_parent_validate( lock_mode = xchk_parent_ilock_dir(dp); if (!lock_mode) { - xfs_iunlock(sc->ip, XFS_ILOCK_EXCL); - xfs_ilock(sc->ip, XFS_ILOCK_EXCL); + xchk_iunlock(sc, XFS_ILOCK_EXCL); + xchk_ilock(sc, XFS_ILOCK_EXCL); error = -EAGAIN; goto out_rele; } |