]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - libfrog/bitmap.h
libfrog: fix bitmap error communication problems
[thirdparty/xfsprogs-dev.git] / libfrog / bitmap.h
CommitLineData
959ef981 1// SPDX-License-Identifier: GPL-2.0+
0cf6f686
DW
2/*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
0cf6f686 4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
0cf6f686 5 */
a58400ed
DW
6#ifndef __LIBFROG_BITMAP_H__
7#define __LIBFROG_BITMAP_H__
0cf6f686
DW
8
9struct bitmap {
10 pthread_mutex_t bt_lock;
11 struct avl64tree_desc *bt_tree;
12};
13
233fabee 14int bitmap_alloc(struct bitmap **bmap);
0cf6f686 15void bitmap_free(struct bitmap **bmap);
93ab49dd
DW
16int bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length);
17int bitmap_iterate(struct bitmap *bmap, int (*fn)(uint64_t, uint64_t, void *),
18 void *arg);
0cf6f686
DW
19bool bitmap_test(struct bitmap *bmap, uint64_t start,
20 uint64_t len);
21bool bitmap_empty(struct bitmap *bmap);
22void bitmap_dump(struct bitmap *bmap);
23
a58400ed 24#endif /* __LIBFROG_BITMAP_H__ */