]> git.baikalelectronics.ru Git - kernel.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)
commit33653005a52b994bf946a367d7deb865a5994b69
tree8c13d6e75fe1ceac7db6f1cb5b7723ba5fe742b7
parent4107d2450a03e914b37bd3c63766146019c9b0cd
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