helper_thread: split into separate file
[fio.git] / options.c
index eebd77a0fb3e1cea05ab9ce71ca121286dc8bca4..980b7e5e48d23a8cad051c197ea00b8664235666 100644 (file)
--- a/options.c
+++ b/options.c
 
 char client_sockaddr_str[INET6_ADDRSTRLEN] = { 0 };
 
+struct pattern_fmt_desc fmt_desc[] = {
+       {
+               .fmt   = "%o",
+               .len   = FIELD_SIZE(struct io_u *, offset),
+               .paste = paste_blockoff
+       }
+};
+
 /*
  * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
  */
@@ -219,9 +227,6 @@ static int str_bssplit_cb(void *data, const char *input)
        char *str, *p;
        int ret = 0;
 
-       if (parse_dryrun())
-               return 0;
-
        p = str = strdup(input);
 
        strip_blank_front(&str);
@@ -229,6 +234,16 @@ static int str_bssplit_cb(void *data, const char *input)
 
        ret = str_split_parse(td, str, bssplit_ddir);
 
+       if (parse_dryrun()) {
+               int i;
+
+               for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+                       free(td->o.bssplit[i]);
+                       td->o.bssplit[i] = NULL;
+                       td->o.bssplit_nr[i] = 0;
+               }
+       }
+
        free(p);
        return ret;
 }
@@ -902,6 +917,18 @@ static int parse_zoned_distribution(struct thread_data *td, const char *input)
                }
        }
 
+       if (parse_dryrun()) {
+               int i;
+
+               for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+                       free(td->o.zone_split[i]);
+                       td->o.zone_split[i] = NULL;
+                       td->o.zone_split_nr[i] = 0;
+               }
+
+               return ret;
+       }
+
        if (!ret)
                td_zone_gen_index(td);
        else {
@@ -918,9 +945,6 @@ static int str_random_distribution_cb(void *data, const char *str)
        double val;
        char *nr;
 
-       if (parse_dryrun())
-               return 0;
-
        if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
                val = FIO_DEF_ZIPF;
        else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
@@ -946,18 +970,24 @@ static int str_random_distribution_cb(void *data, const char *str)
                        log_err("fio: zipf theta must different than 1.0\n");
                        return 1;
                }
+               if (parse_dryrun())
+                       return 0;
                td->o.zipf_theta.u.f = val;
        } else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) {
                if (val <= 0.00 || val >= 1.00) {
                        log_err("fio: pareto input out of range (0 < input < 1.0)\n");
                        return 1;
                }
+               if (parse_dryrun())
+                       return 0;
                td->o.pareto_h.u.f = val;
        } else {
                if (val <= 0.00 || val >= 100.0) {
                        log_err("fio: normal deviation out of range (0 < input < 100.0)\n");
                        return 1;
                }
+               if (parse_dryrun())
+                       return 0;
                td->o.gauss_dev.u.f = val;
        }
 
@@ -1162,20 +1192,13 @@ static int str_dedupe_cb(void *data, unsigned long long *il)
 
 static int str_verify_pattern_cb(void *data, const char *input)
 {
-       struct pattern_fmt_desc fmt_desc[] = {
-               {
-                       .fmt   = "%o",
-                       .len   = FIELD_SIZE(struct io_u *, offset),
-                       .paste = paste_blockoff
-               }
-       };
        struct thread_data *td = data;
        int ret;
 
        td->o.verify_fmt_sz = ARRAY_SIZE(td->o.verify_fmt);
        ret = parse_and_fill_pattern(input, strlen(input), td->o.verify_pattern,
-                       MAX_PATTERN_SIZE, fmt_desc, sizeof(fmt_desc),
-                       td->o.verify_fmt, &td->o.verify_fmt_sz);
+                                    MAX_PATTERN_SIZE, fmt_desc, sizeof(fmt_desc),
+                                    td->o.verify_fmt, &td->o.verify_fmt_sz);
        if (ret < 0)
                return 1;
 
@@ -1448,7 +1471,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .help = "Use preadv/pwritev",
                          },
 #endif
-#ifdef CONFIG_PWRITEV
+#ifdef CONFIG_PWRITEV2
                          { .ival = "pvsync2",
                            .help = "Use preadv2/pwritev2",
                          },
@@ -1545,6 +1568,12 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                          { .ival = "libhdfs",
                            .help = "Hadoop Distributed Filesystem (HDFS) engine"
                          },
+#endif
+#ifdef CONFIG_PMEMBLK
+                         { .ival = "pmemblk",
+                           .help = "NVML libpmemblk based IO engine",
+                         },
+
 #endif
                          { .ival = "external",
                            .help = "Load external engine (append name)",