projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Streamline pattern/meta verifies instead of special casing them
[fio.git]
/
smalloc.c
diff --git
a/smalloc.c
b/smalloc.c
index 409998aa8ad5a66ebbc8ac7d2fb620553ac75880..fdf7d22ec4bf2b256f755842d97ec578baaa9fb9 100644
(file)
--- a/
smalloc.c
+++ b/
smalloc.c
@@
-10,9
+10,11
@@
#include <unistd.h>
#include <sys/types.h>
#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
#include <limits.h>
+#include <fcntl.h>
#include "mutex.h"
#include "arch/arch.h"
#include "mutex.h"
#include "arch/arch.h"
+#include "os/os.h"
#define SMALLOC_REDZONE /* define to detect memory corruption */
#define SMALLOC_REDZONE /* define to detect memory corruption */
@@
-200,6
+202,10
@@
static int add_pool(struct pool *pool, unsigned int alloc_size)
pool->nr_blocks = bitmap_blocks;
pool->free_blocks = bitmap_blocks * SMALLOC_BPB;
pool->nr_blocks = bitmap_blocks;
pool->free_blocks = bitmap_blocks * SMALLOC_BPB;
+#ifdef FIO_HAVE_FALLOCATE
+ posix_fallocate(fd, 0, alloc_size);
+#endif
+
if (ftruncate(fd, alloc_size) < 0)
goto out_unlink;
if (ftruncate(fd, alloc_size) < 0)
goto out_unlink;