X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fsync.c;h=4ca04d5e9cbfad9c52f7c322920fc6dedde345c2;hb=2992b059b8f54ac91e723a8bde629b4d8fed513e;hp=561e77ba02539e7ca88e5a70ea141a01c0a66529;hpb=5921e80c5dfc9f96d2f21da6ae58f2b5d3a0b373;p=fio.git diff --git a/engines/sync.c b/engines/sync.c index 561e77ba..4ca04d5e 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); } @@ -271,7 +274,6 @@ static void fio_vsyncio_cleanup(struct thread_data *td) free(sd->iovecs); free(sd->io_us); free(sd); - td->io_ops->data = NULL; } static struct ioengine_ops ioengine_rw = {