`last_was_sync` has represented that the last command had DDIR_SYNC.
This can be replaced with `ddir_sync(last_ddir_issued)` and it's much
more flexible to represent the last issued command's data direction.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
size_t orig_buffer_size;
volatile int runstate;
volatile bool terminate;
- bool last_was_sync;
+
enum fio_ddir last_ddir_completed;
+ enum fio_ddir last_ddir_issued;
int mmapfd;
static inline bool should_fsync(struct thread_data *td)
{
- if (td->last_was_sync)
+ if (ddir_sync(td->last_ddir_issued))
return false;
if (td_write(td) || td->o.override_sync)
return true;
td->ts.total_io_u[io_u->ddir]++;
}
- td->last_was_sync = ddir_sync(io_u->ddir);
+ td->last_ddir_issued = ddir;
} else if (ret == FIO_Q_QUEUED) {
td->io_u_queued++;
if (td->io_u_queued >= td->o.iodepth_batch)
td_io_commit(td);
- td->last_was_sync = ddir_sync(io_u->ddir);
+ td->last_ddir_issued = ddir;
}
if (!td_ioengine_flagged(td, FIO_SYNCIO) &&
td->zone_bytes = 0;
- td->last_was_sync = false;
td->rwmix_issues = 0;
/*