diff options
author | Tejun Heo <tj@kernel.org> | 2011-06-02 05:13:59 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2011-06-04 12:17:09 -0400 |
commit | a8f072c1d624a627b67f2ace2f0c25d856ef4e54 (patch) | |
tree | 9ba3e96aa874b08c7156a3584f27187bcdbdd9cd /kernel/ptrace.c | |
parent | 0b1007c3578569469a6fab6ae5cca918ccdc3ee1 (diff) |
job control: rename signal->group_stop and flags to jobctl and update them
signal->group_stop currently hosts mostly group stop related flags;
however, it's gonna be used for wider purposes and the GROUP_STOP_
flag prefix becomes confusing. Rename signal->group_stop to
signal->jobctl and rename all GROUP_STOP_* flags to JOBCTL_*.
Bit position macros JOBCTL_*_BIT are defined and JOBCTL_* flags are
defined in terms of them to allow using bitops later.
While at it, reassign JOBCTL_TRAPPING to bit 22 to better accomodate
future additions.
This doesn't cause any functional change.
-v2: JOBCTL_*_BIT macros added as suggested by Linus.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r-- | kernel/ptrace.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 4f689cb739a3..134f34cb142b 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -77,13 +77,13 @@ void __ptrace_unlink(struct task_struct *child) | |||
77 | spin_lock(&child->sighand->siglock); | 77 | spin_lock(&child->sighand->siglock); |
78 | 78 | ||
79 | /* | 79 | /* |
80 | * Reinstate GROUP_STOP_PENDING if group stop is in effect and | 80 | * Reinstate JOBCTL_STOP_PENDING if group stop is in effect and |
81 | * @child isn't dead. | 81 | * @child isn't dead. |
82 | */ | 82 | */ |
83 | if (!(child->flags & PF_EXITING) && | 83 | if (!(child->flags & PF_EXITING) && |
84 | (child->signal->flags & SIGNAL_STOP_STOPPED || | 84 | (child->signal->flags & SIGNAL_STOP_STOPPED || |
85 | child->signal->group_stop_count)) | 85 | child->signal->group_stop_count)) |
86 | child->group_stop |= GROUP_STOP_PENDING; | 86 | child->jobctl |= JOBCTL_STOP_PENDING; |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick | 89 | * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick |
@@ -91,7 +91,7 @@ void __ptrace_unlink(struct task_struct *child) | |||
91 | * is in TASK_TRACED; otherwise, we might unduly disrupt | 91 | * is in TASK_TRACED; otherwise, we might unduly disrupt |
92 | * TASK_KILLABLE sleeps. | 92 | * TASK_KILLABLE sleeps. |
93 | */ | 93 | */ |
94 | if (child->group_stop & GROUP_STOP_PENDING || task_is_traced(child)) | 94 | if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child)) |
95 | signal_wake_up(child, task_is_traced(child)); | 95 | signal_wake_up(child, task_is_traced(child)); |
96 | 96 | ||
97 | spin_unlock(&child->sighand->siglock); | 97 | spin_unlock(&child->sighand->siglock); |
@@ -226,7 +226,7 @@ static int ptrace_attach(struct task_struct *task) | |||
226 | spin_lock(&task->sighand->siglock); | 226 | spin_lock(&task->sighand->siglock); |
227 | 227 | ||
228 | /* | 228 | /* |
229 | * If the task is already STOPPED, set GROUP_STOP_PENDING and | 229 | * If the task is already STOPPED, set JOBCTL_STOP_PENDING and |
230 | * TRAPPING, and kick it so that it transits to TRACED. TRAPPING | 230 | * TRAPPING, and kick it so that it transits to TRACED. TRAPPING |
231 | * will be cleared if the child completes the transition or any | 231 | * will be cleared if the child completes the transition or any |
232 | * event which clears the group stop states happens. We'll wait | 232 | * event which clears the group stop states happens. We'll wait |
@@ -243,7 +243,7 @@ static int ptrace_attach(struct task_struct *task) | |||
243 | * in and out of STOPPED are protected by siglock. | 243 | * in and out of STOPPED are protected by siglock. |
244 | */ | 244 | */ |
245 | if (task_is_stopped(task)) { | 245 | if (task_is_stopped(task)) { |
246 | task->group_stop |= GROUP_STOP_PENDING | GROUP_STOP_TRAPPING; | 246 | task->jobctl |= JOBCTL_STOP_PENDING | JOBCTL_TRAPPING; |
247 | signal_wake_up(task, 1); | 247 | signal_wake_up(task, 1); |
248 | } | 248 | } |
249 | 249 | ||
@@ -257,7 +257,7 @@ unlock_creds: | |||
257 | out: | 257 | out: |
258 | if (!retval) | 258 | if (!retval) |
259 | wait_event(current->signal->wait_chldexit, | 259 | wait_event(current->signal->wait_chldexit, |
260 | !(task->group_stop & GROUP_STOP_TRAPPING)); | 260 | !(task->jobctl & JOBCTL_TRAPPING)); |
261 | return retval; | 261 | return retval; |
262 | } | 262 | } |
263 | 263 | ||