aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-01-03 02:18:01 -0500
committerDave Airlie <airlied@linux.ie>2006-01-03 02:18:01 -0500
commit97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch)
treebb6e3b2949459f54f884c710fc74d40eef00d834 /kernel/fork.c
parentd985c1088146607532093d9eaaaf99758f6a4d21 (diff)
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
drm: merge in Linus mainline
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 158710d22566..fb8572a42297 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -171,10 +171,9 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
171 return NULL; 171 return NULL;
172 } 172 }
173 173
174 *ti = *orig->thread_info;
175 *tsk = *orig; 174 *tsk = *orig;
176 tsk->thread_info = ti; 175 tsk->thread_info = ti;
177 ti->task = tsk; 176 setup_thread_stack(tsk, orig);
178 177
179 /* One for us, one for whoever does the "release_task()" (usually parent) */ 178 /* One for us, one for whoever does the "release_task()" (usually parent) */
180 atomic_set(&tsk->usage,2); 179 atomic_set(&tsk->usage,2);
@@ -264,7 +263,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
264 rb_parent = &tmp->vm_rb; 263 rb_parent = &tmp->vm_rb;
265 264
266 mm->map_count++; 265 mm->map_count++;
267 retval = copy_page_range(mm, oldmm, tmp); 266 retval = copy_page_range(mm, oldmm, mpnt);
268 267
269 if (tmp->vm_ops && tmp->vm_ops->open) 268 if (tmp->vm_ops && tmp->vm_ops->open)
270 tmp->vm_ops->open(tmp); 269 tmp->vm_ops->open(tmp);
@@ -324,7 +323,6 @@ static struct mm_struct * mm_init(struct mm_struct * mm)
324 spin_lock_init(&mm->page_table_lock); 323 spin_lock_init(&mm->page_table_lock);
325 rwlock_init(&mm->ioctx_list_lock); 324 rwlock_init(&mm->ioctx_list_lock);
326 mm->ioctx_list = NULL; 325 mm->ioctx_list = NULL;
327 mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm);
328 mm->free_area_cache = TASK_UNMAPPED_BASE; 326 mm->free_area_cache = TASK_UNMAPPED_BASE;
329 mm->cached_hole_size = ~0UL; 327 mm->cached_hole_size = ~0UL;
330 328
@@ -919,7 +917,7 @@ static task_t *copy_process(unsigned long clone_flags,
919 if (nr_threads >= max_threads) 917 if (nr_threads >= max_threads)
920 goto bad_fork_cleanup_count; 918 goto bad_fork_cleanup_count;
921 919
922 if (!try_module_get(p->thread_info->exec_domain->module)) 920 if (!try_module_get(task_thread_info(p)->exec_domain->module))
923 goto bad_fork_cleanup_count; 921 goto bad_fork_cleanup_count;
924 922
925 if (p->binfmt && !try_module_get(p->binfmt->module)) 923 if (p->binfmt && !try_module_get(p->binfmt->module))
@@ -1126,8 +1124,6 @@ static task_t *copy_process(unsigned long clone_flags,
1126 if (unlikely(p->ptrace & PT_PTRACED)) 1124 if (unlikely(p->ptrace & PT_PTRACED))
1127 __ptrace_link(p, current->parent); 1125 __ptrace_link(p, current->parent);
1128 1126
1129 cpuset_fork(p);
1130
1131 attach_pid(p, PIDTYPE_PID, p->pid); 1127 attach_pid(p, PIDTYPE_PID, p->pid);
1132 attach_pid(p, PIDTYPE_TGID, p->tgid); 1128 attach_pid(p, PIDTYPE_TGID, p->tgid);
1133 if (thread_group_leader(p)) { 1129 if (thread_group_leader(p)) {
@@ -1137,13 +1133,14 @@ static task_t *copy_process(unsigned long clone_flags,
1137 __get_cpu_var(process_counts)++; 1133 __get_cpu_var(process_counts)++;
1138 } 1134 }
1139 1135
1140 proc_fork_connector(p);
1141 if (!current->signal->tty && p->signal->tty) 1136 if (!current->signal->tty && p->signal->tty)
1142 p->signal->tty = NULL; 1137 p->signal->tty = NULL;
1143 1138
1144 nr_threads++; 1139 nr_threads++;
1145 total_forks++; 1140 total_forks++;
1146 write_unlock_irq(&tasklist_lock); 1141 write_unlock_irq(&tasklist_lock);
1142 proc_fork_connector(p);
1143 cpuset_fork(p);
1147 retval = 0; 1144 retval = 0;
1148 1145
1149fork_out: 1146fork_out:
@@ -1180,7 +1177,7 @@ bad_fork_cleanup:
1180 if (p->binfmt) 1177 if (p->binfmt)
1181 module_put(p->binfmt->module); 1178 module_put(p->binfmt->module);
1182bad_fork_cleanup_put_domain: 1179bad_fork_cleanup_put_domain:
1183 module_put(p->thread_info->exec_domain->module); 1180 module_put(task_thread_info(p)->exec_domain->module);
1184bad_fork_cleanup_count: 1181bad_fork_cleanup_count:
1185 put_group_info(p->group_info); 1182 put_group_info(p->group_info);
1186 atomic_dec(&p->user->processes); 1183 atomic_dec(&p->user->processes);