Revert "Fix parser bug with ranges"
[fio.git] / options.c
index 3d8a720469655d82520bfe6e70d83bf5a0fde914..74c24d02d5d4bc200da3cf671c64d363d02e92a4 100644 (file)
--- a/options.c
+++ b/options.c
@@ -203,14 +203,44 @@ static int str_rw_cb(void *data, const char *str)
        char *nr = get_opt_postfix(str);
 
        td->o.ddir_seq_nr = 1;
-       if (nr) {
+       td->o.ddir_seq_add = 0;
+
+       if (!nr)
+               return 0;
+
+       if (td_random(td))
                td->o.ddir_seq_nr = atoi(nr);
-               free(nr);
+       else {
+               long long val;
+
+               if (str_to_decimal(nr, &val, 1, td)) {
+                       log_err("fio: rw postfix parsing failed\n");
+                       free(nr);
+                       return 1;
+               }
+
+               td->o.ddir_seq_add = val;
        }
 
+       free(nr);
        return 0;
 }
 
+#ifdef FIO_HAVE_LIBAIO
+static int str_libaio_cb(void *data, const char *str)
+{
+       struct thread_data *td = data;
+
+       if (!strcmp(str, "userspace_reap")) {
+               td->o.userspace_libaio_reap = 1;
+               return 0;
+       }
+
+       log_err("fio: bad libaio sub-option: %s\n", str);
+       return 1;
+}
+#endif
+
 static int str_mem_cb(void *data, const char *mem)
 {
        struct thread_data *td = data;
@@ -946,6 +976,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
 #ifdef FIO_HAVE_LIBAIO
                          { .ival = "libaio",
                            .help = "Linux native asynchronous IO",
+                           .cb   = str_libaio_cb,
                          },
 #endif
 #ifdef FIO_HAVE_POSIXAIO