[PATCH] Update irange documentation
authorJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jan 2007 14:59:26 +0000 (15:59 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jan 2007 14:59:26 +0000 (15:59 +0100)
Also allow ':' as the range delimeter, and '/' as the
direction delimeter.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
HOWTO
parse.c

diff --git a/HOWTO b/HOWTO
index f36fc46e0b08d2aeed793519eae952b738b507f1..4370c9f3607ff7fdc1b72f380dcc9eb3bf3662a3 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -179,7 +179,10 @@ siint      SI integer. A whole number value, which may contain a postfix
 bool   Boolean. Usually parsed as an integer, however only defined for
        true and false (1 and 0).
 irange Integer range with postfix. Allows value range to be given, such
-       as 1024-4096. Also see siint.
+       as 1024-4096. A colon may also be used as the seperator, eg
+       1k:4k. If the option allows two sets of ranges, they can be
+       specified with a ',' or '/' delimiter: 1k-4k/8k-32k. Also see
+       siint.
 
 With the above in mind, here follows the complete list of fio job
 parameters.
diff --git a/parse.c b/parse.c
index 03856dc298f163e6f91e28f8b148b84e3130eced..29e2ff1ce9d347a8017f1685711264bcdd6900e0 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -218,8 +218,11 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
 
                p1 = strchr(tmp, '-');
                if (!p1) {
-                       ret = 1;
-                       break;
+                       p1 = strchr(tmp, ':');
+                       if (!p1) {
+                               ret = 1;
+                               break;
+                       }
                }
 
                p2 = p1 + 1;
@@ -309,8 +312,11 @@ static int handle_option(struct fio_option *o, const char *ptr, void *data)
         * Do this before parsing the first round, to check if we should
         * copy set 1 options to set 2.
         */
-       if (ptr)
+       if (ptr) {
                ptr2 = strchr(ptr, ',');
+               if (!ptr2)
+                       ptr2 = strchr(ptr, ':');
+       }
 
        /*
         * Don't return early if parsing the first option fails - if