pre_read fixes
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 8c2f33b5e85e1e16bb3d6aea7564cbd5181a5e62..1e9018c4f6ee85bc5362aea312b9b2ec15a15978 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -686,6 +686,7 @@ static struct fio_file *get_next_file_rr(struct thread_data *td, int goodf,
                        if (err) {
                                dprint(FD_FILE, "error %d on open of %s\n",
                                        err, f->file_name);
+                               f = NULL;
                                continue;
                        }
                        opened = 1;
@@ -917,11 +918,11 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                                                        &icd->time);
 
                        if (!td->o.disable_clat) {
-                               add_clat_sample(td, idx, usec);
+                               add_clat_sample(td, idx, usec, bytes);
                                io_u_mark_latency(td, usec);
                        }
                        if (!td->o.disable_bw)
-                               add_bw_sample(td, idx, &icd->time);
+                               add_bw_sample(td, idx, bytes, &icd->time);
                }
 
                if (td_write(td) && idx == DDIR_WRITE &&
@@ -1026,7 +1027,7 @@ void io_u_queued(struct thread_data *td, struct io_u *io_u)
                unsigned long slat_time;
 
                slat_time = utime_since(&io_u->start_time, &io_u->issue_time);
-               add_slat_sample(td, io_u->ddir, slat_time);
+               add_slat_sample(td, io_u->ddir, io_u->xfer_buflen, slat_time);
        }
 }