diff options
Diffstat (limited to 'fs/xfs/scrub/bitmap.c')
-rw-r--r-- | fs/xfs/scrub/bitmap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c index bcba8c01ca18..af874c9febd5 100644 --- a/fs/xfs/scrub/bitmap.c +++ b/fs/xfs/scrub/bitmap.c @@ -331,3 +331,17 @@ xbitmap_empty( { return bitmap->xb_root.rb_root.rb_node == NULL; } + +/* Count the number of set regions in this bitmap. */ +uint64_t +xbitmap_count_set_regions( + struct xbitmap *bitmap) +{ + struct xbitmap_node *bn; + uint64_t nr = 0; + + for_each_xbitmap_extent(bn, bitmap) + nr++; + + return nr; +} |