From 177380abbea4d8963513bd8ce1859bf3bc5a2f28 Mon Sep 17 00:00:00 2001 From: Aaron Carroll Date: Tue, 12 Mar 2013 15:46:10 +1100 Subject: [PATCH 1/1] Android: add ioprio support Signed-off-by: Jens Axboe --- os/os-android.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/os/os-android.h b/os/os-android.h index 3bb44b95..070aa1a3 100644 --- a/os/os-android.h +++ b/os/os-android.h @@ -19,6 +19,7 @@ #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 @@ -78,6 +79,27 @@ static inline int shmdt (const void *__shmaddr) #define SPLICE_DEF_SIZE (64*1024) +static inline int ioprio_set(int which, int who, int ioprio) +{ + return syscall(__NR_ioprio_set, which, who, ioprio); +} + +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 + #ifndef BLKGETSIZE64 #define BLKGETSIZE64 _IOR(0x12,114,size_t) #endif -- 2.25.1