fork.c (b5869ce7f68b233ceb81465a7644be0d9a5f3dbb) | fork.c (3e26c149c358529b1605f8959341d34bc4b880a3) |
---|---|
1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 93 unchanged lines hidden (view full) --- 102/* SLAB cache for vm_area_struct structures */ 103struct kmem_cache *vm_area_cachep; 104 105/* SLAB cache for mm_struct structures (tsk->mm) */ 106static struct kmem_cache *mm_cachep; 107 108void free_task(struct task_struct *tsk) 109{ | 1/* 2 * linux/kernel/fork.c 3 * 4 * Copyright (C) 1991, 1992 Linus Torvalds 5 */ 6 7/* 8 * 'fork.c' contains the help-routines for the 'fork' system call --- 93 unchanged lines hidden (view full) --- 102/* SLAB cache for vm_area_struct structures */ 103struct kmem_cache *vm_area_cachep; 104 105/* SLAB cache for mm_struct structures (tsk->mm) */ 106static struct kmem_cache *mm_cachep; 107 108void free_task(struct task_struct *tsk) 109{ |
110 prop_local_destroy_single(&tsk->dirties); |
|
110 free_thread_info(tsk->stack); 111 rt_mutex_debug_task_free(tsk); 112 free_task_struct(tsk); 113} 114EXPORT_SYMBOL(free_task); 115 116void __put_task_struct(struct task_struct *tsk) 117{ --- 40 unchanged lines hidden (view full) --- 158 init_task.signal->rlim[RLIMIT_SIGPENDING] = 159 init_task.signal->rlim[RLIMIT_NPROC]; 160} 161 162static struct task_struct *dup_task_struct(struct task_struct *orig) 163{ 164 struct task_struct *tsk; 165 struct thread_info *ti; | 111 free_thread_info(tsk->stack); 112 rt_mutex_debug_task_free(tsk); 113 free_task_struct(tsk); 114} 115EXPORT_SYMBOL(free_task); 116 117void __put_task_struct(struct task_struct *tsk) 118{ --- 40 unchanged lines hidden (view full) --- 159 init_task.signal->rlim[RLIMIT_SIGPENDING] = 160 init_task.signal->rlim[RLIMIT_NPROC]; 161} 162 163static struct task_struct *dup_task_struct(struct task_struct *orig) 164{ 165 struct task_struct *tsk; 166 struct thread_info *ti; |
167 int err; |
|
166 167 prepare_to_copy(orig); 168 169 tsk = alloc_task_struct(); 170 if (!tsk) 171 return NULL; 172 173 ti = alloc_thread_info(tsk); 174 if (!ti) { 175 free_task_struct(tsk); 176 return NULL; 177 } 178 179 *tsk = *orig; 180 tsk->stack = ti; | 168 169 prepare_to_copy(orig); 170 171 tsk = alloc_task_struct(); 172 if (!tsk) 173 return NULL; 174 175 ti = alloc_thread_info(tsk); 176 if (!ti) { 177 free_task_struct(tsk); 178 return NULL; 179 } 180 181 *tsk = *orig; 182 tsk->stack = ti; |
183 184 err = prop_local_init_single(&tsk->dirties); 185 if (err) { 186 free_thread_info(ti); 187 free_task_struct(tsk); 188 return NULL; 189 } 190 |
|
181 setup_thread_stack(tsk, orig); 182 183#ifdef CONFIG_CC_STACKPROTECTOR 184 tsk->stack_canary = get_random_int(); 185#endif 186 187 /* One for us, one for whoever does the "release_task()" (usually parent) */ 188 atomic_set(&tsk->usage,2); --- 1504 unchanged lines hidden --- | 191 setup_thread_stack(tsk, orig); 192 193#ifdef CONFIG_CC_STACKPROTECTOR 194 tsk->stack_canary = get_random_int(); 195#endif 196 197 /* One for us, one for whoever does the "release_task()" (usually parent) */ 198 atomic_set(&tsk->usage,2); --- 1504 unchanged lines hidden --- |