patch-2.4.3 linux/mm/mlock.c
Next file: linux/mm/mmap.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index
-  Lines: 61
-  Date:
Mon Mar 19 12:35:08 2001
-  Orig file: 
v2.4.2/linux/mm/mlock.c
-  Orig date: 
Fri Dec 29 14:07:24 2000
diff -u --recursive --new-file v2.4.2/linux/mm/mlock.c linux/mm/mlock.c
@@ -198,7 +198,7 @@
 	unsigned long lock_limit;
 	int error = -ENOMEM;
 
-	down(¤t->mm->mmap_sem);
+	down_write(¤t->mm->mmap_sem);
 	len = PAGE_ALIGN(len + (start & ~PAGE_MASK));
 	start &= PAGE_MASK;
 
@@ -219,7 +219,7 @@
 
 	error = do_mlock(start, len, 1);
 out:
-	up(¤t->mm->mmap_sem);
+	up_write(¤t->mm->mmap_sem);
 	return error;
 }
 
@@ -227,11 +227,11 @@
 {
 	int ret;
 
-	down(¤t->mm->mmap_sem);
+	down_write(¤t->mm->mmap_sem);
 	len = PAGE_ALIGN(len + (start & ~PAGE_MASK));
 	start &= PAGE_MASK;
 	ret = do_mlock(start, len, 0);
-	up(¤t->mm->mmap_sem);
+	up_write(¤t->mm->mmap_sem);
 	return ret;
 }
 
@@ -268,7 +268,7 @@
 	unsigned long lock_limit;
 	int ret = -EINVAL;
 
-	down(¤t->mm->mmap_sem);
+	down_write(¤t->mm->mmap_sem);
 	if (!flags || (flags & ~(MCL_CURRENT | MCL_FUTURE)))
 		goto out;
 
@@ -286,7 +286,7 @@
 
 	ret = do_mlockall(flags);
 out:
-	up(¤t->mm->mmap_sem);
+	up_write(¤t->mm->mmap_sem);
 	return ret;
 }
 
@@ -294,8 +294,8 @@
 {
 	int ret;
 
-	down(¤t->mm->mmap_sem);
+	down_write(¤t->mm->mmap_sem);
 	ret = do_mlockall(0);
-	up(¤t->mm->mmap_sem);
+	up_write(¤t->mm->mmap_sem);
 	return ret;
 }
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)