1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (c) 2022-2024 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
6 #ifndef __XFS_SCRUB_DAB_BITMAP_H__
7 #define __XFS_SCRUB_DAB_BITMAP_H__
9 /* Bitmaps, but for type-checked for xfs_dablk_t */
12 struct xbitmap32 dabitmap
;
15 static inline void xdab_bitmap_init(struct xdab_bitmap
*bitmap
)
17 xbitmap32_init(&bitmap
->dabitmap
);
20 static inline void xdab_bitmap_destroy(struct xdab_bitmap
*bitmap
)
22 xbitmap32_destroy(&bitmap
->dabitmap
);
25 static inline int xdab_bitmap_set(struct xdab_bitmap
*bitmap
,
26 xfs_dablk_t dabno
, xfs_extlen_t len
)
28 return xbitmap32_set(&bitmap
->dabitmap
, dabno
, len
);
31 static inline bool xdab_bitmap_test(struct xdab_bitmap
*bitmap
,
32 xfs_dablk_t dabno
, xfs_extlen_t
*len
)
34 return xbitmap32_test(&bitmap
->dabitmap
, dabno
, len
);
37 #endif /* __XFS_SCRUB_DAB_BITMAP_H__ */