1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
6 #ifndef __XFS_SCRUB_BITMAP_H__
7 #define __XFS_SCRUB_BITMAP_H__
9 struct xfs_bitmap_range {
10 struct list_head list;
16 struct list_head list;
19 void xfs_bitmap_init(struct xfs_bitmap *bitmap);
20 void xfs_bitmap_destroy(struct xfs_bitmap *bitmap);
22 #define for_each_xfs_bitmap_extent(bex, n, bitmap) \
23 list_for_each_entry_safe((bex), (n), &(bitmap)->list, list)
25 #define for_each_xfs_bitmap_block(b, bex, n, bitmap) \
26 list_for_each_entry_safe((bex), (n), &(bitmap)->list, list) \
27 for ((b) = bex->start; (b) < bex->start + bex->len; (b)++)
29 int xfs_bitmap_set(struct xfs_bitmap *bitmap, uint64_t start, uint64_t len);
30 int xfs_bitmap_disunion(struct xfs_bitmap *bitmap, struct xfs_bitmap *sub);
31 int xfs_bitmap_set_btcur_path(struct xfs_bitmap *bitmap,
32 struct xfs_btree_cur *cur);
33 int xfs_bitmap_set_btblocks(struct xfs_bitmap *bitmap,
34 struct xfs_btree_cur *cur);
36 #endif /* __XFS_SCRUB_BITMAP_H__ */