xfs: don't take the MMAPLOCK when scrubbing file metadata
authorDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:22 +0000 (19:00 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 12 Apr 2023 02:00:22 +0000 (19:00 -0700)
commit1fc7a0597d237c17b6501f8c33b76d3eaaae9079
tree0a255759b7315e807bc225c5c3be2bc7ffc17394
parent38bb13108479f5cac955bb291ea6aa6d24268f4f
xfs: don't take the MMAPLOCK when scrubbing file metadata

The MMAPLOCK stabilizes mappings in a file's pagecache.  Therefore, we
do not need it to check directories, symlinks, extended attributes, or
file-based metadata.  Reduce its usage to the one case that requires it,
which is when we want to scrub the data fork of a regular file.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/bmap.c
fs/xfs/scrub/common.c
fs/xfs/scrub/inode.c