job control: introduce JOBCTL_PENDING_MASK and task_clear_jobctl_pending()

This patch introduces JOBCTL_PENDING_MASK and replaces
task_clear_jobctl_stop_pending() with task_clear_jobctl_pending()
which takes an extra @mask argument.

JOBCTL_PENDING_MASK is currently equal to JOBCTL_STOP_PENDING but
future patches will add more bits.  recalc_sigpending_tsk() is updated
to use JOBCTL_PENDING_MASK instead.

task_clear_jobctl_pending() takes @mask which in subset of
JOBCTL_PENDING_MASK and clears the relevant jobctl bits.  If
JOBCTL_STOP_PENDING is set, other STOP bits are cleared together.  All
task_clear_jobctl_stop_pending() users are updated to call
task_clear_jobctl_pending() with JOBCTL_STOP_PENDING which is
functionally identical to task_clear_jobctl_stop_pending().

This patch doesn't cause any functional change.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
This commit is contained in:
Tejun Heo
2011-06-02 11:14:00 +02:00
committed by Oleg Nesterov
parent 81be24b8cd
commit 3759a0d94c
3 changed files with 22 additions and 12 deletions

View File

@@ -1772,7 +1772,7 @@ static int zap_process(struct task_struct *start, int exit_code)
t = start;
do {
task_clear_jobctl_stop_pending(t);
task_clear_jobctl_pending(t, JOBCTL_STOP_PENDING);
if (t != current && t->mm) {
sigaddset(&t->pending.signal, SIGKILL);
signal_wake_up(t, 1);