From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: [RFC PATCH 4/X] ptrace: kill the now unneeded args from tracehook_finish_clone() path
Date: Mon, 25 May 2009 02:00:05 +0200 [thread overview]
Message-ID: <20090525000005.GA2221@redhat.com> (raw)
With the previous change tracehook_finish_clone() and ptrace_init_task()
do not need any arguments except "child", remove them.
include/linux/ptrace.h | 7 +++----
include/linux/tracehook.h | 10 +++-------
kernel/fork.c | 2 +-
3 files changed, 7 insertions(+), 12 deletions(-)
--- PTRACE/include/linux/ptrace.h~4_FORK_TRACE 2009-05-24 22:14:41.000000000 +0200
+++ PTRACE/include/linux/ptrace.h 2009-05-24 22:15:08.000000000 +0200
@@ -162,20 +162,19 @@ static inline int ptrace_event(int mask,
/**
* ptrace_init_task - initialize ptrace state for a new child
* @child: new child task
- * @ptrace: true if child should be ptrace'd by parent's tracer
*
* This is called immediately after adding @child to its parent's children
- * list. @ptrace is false in the normal case, and true to ptrace @child.
+ * list.
*
* Called with current's siglock and write_lock_irq(&tasklist_lock) held.
*/
-static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
+static inline void ptrace_init_task(struct task_struct *child)
{
INIT_LIST_HEAD(&child->ptrace_entry);
INIT_LIST_HEAD(&child->ptraced);
child->parent = child->real_parent;
child->ptrace = 0;
- if (unlikely(ptrace)) {
+ if (unlikely(child->ptrace_task)) {
child->ptrace = current->ptrace;
ptrace_link(child, current->parent);
}
--- PTRACE/include/linux/tracehook.h~4_FORK_TRACE 2009-05-24 22:14:41.000000000 +0200
+++ PTRACE/include/linux/tracehook.h 2009-05-24 22:15:08.000000000 +0200
@@ -219,7 +219,7 @@ static inline void tracehook_report_exit
* @clone_flags: %CLONE_* flags from clone/fork/vfork system call
*
* This is called before a new user task is to be cloned.
- * Its return value will be passed to tracehook_finish_clone().
+ * Its return value will be passed to tracehook_init_task().
*
* Called with no locks held.
*/
@@ -275,18 +275,14 @@ static inline void tracehook_free_task(s
/**
* tracehook_finish_clone - new child created and being attached
* @child: new child task
- * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
- * @trace: return value from tracehook_prepare_clone()
*
* This is called immediately after adding @child to its parent's children list.
- * The @trace value is that returned by tracehook_prepare_clone().
*
* Called with current's siglock and write_lock_irq(&tasklist_lock) held.
*/
-static inline void tracehook_finish_clone(struct task_struct *child,
- unsigned long clone_flags, int trace)
+static inline void tracehook_finish_clone(struct task_struct *child)
{
- ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace);
+ ptrace_init_task(child);
}
/**
--- PTRACE/kernel/fork.c~4_FORK_TRACE 2009-05-24 22:14:41.000000000 +0200
+++ PTRACE/kernel/fork.c 2009-05-24 22:15:08.000000000 +0200
@@ -1247,7 +1247,7 @@ static struct task_struct *copy_process(
if (likely(p->pid)) {
list_add_tail(&p->sibling, &p->real_parent->children);
- tracehook_finish_clone(p, clone_flags, trace);
+ tracehook_finish_clone(p);
if (thread_group_leader(p)) {
if (clone_flags & CLONE_NEWPID)
next reply other threads:[~2009-05-25 0:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 0:00 Oleg Nesterov [this message]
2009-05-26 20:51 ` [RFC PATCH 4/X] ptrace: kill the now unneeded args from tracehook_finish_clone() path Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090525000005.GA2221@redhat.com \
--to=oleg@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.