block/ioprio: Use a helper to check for RT prio
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 4 Oct 2017 15:49:01 +0000 (17:49 +0200)
committerLukasz Luba <l.luba@partner.samsung.com>
Mon, 10 Sep 2018 08:18:02 +0000 (10:18 +0200)
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>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
include/linux/ioprio.h

index 2cdd7480989962c69d8e7946ac8cf0cb76aa53e5..627efac73e6dce046d6c4d5bdab683ae13bbed5f 100644 (file)
@@ -3,6 +3,7 @@
 #define IOPRIO_H
 
 #include <linux/sched.h>
+#include <linux/sched/rt.h>
 #include <linux/iocontext.h>
 
 /*
@@ -63,7 +64,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;