#include "../fio.h"
+/*
+ * Sync engine uses engine_data to store last offset
+ */
+#define LAST_POS(f) ((f)->engine_data)
+
struct syncio_data {
struct iovec *iovecs;
struct io_u **io_us;
if (!ddir_rw(io_u->ddir))
return 0;
- if (f->file_pos != -1ULL && f->file_pos == io_u->offset)
+ if (LAST_POS(f) != -1ULL && LAST_POS(f) == io_u->offset)
return 0;
if (lseek(f->fd, io_u->offset, SEEK_SET) == -1) {
static int fio_io_end(struct thread_data *td, struct io_u *io_u, int ret)
{
if (io_u->file && ret >= 0 && ddir_rw(io_u->ddir))
- io_u->file->file_pos = io_u->offset + ret;
+ LAST_POS(io_u->file) = io_u->offset + ret;
if (ret != (int) io_u->xfer_buflen) {
if (ret >= 0) {