aioring: hide it if archs don't define syscalls
authorJens Axboe <axboe@kernel.dk>
Thu, 13 Dec 2018 03:21:42 +0000 (20:21 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Dec 2018 03:21:42 +0000 (20:21 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/arch-x86_64.h
engines/aioring.c
options.c

index c69cbef6586386b8cfd92d9c6b305f899cc16d96..d49bcd7f34478f969f4975608624d14be6be8e94 100644 (file)
@@ -44,6 +44,7 @@ static inline unsigned long long get_cpu_clock(void)
 #define ARCH_HAVE_FFZ
 #define ARCH_HAVE_SSE4_2
 #define ARCH_HAVE_CPU_CLOCK
+#define ARCH_HAVE_AIORING
 
 #define RDRAND_LONG    ".byte 0x48,0x0f,0xc7,0xf0"
 #define RDSEED_LONG    ".byte 0x48,0x0f,0xc7,0xf8"
index c15f4a4ef9cbbac41c8c7b185e4b19b6a2c057a4..5a9add7937529b98a8924faf6d8c200edf438f73 100644 (file)
@@ -1,3 +1,4 @@
+#ifdef ARCH_HAVE_AIORING
 /*
  * aioring engine
  *
@@ -498,7 +499,7 @@ static int fio_aioring_init(struct thread_data *td)
        ld->sq_ring = fio_memalign(page_size, aioring_sq_size(td), false);
        memset(ld->sq_ring, 0, aioring_sq_size(td));
        ld->sq_ring->nr_events = td->o.iodepth;
-       ld->sq_ring->iocbs = (u64) ld->iocbs;
+       ld->sq_ring->iocbs = (u64) (uintptr_t) ld->iocbs;
 
        ld->cq_ring = fio_memalign(page_size, aioring_cq_size(td), false);
        memset(ld->cq_ring, 0, aioring_cq_size(td));
@@ -537,18 +538,11 @@ static struct ioengine_ops ioengine = {
 
 static void fio_init fio_aioring_register(void)
 {
-#ifdef __NR_sys_io_setup2
-#ifdef __NR_sys_io_ring_enter
        register_ioengine(&ioengine);
-#endif
-#endif
 }
 
 static void fio_exit fio_aioring_unregister(void)
 {
-#ifdef __NR_sys_io_setup2
-#ifdef __NR_sys_io_ring_enter
        unregister_ioengine(&ioengine);
-#endif
-#endif
 }
+#endif
index 81fe9ffb750ff421d97e9f8a67d597e79222a111..626c7c1715976c7e77c8e18327caf5d0a3639abb 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1774,10 +1774,12 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                          },
 #endif
 #ifdef CONFIG_LIBAIO
+#ifdef ARCH_HAVE_AIORING
                          { .ival = "aio-ring",
                            .help = "Linux native asynchronous IO",
                          },
 #endif
+#endif
 #ifdef CONFIG_POSIXAIO
                          { .ival = "posixaio",
                            .help = "POSIX asynchronous IO",