Home | History | Annotate | Download | only in engines

Lines Matching defs:io_u

24 	struct io_u **io_us;
70 static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
72 struct fio_file *f = io_u->file;
74 if (io_u->ddir == DDIR_READ)
75 io_prep_pread(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
76 else if (io_u->ddir == DDIR_WRITE)
77 io_prep_pwrite(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
78 else if (ddir_sync(io_u->ddir))
79 io_prep_fsync(&io_u->iocb, f->fd);
84 static struct io_u *fio_libaio_event(struct thread_data *td, int event)
88 struct io_u *io_u;
91 io_u = container_of(ev->obj, struct io_u, iocb);
93 if (ev->res != io_u->xfer_buflen) {
94 if (ev->res > io_u->xfer_buflen)
95 io_u->error = -ev->res;
97 io_u->resid = io_u->xfer_buflen - ev->res;
99 io_u->error = 0;
101 return io_u;
182 static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
186 fio_ro_check(td, io_u);
197 if (ddir_sync(io_u->ddir)) {
201 do_io_u_sync(td, io_u);
205 if (io_u->ddir == DDIR_TRIM) {
209 do_io_u_trim(td, io_u);
213 ld->iocbs[ld->head] = &io_u->iocb;
214 ld->io_us[ld->head] = io_u;
220 static void fio_libaio_queued(struct thread_data *td, struct io_u **io_us,
232 struct io_u *io_u = io_us[i];
234 memcpy(&io_u->issue_time, &now, sizeof(now));
235 io_u_queued(td, io_u);
243 struct io_u **io_us;
309 static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)
313 return io_cancel(ld->aio_ctx, &io_u->iocb, ld->aio_events);
364 ld->io_us = calloc(ld->entries, sizeof(struct io_u *));