fio: refactor fallocate defines
[fio.git] / options.c
index 7431ed8cf188e360760fb0e8ac21bbaee6ec399e..5a2ab57c4e5294c3ac5cc52d38b4e2d6d4188aaf 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1410,6 +1410,8 @@ static int str_size_cb(void *data, unsigned long long *__val)
        if (parse_is_percent(v)) {
                td->o.size = 0;
                td->o.size_percent = -1ULL - v;
+               dprint(FD_PARSE, "SET size_percent %d\n",
+                                       td->o.size_percent);
        } else
                td->o.size = v;
 
@@ -2267,9 +2269,13 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = FIO_FSERVICE_PARETO,
                            .help = "Pareto randomized",
                          },
+                         { .ival = "normal",
+                           .oval = FIO_FSERVICE_GAUSS,
+                           .help = "Normal (Gaussian) randomized",
+                         },
                          { .ival = "gauss",
                            .oval = FIO_FSERVICE_GAUSS,
-                           .help = "Normal (Gaussian) distribution",
+                           .help = "Alias for normal",
                          },
                          { .ival = "roundrobin",
                            .oval = FIO_FSERVICE_RR,
@@ -2283,14 +2289,14 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .parent = "nrfiles",
                .hide   = 1,
        },
-#ifdef CONFIG_POSIX_FALLOCATE
+#ifdef FIO_HAVE_ANY_FALLOCATE
        {
                .name   = "fallocate",
                .lname  = "Fallocate",
                .type   = FIO_OPT_STR,
                .off1   = offsetof(struct thread_options, fallocate_mode),
                .help   = "Whether pre-allocation is performed when laying out files",
-               .def    = "posix",
+               .def    = "native",
                .category = FIO_OPT_C_FILE,
                .group  = FIO_OPT_G_INVALID,
                .posval = {
@@ -2298,10 +2304,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = FIO_FALLOCATE_NONE,
                            .help = "Do not pre-allocate space",
                          },
+                         { .ival = "native",
+                           .oval = FIO_FALLOCATE_NATIVE,
+                           .help = "Use native pre-allocation if possible",
+                         },
+#ifdef CONFIG_POSIX_FALLOCATE
                          { .ival = "posix",
                            .oval = FIO_FALLOCATE_POSIX,
                            .help = "Use posix_fallocate()",
                          },
+#endif
 #ifdef CONFIG_LINUX_FALLOCATE
                          { .ival = "keep",
                            .oval = FIO_FALLOCATE_KEEP_SIZE,
@@ -2313,20 +2325,22 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .oval = FIO_FALLOCATE_NONE,
                            .help = "Alias for 'none'",
                          },
+#ifdef CONFIG_POSIX_FALLOCATE
                          { .ival = "1",
                            .oval = FIO_FALLOCATE_POSIX,
                            .help = "Alias for 'posix'",
                          },
+#endif
                },
        },
-#else  /* CONFIG_POSIX_FALLOCATE */
+#else  /* FIO_HAVE_ANY_FALLOCATE */
        {
                .name   = "fallocate",
                .lname  = "Fallocate",
                .type   = FIO_OPT_UNSUPPORTED,
                .help   = "Your platform does not support fallocate",
        },
-#endif /* CONFIG_POSIX_FALLOCATE */
+#endif /* FIO_HAVE_ANY_FALLOCATE */
        {
                .name   = "fadvise_hint",
                .lname  = "Fadvise hint",