else if (io_u->ddir == DDIR_WRITE)
ret = pwrite(f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
else
- ret = fsync(f->fd);
+ ret = do_io_u_sync(td, io_u);
return fio_io_end(td, io_u, ret);
}
else if (io_u->ddir == DDIR_WRITE)
ret = write(f->fd, io_u->xfer_buf, io_u->xfer_buflen);
else
- ret = fsync(f->fd);
+ ret = do_io_u_sync(td, io_u);
return fio_io_end(td, io_u, ret);
}
*/
if (sd->queued)
return FIO_Q_BUSY;
- if (io_u->ddir == DDIR_SYNC) {
- int ret = fsync(io_u->file->fd);
+ if (ddir_sync(io_u->ddir)) {
+ int ret = do_io_u_sync(td, io_u);
return fio_io_end(td, io_u, ret);
- } else if (io_u->ddir == DDIR_DATASYNC) {
- int ret;
-#ifdef FIO_HAVE_FDATASYNC
- ret = fdatasync(io_u->file->fd);
-#else
- ret = io_u->xfer_buflen;
- io_u->error = EINVAL;
-#endif
- return fio_io_end(td, io_u, ret);
-
}
-
+
sd->queued = 0;
sd->queued_bytes = 0;
fio_vsyncio_set_iov(sd, io_u, 0);