diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:30 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:30 -0700 |
commit | 4cb76025208925f697de66ac4d2d821cafabd367 (patch) | |
tree | e0dd7385064298eda0828a9ca592e938ffc663c7 /fs/xfs/scrub/attr.c | |
parent | ee366fe4f519f0739a2c62cf998f58932e77c6a9 (diff) |
xfs: remove unnecessary dstmap in xattr scrubber
Replace bitmap_and with bitmap_intersects in the xattr leaf block
scrubber, since we only care if there's overlap between the used space
bitmap and the free space bitmap. This means we don't need dstmap any
more, and can thus reduce the memory requirements.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/attr.c')
-rw-r--r-- | fs/xfs/scrub/attr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c index 6bb0256d0689..45fa8a5967de 100644 --- a/fs/xfs/scrub/attr.c +++ b/fs/xfs/scrub/attr.c @@ -36,10 +36,10 @@ xchk_setup_xattr_buf( /* * We need enough space to read an xattr value from the file or enough - * space to hold three copies of the xattr free space bitmap. We don't + * space to hold two copies of the xattr free space bitmap. We don't * need the buffer space for both purposes at the same time. */ - sz = 3 * sizeof(long) * BITS_TO_LONGS(sc->mp->m_attr_geo->blksize); + sz = 2 * sizeof(long) * BITS_TO_LONGS(sc->mp->m_attr_geo->blksize); sz = max_t(size_t, sz, value_size); /* @@ -223,7 +223,6 @@ xchk_xattr_check_freemap( struct xfs_attr3_icleaf_hdr *leafhdr) { unsigned long *freemap = xchk_xattr_freemap(sc); - unsigned long *dstmap = xchk_xattr_dstmap(sc); unsigned int mapsize = sc->mp->m_attr_geo->blksize; int i; @@ -237,7 +236,7 @@ xchk_xattr_check_freemap( } /* Look for bits that are set in freemap and are marked in use. */ - return bitmap_and(dstmap, freemap, map, mapsize) == 0; + return !bitmap_intersects(freemap, map, mapsize); } /* |