#endif
}
-static int add_pool(struct pool *pool)
+static int add_pool(struct pool *pool, unsigned int alloc_size)
{
struct mem_hdr *hdr;
void *ptr;
if (fd < 0)
goto out_close;
- pool->size = smalloc_pool_size;
+ if (alloc_size > smalloc_pool_size)
+ pool->size = alloc_size;
+ else
+ pool->size = smalloc_pool_size;
+
if (ftruncate(fd, pool->size) < 0)
goto out_unlink;
#ifdef MP_SAFE
lock = fio_mutex_rw_init();
#endif
- ret = add_pool(&mp[0]);
+ ret = add_pool(&mp[0], INITIAL_SIZE);
assert(!ret);
}
else {
i = nr_pools;
global_read_unlock();
- if (add_pool(&mp[nr_pools]))
+ if (add_pool(&mp[nr_pools], size))
goto out;
global_read_lock();
}