From: Jens Axboe Date: Thu, 24 Jan 2013 22:00:25 +0000 (-0700) Subject: Correct ifdef checks for posix and linux fallocate X-Git-Tag: fio-2.0.14~83 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=97ac992c99d89eed8cdf9249bb038ac4d7b709b9 Correct ifdef checks for posix and linux fallocate Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index d0aef21a..6f0a876d 100644 --- a/filesetup.c +++ b/filesetup.c @@ -15,7 +15,7 @@ #include "hash.h" #include "lib/axmap.h" -#ifdef FIO_HAVE_LINUX_FALLOCATE +#ifdef CONFIG_LINUX_FALLOCATE #include #endif @@ -72,7 +72,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) return 1; } -#ifdef FIO_HAVE_FALLOCATE +#ifdef CONFIG_POSIX_FALLOCATE if (!td->o.fill_device) { switch (td->o.fallocate_mode) { case FIO_FALLOCATE_NONE: @@ -87,7 +87,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) strerror(r)); } break; -#ifdef FIO_HAVE_LINUX_FALLOCATE +#ifdef CONFIG_LINUX_FALLOCATE case FIO_FALLOCATE_KEEP_SIZE: dprint(FD_FILE, "fallocate(FALLOC_FL_KEEP_SIZE) " @@ -100,14 +100,14 @@ static int extend_file(struct thread_data *td, struct fio_file *f) td_verror(td, errno, "fallocate"); } break; -#endif /* FIO_HAVE_LINUX_FALLOCATE */ +#endif /* CONFIG_LINUX_FALLOCATE */ default: log_err("fio: unknown fallocate mode: %d\n", td->o.fallocate_mode); assert(0); } } -#endif /* FIO_HAVE_FALLOCATE */ +#endif /* CONFIG_POSIX_FALLOCATE */ if (!new_layout) goto done; diff --git a/options.c b/options.c index 2b71abdd..da9a9533 100644 --- a/options.c +++ b/options.c @@ -1578,7 +1578,7 @@ static struct fio_option options[FIO_MAX_OPTS] = { }, .parent = "nrfiles", }, -#ifdef FIO_HAVE_FALLOCATE +#ifdef CONFIG_POSIX_FALLOCATE { .name = "fallocate", .type = FIO_OPT_STR, @@ -1594,7 +1594,7 @@ static struct fio_option options[FIO_MAX_OPTS] = { .oval = FIO_FALLOCATE_POSIX, .help = "Use posix_fallocate()", }, -#ifdef FIO_HAVE_LINUX_FALLOCATE +#ifdef CONFIG_LINUX_FALLOCATE { .ival = "keep", .oval = FIO_FALLOCATE_KEEP_SIZE, .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)", @@ -1611,7 +1611,7 @@ static struct fio_option options[FIO_MAX_OPTS] = { }, }, }, -#endif /* FIO_HAVE_FALLOCATE */ +#endif /* CONFIG_POSIX_FALLOCATE */ { .name = "fadvise_hint", .type = FIO_OPT_BOOL, diff --git a/os/os-windows.h b/os/os-windows.h index f68f654c..3a856374 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -22,7 +22,6 @@ #define FIO_HAVE_CHARDEV_SIZE #define FIO_HAVE_FDATASYNC #define FIO_HAVE_WINDOWSAIO -#define FIO_HAVE_FALLOCATE #define FIO_HAVE_GETTID #define FIO_USE_GENERIC_RAND