]> mj.ucw.cz Git - libucw.git/blobdiff - lib/qache.c
Replaced the DARY_ALLOC by a comment explaining when it doesn't work.
[libucw.git] / lib / qache.c
index a973be458a5d88f15fd6177bdfb14efdedc95eba..050f1c9a304d3eb6409afc0d83a75981b541214e 100644 (file)
@@ -7,10 +7,10 @@
 #undef LOCAL_DEBUG
 
 #include "lib/lib.h"
+#include "lib/bitops.h"
 #include "lib/fastbuf.h"
 #include "lib/qache.h"
 
-#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/mman.h>
@@ -313,7 +313,7 @@ qache_create(struct qache *q, struct qache_params *par)
   bzero(&h, sizeof(h));
   h.magic = QACHE_MAGIC;
   h.block_size = par->block_size;
-  h.block_shift = fls(h.block_size);
+  h.block_shift = bit_fls(h.block_size);
   h.num_blocks = par->cache_size >> h.block_shift;
   h.format_id = par->format_id;
   h.entry_table_start = sizeof(h);