drm/atomic-helper: document drm_atomic_helper_check() restrictions
[drm/drm-misc.git] / fs / xfs / scrub / dab_bitmap.h
blob0c6e3aad43954273ee2007118fc6bf667c7e34ae
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (c) 2022-2024 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
5 */
6 #ifndef __XFS_SCRUB_DAB_BITMAP_H__
7 #define __XFS_SCRUB_DAB_BITMAP_H__
9 /* Bitmaps, but for type-checked for xfs_dablk_t */
11 struct xdab_bitmap {
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__ */