summaryrefslogtreecommitdiff
path: root/io_u.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-11-01 11:02:30 -0600
committerJens Axboe <axboe@kernel.dk>2017-11-01 11:02:30 -0600
commit17373ce2f38aa0d788d5c604cefd36a367bbbc27 (patch)
tree3c5ae9ad48b9dba2ea46896049e8907d94c49c2a /io_u.c
parent1633aa61a68593b4a4cc5dbb621129303a7c3049 (diff)
downloadfio-17373ce2f38aa0d788d5c604cefd36a367bbbc27.tar.gz
fio-17373ce2f38aa0d788d5c604cefd36a367bbbc27.tar.bz2
io_u: wrap to beginning when end-of-file is reached for time_based
The logic around using io_size isn't correct. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_u.c')
-rw-r--r--io_u.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/io_u.c b/io_u.c
index 4246edff..5e4209d3 100644
--- a/io_u.c
+++ b/io_u.c
@@ -361,16 +361,13 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f,
assert(ddir_rw(ddir));
+ /*
+ * If we reach the end for a time based run, reset us back to 0
+ * and invalidate the cache, if we need to.
+ */
if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f) &&
o->time_based) {
- struct thread_options *o = &td->o;
- uint64_t io_size = f->io_size + (f->io_size % o->min_bs[ddir]);
-
- if (io_size > f->last_pos[ddir])
- f->last_pos[ddir] = 0;
- else
- f->last_pos[ddir] = f->last_pos[ddir] - io_size;
-
+ f->last_pos[ddir] = 0;
loop_cache_invalidate(td, f);
}