summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-03-16 21:38:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-03-16 21:38:36 +0000
commit42e7035f384b19ff8a9806581e26238550014f1c (patch)
tree1f31839b550ed7d5391311cdb782ac7da9e85899
parent9b078d43a64bd7278ccd3f74ebe462507851d598 (diff)
In sys_mincore(), pass a size in bytes, not pages, to uvm_vslock() and
uvm_vsunlock(). ok mickey@
-rw-r--r--sys/uvm/uvm_mmap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index eb143f03293..98c4bd83c10 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.57 2005/06/01 18:34:40 tedu Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.58 2006/03/16 21:38:35 miod Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -238,7 +238,7 @@ sys_mincore(p, v, retval)
vaddr_t start, end, lim;
vm_map_t map;
vsize_t len;
- int error = 0, npgs;
+ int error = 0;
map = &p->p_vmspace->vm_map;
@@ -253,13 +253,11 @@ sys_mincore(p, v, retval)
if (end <= start)
return (EINVAL);
- npgs = len >> PAGE_SHIFT;
-
/*
* Lock down vec, so our returned status isn't outdated by
* storing the status byte for a page.
*/
- if ((error = uvm_vslock(p, vec, npgs, VM_PROT_WRITE)) != 0)
+ if ((error = uvm_vslock(p, vec, len, VM_PROT_WRITE)) != 0)
return (error);
vm_map_lock_read(map);
@@ -349,7 +347,7 @@ sys_mincore(p, v, retval)
out:
vm_map_unlock_read(map);
- uvm_vsunlock(p, SCARG(uap, vec), npgs);
+ uvm_vsunlock(p, SCARG(uap, vec), len);
return (error);
}