Include syncs in the stored io log
authorJens Axboe <jens.axboe@oracle.com>
Tue, 27 Mar 2007 06:48:48 +0000 (08:48 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 27 Mar 2007 06:48:48 +0000 (08:48 +0200)
We want to replay those as well.

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

diff --git a/io_u.c b/io_u.c
index 1077c27b1f07a43014ea527de0f985037a0a2083..2e0f8e9c601a16f8320fef4780e0bd340a9a047e 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -310,7 +310,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
           !(td->io_issues[DDIR_WRITE] % td->o.fsync_blocks) &&
             td->io_issues[DDIR_WRITE] && should_fsync(td)) {
                io_u->ddir = DDIR_SYNC;
           !(td->io_issues[DDIR_WRITE] % td->o.fsync_blocks) &&
             td->io_issues[DDIR_WRITE] && should_fsync(td)) {
                io_u->ddir = DDIR_SYNC;
-               return 0;
+               goto out;
        }
 
        io_u->ddir = get_rw_ddir(td);
        }
 
        io_u->ddir = get_rw_ddir(td);
@@ -335,6 +335,7 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
        /*
         * If using a write iolog, store this entry.
         */
        /*
         * If using a write iolog, store this entry.
         */
+out:
        if (td->o.write_iolog_file)
                write_iolog_put(td, io_u);
 
        if (td->o.write_iolog_file)
                write_iolog_put(td, io_u);
 
diff --git a/log.c b/log.c
index 2b90f452e8c22bca740b235ebb26094a12892574..d59c38fd4e7cee46aa8f199b7f570e8c93b23501 100644 (file)
--- a/log.c
+++ b/log.c
@@ -113,7 +113,7 @@ static int init_iolog_read(struct thread_data *td)
                        reads++;
                else if (rw == DDIR_WRITE)
                        writes++;
                        reads++;
                else if (rw == DDIR_WRITE)
                        writes++;
-               else {
+               else if (rw != DDIR_SYNC) {
                        log_err("bad ddir: %d\n", rw);
                        continue;
                }
                        log_err("bad ddir: %d\n", rw);
                        continue;
                }