From f011531e61ae750cdf82074e0dea1379b07fa239 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 9 Mar 2010 21:47:15 +0100 Subject: [PATCH] Update libaio/posixaio/splice for sync updates Signed-off-by: Jens Axboe --- engines/libaio.c | 12 ++---------- engines/posixaio.c | 4 +--- engines/splice.c | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/engines/libaio.c b/engines/libaio.c index bd8ebb8b..ff5709b4 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -97,19 +97,11 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u) * support aio fsync yet. So return busy for the case where we * have pending io, to let fio complete those first. */ - if (io_u->ddir == DDIR_SYNC) { + if (ddir_sync(io_u->ddir)) { if (ld->iocbs_nr) return FIO_Q_BUSY; - if (fsync(io_u->file->fd) < 0) - io_u->error = errno; - - return FIO_Q_COMPLETED; - } else if (io_u->ddir == DDIR_DATASYNC) { - if (ld->iocbs_nr) - return FIO_Q_BUSY; - if (fdatasync(io_u->file->fd) < 0) - io_u->error = errno; + do_io_u_sync(td, io_u); return FIO_Q_COMPLETED; } diff --git a/engines/posixaio.c b/engines/posixaio.c index 3ffdcb6b..70282f29 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -175,9 +175,7 @@ static int fio_posixaio_queue(struct thread_data fio_unused *td, if (pd->queued) return FIO_Q_BUSY; - if (fsync(io_u->file->fd) < 0) - io_u->error = errno; - + do_io_u_sync(td, io_u); return FIO_Q_COMPLETED; #endif } diff --git a/engines/splice.c b/engines/splice.c index ca43e434..e9b6aadd 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -224,7 +224,7 @@ static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u) } else if (io_u->ddir == DDIR_WRITE) ret = fio_splice_write(td, io_u); else - ret = fsync(io_u->file->fd); + ret = do_io_u_sync(td, io_u); if (ret != (int) io_u->xfer_buflen) { if (ret >= 0) { -- 2.25.1