smalloc: fix compile error
authorJens Axboe <jens.axboe@oracle.com>
Tue, 27 May 2008 12:12:45 +0000 (14:12 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 27 May 2008 12:12:45 +0000 (14:12 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
smalloc.c

index 3b512bcf63cdee4f57b6377684d366546fb0e55c..3d3986b84cb2aeef3a89465c7dbb1a6239c88f82 100644 (file)
--- 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);
 }
 
        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))
 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);
 }
 
        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;
 static void *__smalloc_pool(struct pool *pool, unsigned int size)
 {
        unsigned int nr_blocks;