summaryrefslogtreecommitdiff
path: root/include/linux/ioprio.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-10-04 17:49:01 +0200
committerIngo Molnar <mingo@kernel.org>2017-10-10 11:45:39 +0200
commit36436440cd19f59f5be12a1b181d299af2725140 (patch)
tree198664cef7595febf4114aadc2c822db4d434e9b /include/linux/ioprio.h
parentff0d4a9dc16b1f4c954f6407c233ab848bdfe8b0 (diff)
downloadlwn-36436440cd19f59f5be12a1b181d299af2725140.tar.gz
lwn-36436440cd19f59f5be12a1b181d299af2725140.zip
block/ioprio: Use a helper to check for RT prio
A side-effect to the old code is that now SCHED_DEADLINE is also recognized. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Jens Axboe <axboe@fb.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20171004154901.26904-2-bigeasy@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/ioprio.h')
-rw-r--r--include/linux/ioprio.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 8c1239020d79..2f19aab84a4a 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -2,6 +2,7 @@
#define IOPRIO_H
#include <linux/sched.h>
+#include <linux/sched/rt.h>
#include <linux/iocontext.h>
/*
@@ -62,7 +63,7 @@ static inline int task_nice_ioclass(struct task_struct *task)
{
if (task->policy == SCHED_IDLE)
return IOPRIO_CLASS_IDLE;
- else if (task->policy == SCHED_FIFO || task->policy == SCHED_RR)
+ else if (task_is_realtime(task))
return IOPRIO_CLASS_RT;
else
return IOPRIO_CLASS_BE;