X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=io_u.c;h=8035f4b725fc13b64be0c11aa5b45853e19a7982;hb=HEAD;hp=09e5f15a8b1ffe785adcd546da1e8232c9f47399;hpb=2b03792ceb7ed00bd50db5b59486fab902295df8;p=fio.git diff --git a/io_u.c b/io_u.c index 09e5f15a..a090e121 100644 --- a/io_u.c +++ b/io_u.c @@ -360,6 +360,17 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f, loop_cache_invalidate(td, f); } + /* + * If we reach the end for a rw-io-size based run, reset us back to 0 + * and invalidate the cache, if we need to. + */ + if (td_rw(td) && o->io_size > o->size) { + if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f)) { + f->last_pos[ddir] = f->file_offset; + loop_cache_invalidate(td, f); + } + } + if (f->last_pos[ddir] < f->real_file_size) { uint64_t pos; @@ -1054,8 +1065,8 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u) } } - if (td->o.fdp) - fdp_fill_dspec_data(td, io_u); + if (td->o.dp_type != FIO_DP_NONE) + dp_fill_dspec_data(td, io_u); if (io_u->offset + io_u->buflen > io_u->file->real_file_size) { dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%llx exceeds file size=0x%llx\n", @@ -2102,7 +2113,6 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr, if (ddir_sync(ddir)) { if (io_u->error) goto error; - td->last_was_sync = true; if (f) { f->first_write = -1ULL; f->last_write = -1ULL; @@ -2112,7 +2122,6 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr, return; } - td->last_was_sync = false; td->last_ddir = ddir; if (!io_u->error && ddir_rw(ddir)) {