From: Jens Axboe Date: Wed, 21 Sep 2011 07:38:01 +0000 (+0200) Subject: Fix aiocb compile warnings on HPUX X-Git-Tag: fio-1.59~4 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e97c14423a5688d7adfb342c16363c263cb741f9;ds=sidebyside Fix aiocb compile warnings on HPUX Unlike other platforms, it seems to require aiocb64 explicitly for long offsets. Add an os independent typedef for this. Signed-off-by: Jens Axboe --- diff --git a/engines/posixaio.c b/engines/posixaio.c index e315e972..0966e0d5 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -65,7 +65,7 @@ static int fio_posixaio_cancel(struct thread_data fio_unused *td, static int fio_posixaio_prep(struct thread_data fio_unused *td, struct io_u *io_u) { - struct aiocb *aiocb = &io_u->aiocb; + os_aiocb_t *aiocb = &io_u->aiocb; struct fio_file *f = io_u->file; aiocb->aio_fildes = f->fd; @@ -84,7 +84,7 @@ static int fio_posixaio_getevents(struct thread_data *td, unsigned int min, unsigned int max, struct timespec *t) { struct posixaio_data *pd = td->io_ops->data; - struct aiocb *suspend_list[SUSPEND_ENTRIES]; + os_aiocb_t *suspend_list[SUSPEND_ENTRIES]; struct flist_head *entry; struct timespec start; int have_timeout = 0; @@ -141,7 +141,7 @@ restart: /* * must have some in-flight, wait for at least one */ - aio_suspend((const struct aiocb * const *)suspend_list, + aio_suspend((const os_aiocb_t * const *)suspend_list, suspend_entries, t); goto restart; } @@ -157,7 +157,7 @@ static int fio_posixaio_queue(struct thread_data *td, struct io_u *io_u) { struct posixaio_data *pd = td->io_ops->data; - struct aiocb *aiocb = &io_u->aiocb; + os_aiocb_t *aiocb = &io_u->aiocb; int ret; fio_ro_check(td, io_u); diff --git a/ioengine.h b/ioengine.h index 75c2c1ad..044c4da1 100644 --- a/ioengine.h +++ b/ioengine.h @@ -22,7 +22,7 @@ struct io_u { struct iocb iocb; #endif #ifdef FIO_HAVE_POSIXAIO - struct aiocb aiocb; + os_aiocb_t aiocb; #endif #ifdef FIO_HAVE_SGIO struct sg_io_hdr hdr; diff --git a/os/os-hpux.h b/os/os-hpux.h index d7397bff..4353a019 100644 --- a/os/os-hpux.h +++ b/os/os-hpux.h @@ -43,6 +43,9 @@ #define MSG_WAITALL 0x40 #endif +#define FIO_OS_HAVE_AIOCB_TYPEDEF +typedef struct aiocb64 os_aiocb_t; + static inline int blockdev_invalidate_cache(struct fio_file *f) { return EINVAL; diff --git a/os/os.h b/os/os.h index cd2bb523..2eb38e87 100644 --- a/os/os.h +++ b/os/os.h @@ -32,6 +32,9 @@ #ifdef FIO_HAVE_POSIXAIO #include +#ifndef FIO_OS_HAVE_AIOCB_TYPEDEF +typedef struct aiocb os_aiocb_t; +#endif #endif #ifdef FIO_HAVE_SGIO