[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110727163239.GB23793@redhat.com>
Date: Wed, 27 Jul 2011 18:32:39 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Roland McGrath <roland@...k.frob.com>,
Tejun Heo <tj@...nel.org>
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Matt Fleming <matt.fleming@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/8] vfork: introduce clone_vfork_finish()
No functional changes.
Move the wait-for-vfork_done code from do_wait() into the new
helper, clone_vfork_finish().
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/fork.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
--- 3.1/kernel/fork.c~2_wait_for_vfork_done 2011-07-26 17:52:25.000000000 +0200
+++ 3.1/kernel/fork.c 2011-07-26 17:52:59.000000000 +0200
@@ -1449,6 +1449,17 @@ void complete_vfork_done(struct task_str
complete(vfork_done);
}
+static long clone_vfork_finish(struct task_struct *child,
+ struct completion *vfork_done, long pid)
+{
+ freezer_do_not_count();
+ wait_for_completion(vfork_done);
+ freezer_count();
+
+ ptrace_event(PTRACE_EVENT_VFORK_DONE, pid);
+ return pid;
+}
+
/*
* Ok, this is the main fork-routine.
*
@@ -1536,12 +1547,8 @@ long do_fork(unsigned long clone_flags,
if (unlikely(trace))
ptrace_event(trace, nr);
- if (clone_flags & CLONE_VFORK) {
- freezer_do_not_count();
- wait_for_completion(&vfork);
- freezer_count();
- ptrace_event(PTRACE_EVENT_VFORK_DONE, nr);
- }
+ if (clone_flags & CLONE_VFORK)
+ nr = clone_vfork_finish(p, &vfork, nr);
} else {
nr = PTR_ERR(p);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists