X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fsync.c;h=5194f0f8799d68bf659a03d7969e3ed3bfc44769;hb=aa5e69b26d16ae4c1680d05b25149f3198036714;hp=12b85f6a65917c8e2fc197bd35c844bd61684b28;hpb=e449797e5071605a1fcd9094e40cecca4a647619;p=fio.git diff --git a/engines/sync.c b/engines/sync.c index 12b85f6a..5194f0f8 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -76,7 +76,7 @@ static int fio_psyncio_queue(struct thread_data *td, struct io_u *io_u) 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); } @@ -93,7 +93,7 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u) 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); } @@ -163,22 +163,12 @@ static int fio_vsyncio_queue(struct thread_data *td, struct io_u *io_u) */ 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);