]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/fork.c
doc: move vm/00-INDEX to Documentation/vm
[linux-2.6-omap-h63xx.git] / kernel / fork.c
index 7332e236d3676153dc9f40c1a78848e6e2810632..3e764f6f2be1995363309c732c06387ad686b3f7 100644 (file)
@@ -107,6 +107,7 @@ static struct kmem_cache *mm_cachep;
 
 void free_task(struct task_struct *tsk)
 {
+       prop_local_destroy_single(&tsk->dirties);
        free_thread_info(tsk->stack);
        rt_mutex_debug_task_free(tsk);
        free_task_struct(tsk);
@@ -163,6 +164,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
 {
        struct task_struct *tsk;
        struct thread_info *ti;
+       int err;
 
        prepare_to_copy(orig);
 
@@ -178,6 +180,14 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
 
        *tsk = *orig;
        tsk->stack = ti;
+
+       err = prop_local_init_single(&tsk->dirties);
+       if (err) {
+               free_thread_info(ti);
+               free_task_struct(tsk);
+               return NULL;
+       }
+
        setup_thread_stack(tsk, orig);
 
 #ifdef CONFIG_CC_STACKPROTECTOR
@@ -877,6 +887,8 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
        sig->tty_old_pgrp = NULL;
 
        sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
+       sig->gtime = cputime_zero;
+       sig->cgtime = cputime_zero;
        sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
        sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
        sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
@@ -1045,6 +1057,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 
        p->utime = cputime_zero;
        p->stime = cputime_zero;
+       p->gtime = cputime_zero;
 
 #ifdef CONFIG_TASK_XACCT
        p->rchar = 0;           /* I/O counter: bytes read */
@@ -1143,13 +1156,14 @@ static struct task_struct *copy_process(unsigned long clone_flags,
         * Clear TID on mm_release()?
         */
        p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? child_tidptr: NULL;
+#ifdef CONFIG_FUTEX
        p->robust_list = NULL;
 #ifdef CONFIG_COMPAT
        p->compat_robust_list = NULL;
 #endif
        INIT_LIST_HEAD(&p->pi_state_list);
        p->pi_state_cache = NULL;
-
+#endif
        /*
         * sigaltstack should be cleared when sharing the same VM
         */
@@ -1432,13 +1446,12 @@ long do_fork(unsigned long clone_flags,
 #define ARCH_MIN_MMSTRUCT_ALIGN 0
 #endif
 
-static void sighand_ctor(void *data, struct kmem_cache *cachep,
-                       unsigned long flags)
+static void sighand_ctor(struct kmem_cache *cachep, void *data)
 {
        struct sighand_struct *sighand = data;
 
        spin_lock_init(&sighand->siglock);
-       INIT_LIST_HEAD(&sighand->signalfd_list);
+       init_waitqueue_head(&sighand->signalfd_wqh);
 }
 
 void __init proc_caches_init(void)
@@ -1608,7 +1621,8 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
        err = -EINVAL;
        if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|
                                CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|
-                               CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER))
+                               CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|
+                               CLONE_NEWNET))
                goto bad_unshare_out;
 
        if ((err = unshare_thread(unshare_flags)))