patch-2.4.3 linux/arch/mips/kernel/sysirix.c

Next file: linux/arch/mips/mm/fault.c
Previous file: linux/arch/mips/kernel/syscall.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c
@@ -472,7 +472,7 @@
 		if (retval)
 			return retval;
 
-		down(&mm->mmap_sem);
+		down_read(&mm->mmap_sem);
 		pgdp = pgd_offset(mm, addr);
 		pmdp = pmd_offset(pgdp, addr);
 		ptep = pte_offset(pmdp, addr);
@@ -485,7 +485,7 @@
 				                   PAGE_SHIFT, pageno);
 			}
 		}
-		up(&mm->mmap_sem);
+		up_read(&mm->mmap_sem);
 		break;
 	}
 
@@ -535,7 +535,7 @@
 	struct mm_struct *mm = current->mm;
 	int ret;
 
-	down(&mm->mmap_sem);
+	down_write(&mm->mmap_sem);
 	if (brk < mm->end_code) {
 		ret = -ENOMEM;
 		goto out;
@@ -593,7 +593,7 @@
 	ret = 0;
 
 out:
-	up(&mm->mmap_sem);
+	up_write(&mm->mmap_sem);
 	return ret;
 }
 
@@ -1083,9 +1083,9 @@
 
 	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 
-	down(&current->mm->mmap_sem);
+	down_write(&current->mm->mmap_sem);
 	retval = do_mmap(file, addr, len, prot, flags, offset);
-	up(&current->mm->mmap_sem);
+	up_write(&current->mm->mmap_sem);
 	if (file)
 		fput(file);
 
@@ -1643,9 +1643,9 @@
 
 	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 
-	down(&current->mm->mmap_sem);
+	down_write(&current->mm->mmap_sem);
 	error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
-	up(&current->mm->mmap_sem);
+	up_write(&current->mm->mmap_sem);
 
 	if (file)
 		fput(file);

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