X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=mutex.c;h=88044f3a818753feb374bc0370e545fb2095d248;hp=abe073f4ffdf7d49ee92500db8d89e254def2852;hb=3a8600b4ae9027d02aca7eb1990e5cda4e9f423a;hpb=18a56e5e5b942060a57b70114c1963bda777ce3f diff --git a/mutex.c b/mutex.c index abe073f4..88044f3a 100644 --- a/mutex.c +++ b/mutex.c @@ -33,6 +33,14 @@ struct fio_mutex *fio_mutex_init(int value) return NULL; } +#ifdef FIO_HAVE_FALLOCATE + ret = posix_fallocate(fd, 0, sizeof(struct fio_mutex)); + if (ret > 0) { + fprintf(stderr, "posix_fallocate mutex failed: %s\n", strerror(ret)); + goto err; + } +#endif + if (ftruncate(fd, sizeof(struct fio_mutex)) < 0) { perror("ftruncate mutex"); goto err;