vfork: introduce complete_vfork_done()
No functional changes. Move the clear-and-complete-vfork_done code into the new trivial helper, complete_vfork_done(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
880641bb9d
commit
c415c3b47e
@@ -1915,7 +1915,6 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
struct mm_struct *mm = tsk->mm;
|
||||
struct completion *vfork_done;
|
||||
int core_waiters = -EBUSY;
|
||||
|
||||
init_completion(&core_state->startup);
|
||||
@@ -1934,11 +1933,8 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
|
||||
* Make sure nobody is waiting for us to release the VM,
|
||||
* otherwise we can deadlock when we wait on each other
|
||||
*/
|
||||
vfork_done = tsk->vfork_done;
|
||||
if (vfork_done) {
|
||||
tsk->vfork_done = NULL;
|
||||
complete(vfork_done);
|
||||
}
|
||||
if (tsk->vfork_done)
|
||||
complete_vfork_done(tsk);
|
||||
|
||||
if (core_waiters)
|
||||
wait_for_completion(&core_state->startup);
|
||||
|
Reference in New Issue
Block a user