summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorTejun Heo2011-06-17 16:50:34 +0200
committerOleg Nesterov2011-06-22 19:26:27 +0200
commitd21142ece414ce1088cfcae760689aa60d6fee80 (patch)
tree9f97b4518cd06fe695476fc6cc4ff9ed8d5bdd58 /kernel/signal.c
parentptrace: implement PTRACE_LISTEN (diff)
downloadkernel-qcow2-linux-d21142ece414ce1088cfcae760689aa60d6fee80.tar.gz
kernel-qcow2-linux-d21142ece414ce1088cfcae760689aa60d6fee80.tar.xz
kernel-qcow2-linux-d21142ece414ce1088cfcae760689aa60d6fee80.zip
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>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 97e575a3387e..0f3370872506 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -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);