1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (C) 2022-2023 Oracle. All Rights Reserved. 4 * Author: Darrick J. Wong <djwong@kernel.org> 5 */ 6 #ifndef __XFS_SCRUB_OFF_BITMAP_H__ 7 #define __XFS_SCRUB_OFF_BITMAP_H__ 8 9 /* Bitmaps, but for type-checked for xfs_fileoff_t */ 10 11 struct xoff_bitmap { 12 struct xbitmap64 offbitmap; 13 }; 14 15 static inline void xoff_bitmap_init(struct xoff_bitmap *bitmap) 16 { 17 xbitmap64_init(&bitmap->offbitmap); 18 } 19 20 static inline void xoff_bitmap_destroy(struct xoff_bitmap *bitmap) 21 { 22 xbitmap64_destroy(&bitmap->offbitmap); 23 } 24 25 static inline int xoff_bitmap_set(struct xoff_bitmap *bitmap, 26 xfs_fileoff_t off, xfs_filblks_t len) 27 { 28 return xbitmap64_set(&bitmap->offbitmap, off, len); 29 } 30 31 static inline int xoff_bitmap_walk(struct xoff_bitmap *bitmap, 32 xbitmap64_walk_fn fn, void *priv) 33 { 34 return xbitmap64_walk(&bitmap->offbitmap, fn, priv); 35 } 36 37 #endif /* __XFS_SCRUB_OFF_BITMAP_H__ */ 38