diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2020-04-30 06:18:01 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2020-04-30 06:18:01 -0500 |
commit | 06576edd0e802cf72a7edaaa2fba7da7b94efaae (patch) | |
tree | 4f9bc099d5b952496b53420da532be15efb63acc /kernel | |
parent | 507122805edd25fcda8e959b870cd897b27a05c1 (diff) | |
parent | bbd40fc4816d5329a89397206ece9f1763787a88 (diff) |
Removing has_group_leader_pid
With de_thread now calling exchange_tids has_group_leader_pid no longer
makes any sense and is equivalent to calling thread_group_leader.
As there are only 2 remaining users of has_group_leader_pid let's
update the code and get rid of has_group_leader_pid.
There is one extra patch to lookup_task that performs that unifies
to code paths that become identical when has_group_leader_pid went
away.
Eric W. Biederman (4):
posix-cpu-timer: Tidy up group_leader logic in lookup_task
posix-cpu-timer: Unify the now redundant code in lookup_task
exec: Remove BUG_ON(has_group_leader_pid)
signal: Remove has_group_leader_pid
fs/exec.c | 1 -
include/linux/sched/signal.h | 11 -----------
kernel/time/posix-cpu-timers.c | 21 ++++++++-------------
3 files changed, 8 insertions(+), 25 deletions(-)
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/posix-cpu-timers.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 2fd3b3fa68bf..b7f972fb115e 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -66,23 +66,18 @@ static struct task_struct *lookup_task(const pid_t pid, bool thread, if (thread) return same_thread_group(p, current) ? p : NULL; - if (gettime) { - /* - * For clock_gettime(PROCESS) the task does not need to be - * the actual group leader. tsk->sighand gives - * access to the group's clock. - * - * Timers need the group leader because they take a - * reference on it and store the task pointer until the - * timer is destroyed. - */ - return (p == current || thread_group_leader(p)) ? p : NULL; - } + /* + * For clock_gettime(PROCESS) the task does not need to be + * the actual group leader. task->signal gives + * access to the group's clock. + */ + if (gettime && (p == current)) + return p; /* * For processes require that p is group leader. */ - return has_group_leader_pid(p) ? p : NULL; + return thread_group_leader(p) ? p : NULL; } static struct task_struct *__get_task_for_clock(const clockid_t clock, |