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;
io_u->buflen);
} else if ((td->flags & TD_F_SCRAMBLE_BUFFERS) &&
!(td->flags & TD_F_COMPRESS) &&
- !(td->flags & TD_F_DO_VERIFY))
+ !(td->flags & TD_F_DO_VERIFY)) {
do_scramble = 1;
+ }
} else if (io_u->ddir == DDIR_READ) {
/*
* Reset the buf_filled parameters so next time if the
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;
return;
}
- td->last_was_sync = false;
td->last_ddir = ddir;
if (!io_u->error && ddir_rw(ddir)) {