diff options
author | David Rientjes <rientjes@google.com> | 2014-04-07 18:37:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:35:54 -0400 |
commit | 514ddb446c5c5a238eca32b7052b7a8accae4e93 (patch) | |
tree | cce82322a396a2d00e69f659728ce29baae7d9f7 /kernel/fork.c | |
parent | 3b32123d734cb414e366b35a3b2142a995f9d1a0 (diff) |
fork: collapse copy_flags into copy_process
copy_flags() does not use the clone_flags formal and can be collapsed
into copy_process() for cleaner code.
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: Tim Hockin <thockin@google.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index bc0e96b78dfd..c777964c0662 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1080,15 +1080,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
1080 | return 0; | 1080 | return 0; |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | static void copy_flags(unsigned long clone_flags, struct task_struct *p) | ||
1084 | { | ||
1085 | unsigned long new_flags = p->flags; | ||
1086 | |||
1087 | new_flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER); | ||
1088 | new_flags |= PF_FORKNOEXEC; | ||
1089 | p->flags = new_flags; | ||
1090 | } | ||
1091 | |||
1092 | SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) | 1083 | SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) |
1093 | { | 1084 | { |
1094 | current->clear_child_tid = tidptr; | 1085 | current->clear_child_tid = tidptr; |
@@ -1238,7 +1229,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1238 | goto bad_fork_cleanup_count; | 1229 | goto bad_fork_cleanup_count; |
1239 | 1230 | ||
1240 | delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ | 1231 | delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ |
1241 | copy_flags(clone_flags, p); | 1232 | p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER); |
1233 | p->flags |= PF_FORKNOEXEC; | ||
1242 | INIT_LIST_HEAD(&p->children); | 1234 | INIT_LIST_HEAD(&p->children); |
1243 | INIT_LIST_HEAD(&p->sibling); | 1235 | INIT_LIST_HEAD(&p->sibling); |
1244 | rcu_copy_process(p); | 1236 | rcu_copy_process(p); |