Re: sbitmap: check cleared bits when iterating busy bits

2018-12-03 Thread Jens Axboe
On 12/3/18 3:05 PM, Omar Sandoval wrote: > On Mon, Dec 03, 2018 at 02:56:17PM -0700, Jens Axboe wrote: >> When we are iterating the set bits in a word, we also need to factor in >> the cleared bits. Don't call fn() unless the bit is also not set in >> the cleared word. >> >> Fixes: ea86ea2cdced

Re: sbitmap: check cleared bits when iterating busy bits

2018-12-03 Thread Omar Sandoval
On Mon, Dec 03, 2018 at 02:56:17PM -0700, Jens Axboe wrote: > When we are iterating the set bits in a word, we also need to factor in > the cleared bits. Don't call fn() unless the bit is also not set in > the cleared word. > > Fixes: ea86ea2cdced ("sbitmap: ammortize cost of clearing bits") >

sbitmap: check cleared bits when iterating busy bits

2018-12-03 Thread Jens Axboe
When we are iterating the set bits in a word, we also need to factor in the cleared bits. Don't call fn() unless the bit is also not set in the cleared word. Fixes: ea86ea2cdced ("sbitmap: ammortize cost of clearing bits") Signed-off-by: Jens Axboe diff --git a/include/linux/sbitmap.h