mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +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
|
@ -765,7 +765,7 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p,
|
|||
p->exit_signal = SIGCHLD;
|
||||
|
||||
/* If it has exited notify the new parent about this child's death. */
|
||||
if (!task_ptrace(p) &&
|
||||
if (!p->ptrace &&
|
||||
p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) {
|
||||
do_notify_parent(p, p->exit_signal);
|
||||
if (task_detached(p)) {
|
||||
|
@ -795,7 +795,7 @@ static void forget_original_parent(struct task_struct *father)
|
|||
do {
|
||||
t->real_parent = reaper;
|
||||
if (t->parent == father) {
|
||||
BUG_ON(task_ptrace(t));
|
||||
BUG_ON(t->ptrace);
|
||||
t->parent = t->real_parent;
|
||||
}
|
||||
if (t->pdeath_signal)
|
||||
|
@ -1565,7 +1565,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
|
|||
* Notification and reaping will be cascaded to the real
|
||||
* parent when the ptracer detaches.
|
||||
*/
|
||||
if (likely(!ptrace) && unlikely(task_ptrace(p))) {
|
||||
if (likely(!ptrace) && unlikely(p->ptrace)) {
|
||||
/* it will become visible, clear notask_error */
|
||||
wo->notask_error = 0;
|
||||
return 0;
|
||||
|
@ -1608,7 +1608,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
|
|||
* own children, it should create a separate process which
|
||||
* takes the role of real parent.
|
||||
*/
|
||||
if (likely(!ptrace) && task_ptrace(p) &&
|
||||
if (likely(!ptrace) && p->ptrace &&
|
||||
same_thread_group(p->parent, p->real_parent))
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue