diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
commit | 59223edaa18759982db0a8aced0e77457d10c68e (patch) | |
tree | 89354903b01fa0a447bffeefe00df3044495db2e /kernel/fork.c | |
parent | db7d4daea91e105e3859cf461d7e53b9b77454b2 (diff) |
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index a431ffe2b..e85429ba4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -303,7 +303,7 @@ struct mm_struct * mm_alloc(void) atomic_set(&mm->count, 1); mm->map_count = 0; mm->def_flags = 0; - mm->mmap_sem = MUTEX_LOCKED; + init_MUTEX_LOCKED(&mm->mmap_sem); /* * Leave mm->pgd set to the parent's pgd * so that pgd_offset() is always valid. @@ -390,7 +390,10 @@ static inline int copy_mm(int nr, unsigned long clone_flags, struct task_struct return 0; free_mm: - mm->pgd = NULL; + tsk->mm = NULL; + release_segments(mm); + kmem_cache_free(mm_cachep, mm); + return retval; free_pt: tsk->mm = NULL; mmput(mm); @@ -536,7 +539,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) int nr; int retval = -ENOMEM; struct task_struct *p; - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); current->vfork_sem = &sem; @@ -589,7 +592,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) p->p_pptr = p->p_opptr = current; p->p_cptr = NULL; - init_waitqueue(&p->wait_chldexit); + init_waitqueue_head(&p->wait_chldexit); p->vfork_sem = NULL; p->sigpending = 0; |