engines/libaio: fix new aio poll API
authorJens Axboe <axboe@kernel.dk>
Tue, 20 Nov 2018 02:41:53 +0000 (19:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Nov 2018 02:41:53 +0000 (19:41 -0700)
It'll be final. Some day.

Fixes: ebec344dd336 ("engines/libaio: update to new io_setup2() system call")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/arch-x86_64.h
engines/libaio.c

index 6361d52f6482ac0e3e2d32f9e754f8ac6d61448d..ac670d08db4c171f87b3cab2a11a1fce50ed1a2c 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef ARCH_X86_64_H
 #define ARCH_X86_64_H
 
 #ifndef ARCH_X86_64_H
 #define ARCH_X86_64_H
 
-#ifndef __NR_sys_iosetup2
-#define __NR_sys_iosetup2      335
+#ifndef __NR_sys_io_setup2
+#define __NR_sys_io_setup2     335
 #endif
 
 static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
 #endif
 
 static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
index da7f0c3ee7555bc4ef08bee90e405e0c4dd90acf..2a4d653467849e0d764c8a0c279e15264f13c690 100644 (file)
@@ -361,7 +361,7 @@ static int fio_libaio_queue_init(struct libaio_data *ld, unsigned int depth,
                                 bool hipri)
 {
 #ifdef __NR_sys_io_setup2
                                 bool hipri)
 {
 #ifdef __NR_sys_io_setup2
-       int err, flags = 0;
+       int flags = 0;
 
        if (hipri)
                flags = IOCTX_FLAG_IOPOLL;
 
        if (hipri)
                flags = IOCTX_FLAG_IOPOLL;
@@ -389,10 +389,7 @@ static int fio_libaio_init(struct thread_data *td)
         * care about the user ring. If that fails, the kernel is too old
         * and we need the right depth.
         */
         * care about the user ring. If that fails, the kernel is too old
         * and we need the right depth.
         */
-       if (!o->userspace_reap)
-               err = fio_libaio_queue_init(ld, INT_MAX, o->hipri);
-       if (o->userspace_reap || err == -EINVAL)
-               err = fio_libaio_queue_init(ld, td->o.iodepth, o->hipri);
+       err = fio_libaio_queue_init(ld, td->o.iodepth, o->hipri);
        if (err) {
                td_verror(td, -err, "io_queue_init");
                log_err("fio: check /proc/sys/fs/aio-max-nr\n");
        if (err) {
                td_verror(td, -err, "io_queue_init");
                log_err("fio: check /proc/sys/fs/aio-max-nr\n");