diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 4018308048cf..242a706e7721 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -817,17 +817,17 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) | |||
817 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | 817 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) |
818 | { | 818 | { |
819 | struct signal_struct *sig; | 819 | struct signal_struct *sig; |
820 | int ret; | ||
821 | 820 | ||
822 | if (clone_flags & CLONE_THREAD) { | 821 | if (clone_flags & CLONE_THREAD) { |
823 | ret = thread_group_cputime_clone_thread(current); | 822 | atomic_inc(¤t->signal->count); |
824 | if (likely(!ret)) { | 823 | atomic_inc(¤t->signal->live); |
825 | atomic_inc(¤t->signal->count); | 824 | return 0; |
826 | atomic_inc(¤t->signal->live); | ||
827 | } | ||
828 | return ret; | ||
829 | } | 825 | } |
830 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); | 826 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); |
827 | |||
828 | if (sig) | ||
829 | posix_cpu_timers_init_group(sig); | ||
830 | |||
831 | tsk->signal = sig; | 831 | tsk->signal = sig; |
832 | if (!sig) | 832 | if (!sig) |
833 | return -ENOMEM; | 833 | return -ENOMEM; |
@@ -864,8 +864,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
864 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); | 864 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); |
865 | task_unlock(current->group_leader); | 865 | task_unlock(current->group_leader); |
866 | 866 | ||
867 | posix_cpu_timers_init_group(sig); | ||
868 | |||
869 | acct_init_pacct(&sig->pacct); | 867 | acct_init_pacct(&sig->pacct); |
870 | 868 | ||
871 | tty_audit_fork(sig); | 869 | tty_audit_fork(sig); |
@@ -901,7 +899,7 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p) | |||
901 | clear_freeze_flag(p); | 899 | clear_freeze_flag(p); |
902 | } | 900 | } |
903 | 901 | ||
904 | asmlinkage long sys_set_tid_address(int __user *tidptr) | 902 | SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) |
905 | { | 903 | { |
906 | current->clear_child_tid = tidptr; | 904 | current->clear_child_tid = tidptr; |
907 | 905 | ||
@@ -1481,12 +1479,10 @@ void __init proc_caches_init(void) | |||
1481 | fs_cachep = kmem_cache_create("fs_cache", | 1479 | fs_cachep = kmem_cache_create("fs_cache", |
1482 | sizeof(struct fs_struct), 0, | 1480 | sizeof(struct fs_struct), 0, |
1483 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); | 1481 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); |
1484 | vm_area_cachep = kmem_cache_create("vm_area_struct", | ||
1485 | sizeof(struct vm_area_struct), 0, | ||
1486 | SLAB_PANIC, NULL); | ||
1487 | mm_cachep = kmem_cache_create("mm_struct", | 1482 | mm_cachep = kmem_cache_create("mm_struct", |
1488 | sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, | 1483 | sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, |
1489 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); | 1484 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); |
1485 | mmap_init(); | ||
1490 | } | 1486 | } |
1491 | 1487 | ||
1492 | /* | 1488 | /* |
@@ -1605,7 +1601,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp | |||
1605 | * constructed. Here we are modifying the current, active, | 1601 | * constructed. Here we are modifying the current, active, |
1606 | * task_struct. | 1602 | * task_struct. |
1607 | */ | 1603 | */ |
1608 | asmlinkage long sys_unshare(unsigned long unshare_flags) | 1604 | SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) |
1609 | { | 1605 | { |
1610 | int err = 0; | 1606 | int err = 0; |
1611 | struct fs_struct *fs, *new_fs = NULL; | 1607 | struct fs_struct *fs, *new_fs = NULL; |