]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sbitmap: add sbitmap_get_shallow() operation
authorOmar Sandoval <osandov@fb.com>
Fri, 14 Apr 2017 07:59:58 +0000 (00:59 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 14 Apr 2017 20:06:52 +0000 (14:06 -0600)
commitc05e66733788118377c21a913c1bc7b64bccc167
tree8c13d6e75fe1ceac7db6f1cb5b7723ba5fe742b7
parent84253394927c4352652d0b118ad9583f5646959b
sbitmap: add sbitmap_get_shallow() operation

This operation supports the use case of limiting the number of bits that
can be allocated for a given operation. Rather than setting aside some
bits at the end of the bitmap, we can set aside bits in each word of the
bitmap. This means we can keep the allocation hints spread out and
support sbitmap_resize() nicely at the cost of lower granularity for the
allowed depth.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/sbitmap.h
lib/sbitmap.c