[PATCH 2/2] block/ioprio: use a helper to check for RT prio

From: Sebastian Andrzej Siewior
Date: Wed Oct 04 2017 - 11:49:28 EST


A side-effect to the old code is that now SCHED_DEADLINE is also
recognized.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
include/linux/ioprio.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 8c1239020d79..c8f3f0302220 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_elevated(task))
return IOPRIO_CLASS_RT;
else
return IOPRIO_CLASS_BE;
--
2.14.2