X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos-android.h;h=df22333f44d11cdf8dbcc4a79dcd2e85330a7443;hb=2db1e181e73f16687e68e28dc75dd8cc8ccab08c;hp=e436f8fbdd050061383dd9a0d592240d289fc8c0;hpb=0dcebdf4a70ef0d8144b8fcba763ae87e7fc74b5;p=fio.git diff --git a/os/os-android.h b/os/os-android.h index e436f8fb..df22333f 100644 --- a/os/os-android.h +++ b/os/os-android.h @@ -13,12 +13,14 @@ #include #include #include +#include #include "binject.h" #include "../file.h" #define FIO_HAVE_DISK_UTIL #define FIO_HAVE_IOSCHED_SWITCH +#define FIO_HAVE_IOPRIO #define FIO_HAVE_ODIRECT #define FIO_HAVE_HUGETLB #define FIO_HAVE_BLKTRACE @@ -30,6 +32,8 @@ #define FIO_USE_GENERIC_INIT_RANDOM_STATE #define FIO_HAVE_E4_ENG #define FIO_HAVE_BYTEORDER_FUNCS +#define FIO_HAVE_MMAP_HUGE +#define FIO_NO_HAVE_SHM_H #define OS_MAP_ANON MAP_ANONYMOUS @@ -40,6 +44,9 @@ #ifdef MADV_REMOVE #define FIO_MADV_FREE MADV_REMOVE #endif +#ifndef MAP_HUGETLB +#define MAP_HUGETLB 0x40000 /* arch specific */ +#endif /* @@ -73,6 +80,34 @@ static inline int shmdt (const void *__shmaddr) #define SPLICE_DEF_SIZE (64*1024) +enum { + IOPRIO_CLASS_NONE, + IOPRIO_CLASS_RT, + IOPRIO_CLASS_BE, + IOPRIO_CLASS_IDLE, +}; + +enum { + IOPRIO_WHO_PROCESS = 1, + IOPRIO_WHO_PGRP, + IOPRIO_WHO_USER, +}; + +#define IOPRIO_BITS 16 +#define IOPRIO_CLASS_SHIFT 13 + +static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio) +{ + /* + * If no class is set, assume BE + */ + if (!ioprio_class) + ioprio_class = IOPRIO_CLASS_BE; + + ioprio |= ioprio_class << IOPRIO_CLASS_SHIFT; + return syscall(__NR_ioprio_set, which, who, ioprio); +} + #ifndef BLKGETSIZE64 #define BLKGETSIZE64 _IOR(0x12,114,size_t) #endif