* [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code.
@ 2013-02-20 20:09 Raphael S.Carvalho
2013-02-20 20:31 ` Eric W. Biederman
0 siblings, 1 reply; 2+ messages in thread
From: Raphael S.Carvalho @ 2013-02-20 20:09 UTC (permalink / raw)
To: Andrew Morton, Oleg Nesterov, Al Viro, Srikar Dronamraju,
Eric W. Biederman
Cc: linux-kernel, Raphael S.Carvalho
Just sending this patch in order to simplify the code.
However, I'm not sure if the code was written in that way due to specific reasons.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
---
kernel/fork.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index c535f33..237204d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1341,9 +1341,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
}
p->pid = pid_nr(pid);
- p->tgid = p->pid;
- if (clone_flags & CLONE_THREAD)
- p->tgid = current->tgid;
+ p->tgid = (clone_flags & CLONE_THREAD) ? current->tgid : p->pid;
p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
/*
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code.
2013-02-20 20:09 [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code Raphael S.Carvalho
@ 2013-02-20 20:31 ` Eric W. Biederman
0 siblings, 0 replies; 2+ messages in thread
From: Eric W. Biederman @ 2013-02-20 20:31 UTC (permalink / raw)
To: Raphael S.Carvalho
Cc: Andrew Morton, Oleg Nesterov, Al Viro, Srikar Dronamraju,
linux-kernel
"Raphael S.Carvalho" <raphael.scarv@gmail.com> writes:
> Just sending this patch in order to simplify the code.
> However, I'm not sure if the code was written in that way due to
> specific reasons.
That doesn't look any simpler to me, and I expect you have now biased
the branch in the wrong direction.
The CLONE_THREAD is not the common case.
Eric
> Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
> ---
> kernel/fork.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index c535f33..237204d 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1341,9 +1341,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
> }
>
> p->pid = pid_nr(pid);
> - p->tgid = p->pid;
> - if (clone_flags & CLONE_THREAD)
> - p->tgid = current->tgid;
> + p->tgid = (clone_flags & CLONE_THREAD) ? current->tgid : p->pid;
>
> p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
> /*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-20 20:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20 20:09 [PATCH 1/1] kernel/fork.c: Simplifying a snippet of code Raphael S.Carvalho
2013-02-20 20:31 ` Eric W. Biederman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox