mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
ptrace: kill task_ptrace()
task_ptrace(task) simply dereferences task->ptrace and isn't even used consistently only adding confusion. Kill it and directly access ->ptrace instead. This doesn't introduce any behavior change. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
This commit is contained in:
parent
544b2c91a9
commit
d21142ece4
5 changed files with 20 additions and 32 deletions
|
@ -1592,7 +1592,7 @@ int do_notify_parent(struct task_struct *tsk, int sig)
|
|||
/* do_notify_parent_cldstop should have been called instead. */
|
||||
BUG_ON(task_is_stopped_or_traced(tsk));
|
||||
|
||||
BUG_ON(!task_ptrace(tsk) &&
|
||||
BUG_ON(!tsk->ptrace &&
|
||||
(tsk->group_leader != tsk || !thread_group_empty(tsk)));
|
||||
|
||||
info.si_signo = sig;
|
||||
|
@ -1631,7 +1631,7 @@ int do_notify_parent(struct task_struct *tsk, int sig)
|
|||
|
||||
psig = tsk->parent->sighand;
|
||||
spin_lock_irqsave(&psig->siglock, flags);
|
||||
if (!task_ptrace(tsk) && sig == SIGCHLD &&
|
||||
if (!tsk->ptrace && sig == SIGCHLD &&
|
||||
(psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN ||
|
||||
(psig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDWAIT))) {
|
||||
/*
|
||||
|
@ -1731,7 +1731,7 @@ static void do_notify_parent_cldstop(struct task_struct *tsk,
|
|||
|
||||
static inline int may_ptrace_stop(void)
|
||||
{
|
||||
if (!likely(task_ptrace(current)))
|
||||
if (!likely(current->ptrace))
|
||||
return 0;
|
||||
/*
|
||||
* Are we in the middle of do_coredump?
|
||||
|
@ -1989,7 +1989,7 @@ static bool do_signal_stop(int signr)
|
|||
if (!(sig->flags & SIGNAL_STOP_STOPPED))
|
||||
sig->group_exit_code = signr;
|
||||
else
|
||||
WARN_ON_ONCE(!task_ptrace(current));
|
||||
WARN_ON_ONCE(!current->ptrace);
|
||||
|
||||
sig->group_stop_count = 0;
|
||||
|
||||
|
@ -2014,7 +2014,7 @@ static bool do_signal_stop(int signr)
|
|||
}
|
||||
}
|
||||
|
||||
if (likely(!task_ptrace(current))) {
|
||||
if (likely(!current->ptrace)) {
|
||||
int notify = 0;
|
||||
|
||||
/*
|
||||
|
@ -2093,7 +2093,7 @@ static void do_jobctl_trap(void)
|
|||
static int ptrace_signal(int signr, siginfo_t *info,
|
||||
struct pt_regs *regs, void *cookie)
|
||||
{
|
||||
if (!task_ptrace(current))
|
||||
if (!current->ptrace)
|
||||
return signr;
|
||||
|
||||
ptrace_signal_deliver(regs, cookie);
|
||||
|
@ -2179,7 +2179,7 @@ relock:
|
|||
do_notify_parent_cldstop(current, false, why);
|
||||
|
||||
leader = current->group_leader;
|
||||
if (task_ptrace(leader) && !real_parent_is_ptracer(leader))
|
||||
if (leader->ptrace && !real_parent_is_ptracer(leader))
|
||||
do_notify_parent_cldstop(leader, true, why);
|
||||
|
||||
read_unlock(&tasklist_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue