Android: Add io_uring support
authorBart Van Assche <bvanassche@acm.org>
Thu, 21 Oct 2021 21:41:40 +0000 (14:41 -0700)
committerBart Van Assche <bvanassche@acm.org>
Thu, 21 Oct 2021 22:11:49 +0000 (15:11 -0700)
This patch has been tested on a recent Android phone. Compilation of this
patch has been verified as follows:

    NDK=/usr/lib/android-ndk
    export LIBS="-landroid"
    export UNAME=Android
    for ((i=23;i<=30;i++)); do
        echo "==== i = $i ===="
        export CC=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${i}-clang
        [ -e "$CC" ] || continue
        ./configure && make -j$(nproc) fio || break
    done

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Makefile
os/os-android.h

index f28c130a1669cbe680edc1ae6b2d176e3d6634be..4ae5a371fe268d5c7d8117a89025874d864291d8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -233,7 +233,7 @@ endif
 endif
 ifeq ($(CONFIG_TARGET_OS), Android)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
-               oslib/linux-dev-lookup.c
+               oslib/linux-dev-lookup.c engines/io_uring.c
 ifdef CONFIG_HAS_BLKZONED
   SOURCE += oslib/linux-blkzoned.c
 endif
index 18eb39ce052884b58dedc2f8f7a256281ab8aa95..10c51b8318f87a4edb68f1fc4264ca5ea3835667 100644 (file)
@@ -309,4 +309,8 @@ static inline int fio_set_sched_idle(void)
 }
 #endif
 
+#ifndef RWF_UNCACHED
+#define RWF_UNCACHED   0x00000040
+#endif
+
 #endif