[PATCH] Fixup iolog config setting
authorJens Axboe <jens.axboe@oracle.com>
Fri, 27 Oct 2006 09:10:18 +0000 (11:10 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 27 Oct 2006 09:10:18 +0000 (11:10 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c

diff --git a/init.c b/init.c
index 2dbf805d5abea0ee793389a5098d1edda296fd50..4ce2cc4bf973dfd728e70f3c5c34159063255ff9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -103,7 +103,7 @@ static struct fio_option options[] = {
        },
        {
                .name   = "write_iolog",
-               .type   = FIO_OPT_STR_STORE,
+               .type   = FIO_OPT_INT,
                .off1   = td_var_offset(write_iolog),
        },
        {
@@ -391,6 +391,10 @@ static void put_job(struct thread_data *td)
        thread_number--;
 }
 
+/*
+ * Lazy way of fixing up options that depend on each other. We could also
+ * define option callback handlers, but this is easier.
+ */
 static void fixup_options(struct thread_data *td)
 {
        if (!td->min_bs)
@@ -400,6 +404,9 @@ static void fixup_options(struct thread_data *td)
 
        if (!td->rwmixread && td->rwmixwrite)
                td->rwmixread = 100 - td->rwmixwrite;
+
+       if (td->iolog && !td->write_iolog)
+               td->read_iolog = 1;
 }
 
 /*