aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>2014-05-08 05:33:49 -0400
committerIngo Molnar <mingo@kernel.org>2014-05-22 05:16:36 -0400
commit7aa2c016db2162defff77f6f5731bff3f25e5175 (patch)
treeaf4d613e911eec6db4ccffeb1d100f718a9de9c5 /kernel/sched/core.c
parenta803f0261bb2bb57aab5542af3174db43b2a3887 (diff)
sched: Consolidate open coded implementations of nice level frobbing into nice_to_rlimit() and rlimit_to_nice()
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/a568a1e3cc8e78648f41b5035fa5e381d36274da.1399532322.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index da302ca98f60..321d800e4baa 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3033,7 +3033,7 @@ EXPORT_SYMBOL(set_user_nice);
3033int can_nice(const struct task_struct *p, const int nice) 3033int can_nice(const struct task_struct *p, const int nice)
3034{ 3034{
3035 /* convert nice value [19,-20] to rlimit style value [1,40] */ 3035 /* convert nice value [19,-20] to rlimit style value [1,40] */
3036 int nice_rlim = 20 - nice; 3036 int nice_rlim = nice_to_rlimit(nice);
3037 3037
3038 return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) || 3038 return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
3039 capable(CAP_SYS_NICE)); 3039 capable(CAP_SYS_NICE));