File Index
Files and directories
Sign in
FILE

rtb_bitmap.h

File preview with syntax highlighting.

linux-6.19.14/fs/xfs/scrub/rtb_bitmap.h C
 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_RTB_BITMAP_H__
 7#define __XFS_SCRUB_RTB_BITMAP_H__
 8
 9/* Bitmaps, but for type-checked for xfs_rtblock_t */
10
11struct xrtb_bitmap {
12	struct xbitmap64	rtbitmap;
13};
14
15static inline void xrtb_bitmap_init(struct xrtb_bitmap *bitmap)
16{
17	xbitmap64_init(&bitmap->rtbitmap);
18}
19
20static inline void xrtb_bitmap_destroy(struct xrtb_bitmap *bitmap)
21{
22	xbitmap64_destroy(&bitmap->rtbitmap);
23}
24
25static inline int xrtb_bitmap_set(struct xrtb_bitmap *bitmap,
26		xfs_rtblock_t start, xfs_filblks_t len)
27{
28	return xbitmap64_set(&bitmap->rtbitmap, start, len);
29}
30
31static inline int xrtb_bitmap_walk(struct xrtb_bitmap *bitmap,
32		xbitmap64_walk_fn fn, void *priv)
33{
34	return xbitmap64_walk(&bitmap->rtbitmap, fn, priv);
35}
36
37#endif	/* __XFS_SCRUB_RTB_BITMAP_H__ */
~/ Read-only file preview.