Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
authorJens Axboe <jaxboe@fusionio.com>
Tue, 19 Jul 2011 14:28:33 +0000 (16:28 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 19 Jul 2011 14:28:33 +0000 (16:28 +0200)
parse.c

diff --git a/parse.c b/parse.c
index ef23fbe..ad2782f 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -498,10 +498,17 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 
                break;
        }
-       case FIO_OPT_BOOL: {
+       case FIO_OPT_BOOL:
+       case FIO_OPT_STR_SET: {
                fio_opt_int_fn *fn = o->cb;
 
-               ret = check_int(ptr, &il);
+               if (ptr)
+                       ret = check_int(ptr, &il);
+               else if (o->type == FIO_OPT_BOOL)
+                       ret = 1;
+               else
+                       il = 1;
+
                if (ret)
                        break;
 
@@ -537,27 +544,6 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                }
                break;
        }
-       case FIO_OPT_STR_SET: {
-               fio_opt_str_set_fn *fn = o->cb;
-
-               if (fn)
-                       ret = fn(data);
-               else {
-                       if (first) {
-                               if (o->roff1)
-                                       *(unsigned int *) o->roff1 = 1;
-                               else
-                                       val_store(ilp, 1, o->off1, 0, data);
-                       }
-                       if (!more) {
-                               if (o->roff2)
-                                       *(unsigned int *) o->roff2 = 1;
-                               else if (o->off2)
-                                       val_store(ilp, 1, o->off2, 0, data);
-                       }
-               }
-               break;
-       }
        case FIO_OPT_DEPRECATED:
                fprintf(stdout, "Option %s is deprecated\n", o->name);
                break;