]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - scrub/bitmap.h
xfsprogs: Release v6.7.0
[thirdparty/xfsprogs-dev.git] / scrub / bitmap.h
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6 #ifndef XFS_SCRUB_BITMAP_H_
7 #define XFS_SCRUB_BITMAP_H_
8
9 struct bitmap {
10 pthread_mutex_t bt_lock;
11 struct avl64tree_desc *bt_tree;
12 };
13
14 bool bitmap_init(struct bitmap **bmap);
15 void bitmap_free(struct bitmap **bmap);
16 bool bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length);
17 bool bitmap_iterate(struct bitmap *bmap,
18 bool (*fn)(uint64_t, uint64_t, void *), void *arg);
19 bool bitmap_test(struct bitmap *bmap, uint64_t start,
20 uint64_t len);
21 bool bitmap_empty(struct bitmap *bmap);
22 void bitmap_dump(struct bitmap *bmap);
23
24 #endif /* XFS_SCRUB_BITMAP_H_ */