Add version 2 of the iolog format
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index e0614bd0a11946f132a6b0063e0015ff6e6ad48b..309969a6c2164d8e274fd2b31eac5ade246166d4 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -327,6 +327,15 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
 
        io_u->ddir = get_rw_ddir(td);
 
+       /*
+        * See if it's time to switch to a new zone
+        */
+       if (td->zone_bytes >= td->o.zone_size) {
+               td->zone_bytes = 0;
+               io_u->file->last_pos += td->o.zone_skip;
+               td->io_skip_bytes += td->o.zone_skip;
+       }
+
        /*
         * No log, let the seq/rand engine retrieve the next buflen and
         * position.
@@ -348,9 +357,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
         * If using a write iolog, store this entry.
         */
 out:
-       if (td->o.write_iolog_file)
-               write_iolog_put(td, io_u);
-
+       log_io_u(td, io_u);
        return 0;
 }
 
@@ -660,11 +667,6 @@ set_file:
 
        assert(io_u->file->flags & FIO_FILE_OPEN);
 
-       if (td->zone_bytes >= td->o.zone_size) {
-               td->zone_bytes = 0;
-               f->last_pos += td->o.zone_skip;
-       }
-
        if (io_u->ddir != DDIR_SYNC) {
                if (!io_u->buflen) {
                        put_io_u(td, io_u);