+ alloc_size += sizeof(unsigned int);
+#endif
+ alloc_size += sizeof(struct block_hdr);
+ if (alloc_size < INITIAL_SIZE)
+ alloc_size = INITIAL_SIZE;
+
+ /* round up to nearest full number of blocks */
+ alloc_size = (alloc_size + SMALLOC_BPL - 1) & ~(SMALLOC_BPL - 1);
+ bitmap_blocks = alloc_size / SMALLOC_BPL;
+ alloc_size += bitmap_blocks * sizeof(unsigned int);
+ pool->mmap_size = alloc_size;
+
+ pool->nr_blocks = bitmap_blocks;
+ pool->free_blocks = bitmap_blocks * SMALLOC_BPB;
+
+#ifdef FIO_HAVE_FALLOCATE
+ ret = posix_fallocate(fd, 0, alloc_size);
+ if (ret > 0) {
+ fprintf(stderr, "posix_fallocate pool file failed: %s\n", strerror(ret));
+ goto out_unlink;
+ }