X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=81ee724b7357a36651d4d6001bcf31c23b3853e9;hp=4246edff0b2ffe19242dace14d4271ba851c7856;hb=8bd809f5a3d19e24080a993f204613106cacf176;hpb=0bcf41cdc22dfee6b3f3b2ba9a533b4b103c70c2 diff --git a/io_u.c b/io_u.c index 4246edff..81ee724b 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] = f->file_offset; loop_cache_invalidate(td, f); }