Add ->done variable to force exit when we know we are done
[fio.git] / log.c
diff --git a/log.c b/log.c
index 92bcebfcca5248961b3bf1dfa74f3240199c5089..7a3327e5d29c2909700ba3413ae1bd903ce1f197 100644 (file)
--- a/log.c
+++ b/log.c
@@ -91,6 +91,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                return 0;
        }
 
+       td->done = 1;
        return 1;
 }
 
@@ -173,9 +174,10 @@ static int read_iolog2(struct thread_data *td, FILE *f)
 {
        unsigned long long offset;
        unsigned int bytes;
-       int rw, reads, writes, fileno = 0, file_action = 0; /* stupid gcc */
+       int reads, writes, fileno = 0, file_action = 0; /* stupid gcc */
        char *fname, *act;
        char *str, *p;
+       enum fio_ddir rw;
 
        free_release_files(td);
 
@@ -246,7 +248,7 @@ static int read_iolog2(struct thread_data *td, FILE *f)
                INIT_LIST_HEAD(&ipo->list);
                ipo->offset = offset;
                ipo->len = bytes;
-               ipo->ddir = (enum fio_ddir) rw;
+               ipo->ddir = rw;
                if (bytes > td->o.max_bs[rw])
                        td->o.max_bs[rw] = bytes;
                if (rw == DDIR_INVAL) {
@@ -280,7 +282,8 @@ static int read_iolog(struct thread_data *td, FILE *f)
        unsigned long long offset;
        unsigned int bytes;
        char *str, *p;
-       int rw, reads, writes;
+       int reads, writes;
+       enum fio_ddir rw;
 
        /*
         * Read in the read iolog and store it, reuse the infrastructure
@@ -309,7 +312,7 @@ static int read_iolog(struct thread_data *td, FILE *f)
                INIT_LIST_HEAD(&ipo->list);
                ipo->offset = offset;
                ipo->len = bytes;
-               ipo->ddir = (enum fio_ddir) rw;
+               ipo->ddir = rw;
                if (bytes > td->o.max_bs[rw])
                        td->o.max_bs[rw] = bytes;
                list_add_tail(&ipo->list, &td->io_log_list);