[PATCH v3 4/6] sched: Move dl_policy() to "include/linux/sched.h"

From: Xunlei Pang
Date: Thu Apr 14 2016 - 07:37:48 EST


Rtmutex code will need dl_policy(), so make it visible to rtmutex.

Signed-off-by: Xunlei Pang <xlpang@xxxxxxxxxx>
---
include/linux/sched.h | 5 +++++
kernel/sched/sched.h | 4 ----
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 332a6b5..8ad3522 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1309,6 +1309,11 @@ struct sched_rt_entity {
#endif
};

+static inline int dl_policy(int policy)
+{
+ return policy == SCHED_DEADLINE;
+}
+
struct sched_dl_entity {
struct rb_node rb_node;

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index a7cbad7..0e6ea02 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -99,10 +99,6 @@ static inline int rt_policy(int policy)
return policy == SCHED_FIFO || policy == SCHED_RR;
}

-static inline int dl_policy(int policy)
-{
- return policy == SCHED_DEADLINE;
-}
static inline bool valid_policy(int policy)
{
return idle_policy(policy) || fair_policy(policy) ||
--
1.8.3.1