From: Jens Axboe Date: Tue, 27 May 2008 12:12:45 +0000 (+0200) Subject: smalloc: fix compile error X-Git-Tag: fio-1.21-rc2~5 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=808e9ea8dd3dc3d631a7982fa0c4b01547cb811a;hp=179446e0122d04ddbeb3d353ff68350490b0841c;p=fio.git smalloc: fix compile error Signed-off-by: Jens Axboe --- diff --git a/smalloc.c b/smalloc.c index 3b512bcf..3d3986b8 100644 --- a/smalloc.c +++ b/smalloc.c @@ -95,6 +95,11 @@ static inline int ptr_valid(struct pool *pool, void *ptr) return (ptr >= pool->map) && (ptr < pool->map + pool_size); } +static inline unsigned int size_to_blocks(unsigned int size) +{ + return (size + SMALLOC_BPB - 1) / SMALLOC_BPB; +} + static int blocks_iter(unsigned int *map, unsigned int idx, unsigned int nr_blocks, int (*func)(unsigned int *map, unsigned int mask)) @@ -367,11 +372,6 @@ void sfree(void *ptr) sfree_pool(pool, ptr); } -static inline unsigned int size_to_blocks(unsigned int size) -{ - return (size + SMALLOC_BPB - 1) / SMALLOC_BPB; -} - static void *__smalloc_pool(struct pool *pool, unsigned int size) { unsigned int nr_blocks;