ocfs2: Proper cleanup in case of error in ocfs2_register_hb_callbacks()
[powerpc.git] / kernel / fork.c
index 4cf8684..d154cc7 100644 (file)
@@ -858,7 +858,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
        init_sigpending(&sig->shared_pending);
        INIT_LIST_HEAD(&sig->posix_timers);
 
-       hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_REL);
+       hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        sig->it_real_incr.tv64 = 0;
        sig->real_timer.function = it_real_fn;
        sig->tsk = tsk;
@@ -869,7 +869,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
        sig->it_prof_incr = cputime_zero;
 
        sig->leader = 0;        /* session leadership doesn't inherit */
-       sig->tty_old_pgrp = 0;
+       sig->tty_old_pgrp = NULL;
 
        sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
        sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
@@ -1038,10 +1038,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->utime = cputime_zero;
        p->stime = cputime_zero;
        p->sched_time = 0;
+#ifdef CONFIG_TASK_XACCT
        p->rchar = 0;           /* I/O counter: bytes read */
        p->wchar = 0;           /* I/O counter: bytes written */
        p->syscr = 0;           /* I/O counter: read syscalls */
        p->syscw = 0;           /* I/O counter: write syscalls */
+#endif
        task_io_accounting_init(p);
        acct_clear_integrals(p);
 
@@ -1265,7 +1267,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        return p;
 
 bad_fork_cleanup_namespaces:
-       put_and_finalize_nsproxy(p->nsproxy);
+       exit_task_namespaces(p);
 bad_fork_cleanup_keys:
        exit_keys(p);
 bad_fork_cleanup_mm:
@@ -1313,7 +1315,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re
        return regs;
 }
 
-struct task_struct * __devinit fork_idle(int cpu)
+struct task_struct * __cpuinit fork_idle(int cpu)
 {
        struct task_struct *task;
        struct pt_regs regs;
@@ -1711,7 +1713,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)
        }
 
        if (new_nsproxy)
-               put_and_finalize_nsproxy(new_nsproxy);
+               put_nsproxy(new_nsproxy);
 
 bad_unshare_cleanup_ipc:
        if (new_ipc)