ret = ioctl(f->fd, EXT4_IOC_MOVE_EXT, &me);
len = me.moved_len * ed->bsz;
- if (io_u->file && len && ddir_rw(io_u->ddir))
- io_u->file->file_pos = io_u->offset + len;
-
if (len > io_u->xfer_buflen)
len = io_u->xfer_buflen;
if (ret)
io_u->error = errno;
- if (io_u->file && ret == 0 && ddir_rw(io_u->ddir))
- io_u->file->file_pos = io_u->offset + ret;
-
return FIO_Q_COMPLETED;
}
goto out;
} else {
io_u->error = 0;
- io_u->file->file_pos = io_u->offset + rc;
rc = FIO_Q_COMPLETED;
}
#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) {
struct flist_head hash_list;
enum fio_filetype filetype;
- void *file_data;
int fd;
int shadow_fd;
#ifdef WIN32
/*
* For use by the io engine
*/
- unsigned long long file_pos;
+ uint64_t engine_data;
/*
* if io is protected by a semaphore, this is set
{
f->last_pos = f->file_offset;
f->last_start = -1ULL;
- f->file_pos = -1ULL;
if (f->io_axmap)
axmap_reset(f->io_axmap);
}