X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffio-engine-libaio.c;h=9197107cc65a8abfbfb1ab5b0e29ec4e4905f31f;hp=703808b66a8628a8116e145ada01b783fc186b72;hb=53cdc6864f7471b28cc9b40a5314ab43e5b1cb5e;hpb=aad39f4a045ea562c8e4b93db194d65d1e3570db;ds=sidebyside diff --git a/engines/fio-engine-libaio.c b/engines/fio-engine-libaio.c index 703808b6..9197107c 100644 --- a/engines/fio-engine-libaio.c +++ b/engines/fio-engine-libaio.c @@ -17,17 +17,19 @@ struct libaio_data { struct io_event *aio_events; }; -static int fio_libaio_sync(struct thread_data *td) +static int fio_libaio_sync(struct thread_data *td, struct fio_file *f) { - return fsync(td->fd); + return fsync(f->fd); } static int fio_libaio_prep(struct thread_data *td, struct io_u *io_u) { + struct fio_file *f = io_u->file; + if (io_u->ddir == DDIR_READ) - io_prep_pread(&io_u->iocb, td->fd, io_u->buf, io_u->buflen, io_u->offset); + io_prep_pread(&io_u->iocb, f->fd, io_u->buf, io_u->buflen, io_u->offset); else - io_prep_pwrite(&io_u->iocb, td->fd, io_u->buf, io_u->buflen, io_u->offset); + io_prep_pwrite(&io_u->iocb, f->fd, io_u->buf, io_u->buflen, io_u->offset); return 0; }