X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Fmmap.c;h=6671fc0e66d8e78e9f7c0fbeac8dd98a8b4d0946;hp=fde68f1d9b0b5b6a7e3e6f404a003a02f1b4bf45;hb=5f9099ea8adf423d0db01274ef0d7e65629c0e1c;hpb=77710811111850d125bee164dec80215b79e6c3d diff --git a/engines/mmap.c b/engines/mmap.c index fde68f1d..6671fc0e 100644 --- a/engines/mmap.c +++ b/engines/mmap.c @@ -113,7 +113,7 @@ static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u) memcpy(io_u->xfer_buf, io_u->mmap_data, io_u->xfer_buflen); else if (io_u->ddir == DDIR_WRITE) memcpy(io_u->mmap_data, io_u->xfer_buf, io_u->xfer_buflen); - else if (io_u->ddir == DDIR_SYNC) { + else if (ddir_sync(io_u->ddir)) { if (msync(f->mmap_ptr, f->mmap_sz, MS_SYNC)) { io_u->error = errno; td_verror(td, io_u->error, "msync"); @@ -123,7 +123,7 @@ static int fio_mmapio_queue(struct thread_data *td, struct io_u *io_u) /* * not really direct, but should drop the pages from the cache */ - if (td->o.odirect && io_u->ddir != DDIR_SYNC) { + if (td->o.odirect && !ddir_sync(io_u->ddir)) { if (msync(io_u->mmap_data, io_u->xfer_buflen, MS_SYNC) < 0) { io_u->error = errno; td_verror(td, io_u->error, "msync");