From 5dc9371ce6ab327b627b29771e7bb3d26f363e9e Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 17 Jan 2009 02:38:32 +0100 Subject: [PATCH] ionice: Allow setting the none class Allow users to set the "none" class on processes. Using the none class has the distict advantage that the io priority is inherited from the cpu nice level. Update the man page to reflect the change. Signed-off-by: Jakob Unterwurzacher Signed-off-by: Karel Zak --- schedutils/ionice.1 | 3 ++- schedutils/ionice.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/schedutils/ionice.1 b/schedutils/ionice.1 index 92712eef..0f75dfdf 100644 --- a/schedutils/ionice.1 +++ b/schedutils/ionice.1 @@ -43,7 +43,8 @@ permitted for an ordinary (i.e., non-root) user. .SH OPTIONS .IP "\fB-c \fIclass\fP" -The scheduling class. \fI1\fR for real time, \fI2\fR for best-effort, \fI3\fR for idle. +The scheduling class. \fI0\fR for none, \fI1\fR for real time, \fI2\fR for +best-effort, \fI3\fR for idle. .IP "\fB-n \fIclassdata\fP" The scheduling class data. This defines the class data, if the class accepts an argument. For real time and best-effort, \fI0-7\fR is valid diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 5f1f3489..082b23ba 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -85,7 +85,7 @@ static void usage(int rc) "\nOptions:\n" " -n class data (0-7, lower being higher prio)\n" " -c scheduling class\n" - " 1: realtime, 2: best-effort, 3: idle\n" + " 0: none, 1: realtime, 2: best-effort, 3: idle\n" " -t ignore failures\n" " -h this help\n\n")); exit(rc); @@ -147,7 +147,9 @@ int main(int argc, char *argv[]) switch (ioclass) { case IOPRIO_CLASS_NONE: - ioclass = IOPRIO_CLASS_BE; + if (set & 1) + warnx(_("ignoring given class data for none class")); + ioprio = 0; break; case IOPRIO_CLASS_RT: case IOPRIO_CLASS_BE: -- 2.39.5