From 0cc6ee59fd3caf08e934438241afa4982a15642c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 2 Jan 2013 12:55:41 +0100 Subject: [PATCH] libaio: use container_of() instead of silly casting Signed-off-by: Jens Axboe Conflicts: engines/libaio.c Signed-off-by: Jens Axboe --- engines/libaio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engines/libaio.c b/engines/libaio.c index bc459da1..f17260d3 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -14,8 +14,6 @@ #ifdef FIO_HAVE_LIBAIO -#define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj) - struct libaio_data { io_context_t aio_ctx; struct io_event *aio_events; @@ -62,7 +60,7 @@ static struct io_u *fio_libaio_event(struct thread_data *td, int event) struct io_u *io_u; ev = ld->aio_events + event; - io_u = ev_to_iou(ev); + io_u = container_of(ev->obj, struct io_u, iocb); if (ev->res != io_u->xfer_buflen) { if (ev->res > io_u->xfer_buflen) -- 2.25.1