Fix read_iolog
authorJens Axboe <jens.axboe@oracle.com>
Wed, 25 Apr 2007 12:11:18 +0000 (14:11 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 25 Apr 2007 12:11:18 +0000 (14:11 +0200)
Caveat - it only works with 1 file, unfortunately. Will need a format
change to get that right.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.h
io_u.c
log.c

diff --git a/fio.h b/fio.h
index f9f2a577836554c52ac7b9e816acea6aef1384b2..060a1ee5ba325e4b528204041688328ea9264d1d 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -404,7 +404,6 @@ struct thread_options {
        unsigned int numjobs;
        os_cpu_mask_t cpumask;
        unsigned int iolog;
-       unsigned int read_iolog;
        unsigned int rwmixcycle;
        unsigned int rwmix[2];
        unsigned int nice;
diff --git a/io_u.c b/io_u.c
index d5dd84b96ddf9b00fa89134551fc323bce923eb3..99f07288376f5cd7f668f169cdfb24f130091299 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -289,7 +289,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
        /*
         * If using an iolog, grab next piece if any available.
         */
-       if (td->o.read_iolog)
+       if (td->o.read_iolog_file)
                return read_iolog_get(td, io_u);
 
        /*
diff --git a/log.c b/log.c
index 45be5fb6fdb94f718d3603bd769226f50abf7802..de3b759ce8ca268a007793c1b3ac9352e1bd8f3e 100644 (file)
--- a/log.c
+++ b/log.c
@@ -19,6 +19,11 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                io_u->buflen = ipo->len;
                io_u->ddir = ipo->ddir;
                io_u->file = ipo->file;
+               /*
+                * work around, this needs a format change to work for > 1 file
+                */
+               if (!io_u->file)
+                       io_u->file = &td->files[0];
                free(ipo);
                return 0;
        }