Fix aiocb compile warnings on HPUX
authorJens Axboe <axboe@kernel.dk>
Wed, 21 Sep 2011 07:38:01 +0000 (09:38 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Sep 2011 07:38:01 +0000 (09:38 +0200)
Unlike other platforms, it seems to require aiocb64 explicitly
for long offsets. Add an os independent typedef for this.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/posixaio.c
ioengine.h
os/os-hpux.h
os/os.h

index e315e972b73df4d085f220fb54ed4bc276083de9..0966e0d5e7fa66b261c20bb1948177e108ab4455 100644 (file)
@@ -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);
index 75c2c1ad222687f928e9c46fc5103d5c859035be..044c4da1a150af8ce239cd0bc57ca14a75ef0c6a 100644 (file)
@@ -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;
index d7397bff0db6a4e6e5e29982d4e32fbcd97ef1aa..4353a0199aa64c5c857613d9bc4b1c7331e7f45f 100644 (file)
@@ -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 cd2bb523bb9ef931f27ea123c3e239bcdc035518..2eb38e87afda20dae2b52ebd65d1dfc146247e23 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -32,6 +32,9 @@
 
 #ifdef FIO_HAVE_POSIXAIO
 #include <aio.h>
+#ifndef FIO_OS_HAVE_AIOCB_TYPEDEF
+typedef struct aiocb os_aiocb_t;
+#endif
 #endif
 
 #ifdef FIO_HAVE_SGIO