From: Jens Axboe Date: Wed, 2 Jan 2013 11:55:41 +0000 (+0100) Subject: libaio: use container_of() instead of silly casting X-Git-Tag: fio-2.0.13~9^2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0cc6ee59fd3caf08e934438241afa4982a15642c libaio: use container_of() instead of silly casting Signed-off-by: Jens Axboe Conflicts: engines/libaio.c Signed-off-by: Jens Axboe --- 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)