diff options
author | Vincent Fu <vincent.fu@wdc.com> | 2019-09-03 13:44:45 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-03 12:32:01 -0600 |
commit | 4a479420d50eada0a7b9a972c529d75e2884732d (patch) | |
tree | 81f7c83c21a02616544a52053a5c7a6f99999fb2 | |
parent | 247aa73ad08ff4c2202878e7e4f0485403c7e97e (diff) | |
download | fio-4a479420d50eada0a7b9a972c529d75e2884732d.tar.gz fio-4a479420d50eada0a7b9a972c529d75e2884732d.tar.bz2 |
smalloc: use SMALLOC_BPI instead of SMALLOC_BPB in add_pool()
Change the calculation of free_blocks in add_pool() to use SMALLOC_BPI
instead of SMALLOC_BPB. These two constants are coincidentally the same
on Linux and Windows but SMALLOC_BPI is the correct one to use.
free_blocks is the number of available blocks of size SMALLOC_BPB. It is
the product of the number of unsigned integers in the bitmap
(bitmap_blocks) and the number of bits per unsigned integer
(SMALLOC_BPI).
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | smalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -173,7 +173,7 @@ static bool add_pool(struct pool *pool, unsigned int alloc_size) pool->mmap_size = alloc_size; pool->nr_blocks = bitmap_blocks; - pool->free_blocks = bitmap_blocks * SMALLOC_BPB; + pool->free_blocks = bitmap_blocks * SMALLOC_BPI; mmap_flags = OS_MAP_ANON; #ifdef CONFIG_ESX |