[PATCH] First cut at supporting > 1 file per job
[fio.git] / log.c
diff --git a/log.c b/log.c
index a364e220919eb3ee23185fb128a9de80908884cf..00e3913bd8a8b212f92233ceb3ff501201266a26 100644 (file)
--- a/log.c
+++ b/log.c
@@ -18,6 +18,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                io_u->offset = ipo->offset;
                io_u->buflen = ipo->len;
                io_u->ddir = ipo->ddir;
+               io_u->file = ipo->file;
                free(ipo);
                return 0;
        }
@@ -46,6 +47,7 @@ void log_io_piece(struct thread_data *td, struct io_u *io_u)
        struct list_head *entry;
 
        INIT_LIST_HEAD(&ipo->list);
+       ipo->file = io_u->file;
        ipo->offset = io_u->offset;
        ipo->len = io_u->buflen;
 
@@ -122,7 +124,7 @@ int init_iolog(struct thread_data *td)
                struct io_piece *ipo;
 
                if (sscanf(p, "%d,%llu,%u", &rw, &offset, &bytes) != 3) {
-                       fprintf(f_err, "bad iolog: %s\n", p);
+                       log_err("bad iolog: %s\n", p);
                        continue;
                }
                if (rw == DDIR_READ)
@@ -130,7 +132,7 @@ int init_iolog(struct thread_data *td)
                else if (rw == DDIR_WRITE)
                        writes++;
                else {
-                       fprintf(f_err, "bad ddir: %d\n", rw);
+                       log_err("bad ddir: %d\n", rw);
                        continue;
                }
 
@@ -169,7 +171,7 @@ int setup_rate(struct thread_data *td)
                return 0;
 
        if (td->rate < td->ratemin) {
-               fprintf(f_err, "min rate larger than nominal rate\n");
+               log_err("min rate larger than nominal rate\n");
                return -1;
        }