patch-2.4.3 linux/kernel/fork.c

Next file: linux/kernel/ksyms.c
Previous file: linux/kernel/acct.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/kernel/fork.c linux/kernel/fork.c
@@ -201,7 +201,7 @@
 {
 	atomic_set(&mm->mm_users, 1);
 	atomic_set(&mm->mm_count, 1);
-	init_MUTEX(&mm->mmap_sem);
+	init_rwsem(&mm->mmap_sem);
 	mm->page_table_lock = SPIN_LOCK_UNLOCKED;
 	mm->pgd = pgd_alloc();
 	if (mm->pgd)
@@ -314,9 +314,9 @@
 	if (!mm_init(mm))
 		goto fail_nomem;
 
-	down(&oldmm->mmap_sem);
+	down_write(&oldmm->mmap_sem);
 	retval = dup_mmap(mm);
-	up(&oldmm->mmap_sem);
+	up_write(&oldmm->mmap_sem);
 
 	/*
 	 * Add it to the mmlist after the parent.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)