1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2018-2023 Oracle. All Rights Reserved.
6 #ifndef __XFS_SCRUB_FSB_BITMAP_H__
7 #define __XFS_SCRUB_FSB_BITMAP_H__
9 /* Bitmaps, but for type-checked for xfs_fsblock_t */
12 struct xbitmap64 fsbitmap;
15 static inline void xfsb_bitmap_init(struct xfsb_bitmap *bitmap)
17 xbitmap64_init(&bitmap->fsbitmap);
20 static inline void xfsb_bitmap_destroy(struct xfsb_bitmap *bitmap)
22 xbitmap64_destroy(&bitmap->fsbitmap);
25 static inline int xfsb_bitmap_set(struct xfsb_bitmap *bitmap,
26 xfs_fsblock_t start, xfs_filblks_t len)
28 return xbitmap64_set(&bitmap->fsbitmap, start, len);
31 static inline int xfsb_bitmap_walk(struct xfsb_bitmap *bitmap,
32 xbitmap64_walk_fn fn, void *priv)
34 return xbitmap64_walk(&bitmap->fsbitmap, fn, priv);
37 #endif /* __XFS_SCRUB_FSB_BITMAP_H__ */