summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2020-04-27 16:38:29 +0200
committerEric W. Biederman <ebiederm@xmission.com>2020-04-29 14:14:51 +0200
commitfece98260f31292dd468925c7582065bf6193212 (patch)
tree0d7308863bfec2f1c0424b237dbfab202ff919aa /kernel/time
parentposix-cpu-timers: Extend rcu_read_lock removing task_struct references (diff)
downloadlinux-fece98260f31292dd468925c7582065bf6193212.tar.xz
linux-fece98260f31292dd468925c7582065bf6193212.zip
posix-cpu-timers: Replace cpu_timer_pid_type with clock_pid_type
Taking a clock and returning a pid_type is a more general and a superset of taking a timer and returning a pid_type. Perform this generalization so that future changes may use this code on clocks as well as timers. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/posix-cpu-timers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 91996dd089a4..42f673974d71 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -113,14 +113,14 @@ static inline int validate_clock_permissions(const clockid_t clock)
return ret;
}
-static inline enum pid_type cpu_timer_pid_type(struct k_itimer *timer)
+static inline enum pid_type clock_pid_type(const clockid_t clock)
{
- return CPUCLOCK_PERTHREAD(timer->it_clock) ? PIDTYPE_PID : PIDTYPE_TGID;
+ return CPUCLOCK_PERTHREAD(clock) ? PIDTYPE_PID : PIDTYPE_TGID;
}
static inline struct task_struct *cpu_timer_task_rcu(struct k_itimer *timer)
{
- return pid_task(timer->it.cpu.pid, cpu_timer_pid_type(timer));
+ return pid_task(timer->it.cpu.pid, clock_pid_type(timer->it_clock));
}
/*
@@ -403,7 +403,7 @@ static int posix_cpu_timer_create(struct k_itimer *new_timer)
new_timer->kclock = &clock_posix_cpu;
timerqueue_init(&new_timer->it.cpu.node);
- new_timer->it.cpu.pid = get_task_pid(p, cpu_timer_pid_type(new_timer));
+ new_timer->it.cpu.pid = get_task_pid(p, clock_pid_type(new_timer->it_clock));
rcu_read_unlock();
return 0;
}