X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffio-engine-posixaio.c;h=2d0fd3114b6469729997721643f8d66e3826451f;hp=260551a4ee8b506f9c1fa84cc30711bddf168255;hb=87dc1ab1b4df7b977f60e3d43533a896e2ee665b;hpb=dfd7bc2c24d3a4281982eaf4f83aa1aeb09424de;ds=sidebyside diff --git a/engines/fio-engine-posixaio.c b/engines/fio-engine-posixaio.c index 260551a4..2d0fd311 100644 --- a/engines/fio-engine-posixaio.c +++ b/engines/fio-engine-posixaio.c @@ -45,12 +45,6 @@ static unsigned long long ts_utime_since_now(struct timespec *t) return sec + nsec; } -static int fio_posixaio_sync(struct thread_data fio_unused *td, - struct fio_file *f) -{ - return fsync(f->fd); -} - static int fio_posixaio_cancel(struct thread_data fio_unused *td, struct io_u *io_u) { @@ -149,8 +143,10 @@ static int fio_posixaio_queue(struct thread_data fio_unused *td, if (io_u->ddir == DDIR_READ) ret = aio_read(aiocb); - else + else if (io_u->ddir == DDIR_WRITE) ret = aio_write(aiocb); + else + ret = aio_fsync(O_SYNC, aiocb); if (ret) io_u->error = errno; @@ -189,5 +185,4 @@ struct ioengine_ops ioengine = { .getevents = fio_posixaio_getevents, .event = fio_posixaio_event, .cleanup = fio_posixaio_cleanup, - .sync = fio_posixaio_sync, };