/*
* 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);
/*
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;
}
/* 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);
}
/*
* Each bitmap contains enough bits to track every byte in an attr
* block (rounded up to the size of an unsigned long). The attr block
* used space bitmap starts at the beginning of the buffer; the free
- * space bitmap follows immediately after; and we have a third buffer
- * for storing intermediate bitmap results.
+ * space bitmap follows immediately after.
*/
uint8_t buf[];
};
BITS_TO_LONGS(sc->mp->m_attr_geo->blksize);
}
-/* A bitmap used to hold temporary results. */
-static inline unsigned long *
-xchk_xattr_dstmap(
- struct xfs_scrub *sc)
-{
- return xchk_xattr_freemap(sc) +
- BITS_TO_LONGS(sc->mp->m_attr_geo->blksize);
-}
-
#endif /* __XFS_SCRUB_ATTR_H__ */