All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Android: add ioprio support
@ 2013-03-12  4:49 Aaron Carroll
  2013-03-12 12:15 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Carroll @ 2013-03-12  4:49 UTC (permalink / raw)
  To: fio

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]

Also fix a build warning due to unused variable in some configs.

[-- Attachment #2: Android-add-ioprio-support.patch --]
[-- Type: text/x-patch, Size: 1766 bytes --]

From af503d22666a97623b8f85e07d6fefd9c232f1ee Mon Sep 17 00:00:00 2001
From: Aaron Carroll <aaronc@cse.unsw.edu.au>
Date: Tue, 12 Mar 2013 15:46:10 +1100
Subject: [PATCH 2/2] Android: add ioprio support

Also fix build warning due to unused variable in some configs.
---
 engines/net.c   |    6 ++++++
 os/os-android.h |   22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/engines/net.c b/engines/net.c
index 624ff15..abb8412 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -490,6 +490,9 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 			return 1;
 		}
 	}
+#else
+	/* avoid warnings */
+	(void)optval;
 #endif
 
 	if (o->proto == FIO_TYPE_UDP)
@@ -553,6 +556,9 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 			return 1;
 		}
 	}
+#else
+	/* avoid warnings */
+	(void)optval;
 #endif
 
 	reset_all_stats(td);
diff --git a/os/os-android.h b/os/os-android.h
index cedfdaf..e8c64f3 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
@@ -74,6 +75,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
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-13  1:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-12  4:49 [PATCH] Android: add ioprio support Aaron Carroll
2013-03-12 12:15 ` Jens Axboe
2013-03-13  1:12   ` Aaron Carroll

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.