From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Move this header to libfrog since the code is there already. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- include/bitmap.h | 24 ------------------------ libfrog/Makefile | 1 + libfrog/bitmap.h | 24 ++++++++++++++++++++++++ repair/rmap.c | 2 +- scrub/phase6.c | 2 +- 5 files changed, 27 insertions(+), 26 deletions(-) delete mode 100644 include/bitmap.h create mode 100644 libfrog/bitmap.h diff --git a/include/bitmap.h b/include/bitmap.h deleted file mode 100644 index 99a2fb23..00000000 --- a/include/bitmap.h +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2018 Oracle. All Rights Reserved. - * Author: Darrick J. Wong <darrick.wong@xxxxxxxxxx> - */ -#ifndef LIBFROG_BITMAP_H_ -#define LIBFROG_BITMAP_H_ - -struct bitmap { - pthread_mutex_t bt_lock; - struct avl64tree_desc *bt_tree; -}; - -int bitmap_init(struct bitmap **bmap); -void bitmap_free(struct bitmap **bmap); -int bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length); -int bitmap_iterate(struct bitmap *bmap, int (*fn)(uint64_t, uint64_t, void *), - void *arg); -bool bitmap_test(struct bitmap *bmap, uint64_t start, - uint64_t len); -bool bitmap_empty(struct bitmap *bmap); -void bitmap_dump(struct bitmap *bmap); - -#endif /* LIBFROG_BITMAP_H_ */ diff --git a/libfrog/Makefile b/libfrog/Makefile index e766adba..2b199b45 100644 --- a/libfrog/Makefile +++ b/libfrog/Makefile @@ -30,6 +30,7 @@ workqueue.c HFILES = \ avl64.h \ bulkstat.h \ +bitmap.h \ crc32defs.h \ crc32table.h \ topology.h diff --git a/libfrog/bitmap.h b/libfrog/bitmap.h new file mode 100644 index 00000000..40119b9c --- /dev/null +++ b/libfrog/bitmap.h @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Oracle. All Rights Reserved. + * Author: Darrick J. Wong <darrick.wong@xxxxxxxxxx> + */ +#ifndef __LIBFROG_BITMAP_H__ +#define __LIBFROG_BITMAP_H__ + +struct bitmap { + pthread_mutex_t bt_lock; + struct avl64tree_desc *bt_tree; +}; + +int bitmap_init(struct bitmap **bmap); +void bitmap_free(struct bitmap **bmap); +int bitmap_set(struct bitmap *bmap, uint64_t start, uint64_t length); +int bitmap_iterate(struct bitmap *bmap, int (*fn)(uint64_t, uint64_t, void *), + void *arg); +bool bitmap_test(struct bitmap *bmap, uint64_t start, + uint64_t len); +bool bitmap_empty(struct bitmap *bmap); +void bitmap_dump(struct bitmap *bmap); + +#endif /* __LIBFROG_BITMAP_H__ */ diff --git a/repair/rmap.c b/repair/rmap.c index 47828a06..5dd6557a 100644 --- a/repair/rmap.c +++ b/repair/rmap.c @@ -12,7 +12,7 @@ #include "dinode.h" #include "slab.h" #include "rmap.h" -#include "bitmap.h" +#include "libfrog/bitmap.h" #undef RMAP_DEBUG diff --git a/scrub/phase6.c b/scrub/phase6.c index 5628b926..9b0d228a 100644 --- a/scrub/phase6.c +++ b/scrub/phase6.c @@ -12,7 +12,7 @@ #include "workqueue.h" #include "xfs_scrub.h" #include "common.h" -#include "bitmap.h" +#include "libfrog/bitmap.h" #include "disk.h" #include "filemap.h" #include "fscounters.h"