| |
| |
| |
| |
| |
| #ifndef __XFS_SCRUB_ATTR_H__ |
| #define __XFS_SCRUB_ATTR_H__ |
| |
| |
| |
| |
| struct xchk_xattr_buf { |
| <------> |
| <------>size_t sz; |
| |
| <------> |
| <------> * Memory buffer -- either used for extracting attr values while |
| <------> * walking the attributes; or for computing attr block bitmaps when |
| <------> * checking the attribute tree. |
| <------> * |
| <------> * 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. |
| <------> */ |
| <------>uint8_t buf[0]; |
| }; |
| |
| |
| static inline uint8_t * |
| xchk_xattr_valuebuf( |
| <------>struct xfs_scrub *sc) |
| { |
| <------>struct xchk_xattr_buf *ab = sc->buf; |
| |
| <------>return ab->buf; |
| } |
| |
| |
| static inline unsigned long * |
| xchk_xattr_usedmap( |
| <------>struct xfs_scrub *sc) |
| { |
| <------>struct xchk_xattr_buf *ab = sc->buf; |
| |
| <------>return (unsigned long *)ab->buf; |
| } |
| |
| |
| static inline unsigned long * |
| xchk_xattr_freemap( |
| <------>struct xfs_scrub *sc) |
| { |
| <------>return xchk_xattr_usedmap(sc) + |
| <------><------><------>BITS_TO_LONGS(sc->mp->m_attr_geo->blksize); |
| } |
| |
| |
| 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); |
| } |
| |
| int xchk_setup_xattr_buf(struct xfs_scrub *sc, size_t value_size, |
| <------><------>xfs_km_flags_t flags); |
| |
| #endif |
| |