Home | History | Annotate | Download | only in engines

Lines Matching refs:io_u

23 	struct io_u *io_u;
36 struct io_u **aio_events;
37 struct io_u **sort_events;
120 rbd->aio_events = calloc(td->o.iodepth, sizeof(struct io_u *));
124 rbd->sort_events = calloc(td->o.iodepth, sizeof(struct io_u *));
283 struct io_u *io_u = fri->io_u;
293 io_u->error = -ret;
294 io_u->resid = io_u->xfer_buflen;
296 io_u->error = 0;
301 static struct io_u *fio_rbd_event(struct thread_data *td, int event)
308 static inline int fri_check_complete(struct rbd_data *rbd, struct io_u *io_u,
311 struct fio_rbd_iou *fri = io_u->engine_data;
315 rbd->aio_events[*events] = io_u;
325 static inline int rbd_io_u_seen(struct io_u *io_u)
327 struct fio_rbd_iou *fri = io_u->engine_data;
332 static void rbd_io_u_wait_complete(struct io_u *io_u)
334 struct fio_rbd_iou *fri = io_u->engine_data;
341 const struct io_u **a = (const struct io_u **) p1;
342 const struct io_u **b = (const struct io_u **) p2;
361 struct io_u *io_u;
384 io_u = fri->io_u;
386 io_u_qiter(&td->io_u_all, io_u, i) {
388 if (!(io_u->flags & IO_U_F_FLIGHT))
390 if (rbd_io_u_seen(io_u))
393 if (fri_check_complete(rbd, io_u, events))
396 rbd->sort_events[sidx++] = io_u;
408 qsort(rbd->sort_events, sidx, sizeof(struct io_u *), rbd_io_u_cmp);
411 io_u = rbd->sort_events[i];
413 if (fri_check_complete(rbd, io_u, events)) {
425 rbd_io_u_wait_complete(io_u);
427 if (fri_check_complete(rbd, io_u, events))
458 static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
461 struct fio_rbd_iou *fri = io_u->engine_data;
464 fio_ro_check(td, io_u);
476 if (io_u->ddir == DDIR_WRITE) {
479 r = rbd_aio_write_traced(rbd->image, io_u->offset, io_u->xfer_buflen,
480 io_u->xfer_buf, fri->completion, &fri->info);
482 r = rbd_aio_write(rbd->image, io_u->offset, io_u->xfer_buflen,
483 io_u->xfer_buf, fri->completion);
490 } else if (io_u->ddir == DDIR_READ) {
493 r = rbd_aio_read_traced(rbd->image, io_u->offset, io_u->xfer_buflen,
494 io_u->xfer_buf, fri->completion, &fri->info);
496 r = rbd_aio_read(rbd->image, io_u->offset, io_u->xfer_buflen,
497 io_u->xfer_buf, fri->completion);
504 } else if (io_u->ddir == DDIR_TRIM) {
505 r = rbd_aio_discard(rbd->image, io_u->offset,
506 io_u->xfer_buflen, fri->completion);
511 } else if (io_u->ddir == DDIR_SYNC) {
519 io_u->ddir);
527 io_u->error = -r;
528 td_verror(td, io_u->error, "xfer");
644 static void fio_rbd_io_u_free(struct thread_data *td, struct io_u *io_u)
646 struct fio_rbd_iou *fri = io_u->engine_data;
649 io_u->engine_data = NULL;
654 static int fio_rbd_io_u_init(struct thread_data *td, struct io_u *io_u)
659 fri->io_u = io_u;
660 io_u->engine_data = fri;