sbitmap: Consider cleared bits in sbitmap_bitmap_show()
authorJohn Garry <john.garry@huawei.com>
Wed, 1 Jul 2020 08:06:25 +0000 (16:06 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Jul 2020 16:53:00 +0000 (10:53 -0600)
commit6bf0eb5504529cdf50a24135e4c4442a093c06d6
tree4205235a563d9b9558ddde2963ffce95e5f7aafc
parent1008fe6dc36dd87dfd02d4307f49162f0b4f1665
sbitmap: Consider cleared bits in sbitmap_bitmap_show()

sbitmap works by maintaining separate bitmaps of set and cleared bits.
The set bits are cleared in a batch, to save the burden of continuously
locking the "word" map to unset.

sbitmap_bitmap_show() only shows the set bits (in "word"), which is not
too much use, so mask out the cleared bits.

Fixes: ea86ea2cdced ("sbitmap: ammortize cost of clearing bits")
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c