From e51cf72c29e92619534ed84a59047e62eaa05a5a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 30 May 2008 22:03:46 +0200 Subject: [PATCH] vsync: Fix issue with double issue of io_u We'd lseek to the same location twice, making sequential IO lseek() and read/write to each location twice. Signed-off-by: Jens Axboe --- engines/sync.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/sync.c b/engines/sync.c index 561e77ba..3b96ee1d 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -18,6 +18,7 @@ struct syncio_data { struct iovec *iovecs; struct io_u **io_us; unsigned int queued; + unsigned int events; unsigned long queued_bytes; unsigned long long last_offset; @@ -99,8 +100,8 @@ static int fio_vsyncio_getevents(struct thread_data *td, unsigned int min, int ret; if (min) { - ret = sd->queued; - sd->queued = 0; + ret = sd->events; + sd->events = 0; } else ret = 0; @@ -247,6 +248,8 @@ static int fio_vsyncio_commit(struct thread_data *td) ret = writev(f->fd, sd->iovecs, sd->queued); dprint(FD_IO, "vsyncio_commit: %d\n", (int) ret); + sd->events = sd->queued; + sd->queued = 0; return fio_vsyncio_end(td, ret); } -- 2.25.1