summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-26 23:41:30 +0000
committeralc <alc@FreeBSD.org>2003-04-26 23:41:30 +0000
commitd5ac0bc4531af5962cb46af2eb16a5cc61170717 (patch)
tree11a9410352928b09ef46b7118b63f16df5ca8758 /sys/vm
parentbc99b2572b0aae9e440f677dca4bf1754ca40133 (diff)
downloadFreeBSD-src-d5ac0bc4531af5962cb46af2eb16a5cc61170717.zip
FreeBSD-src-d5ac0bc4531af5962cb46af2eb16a5cc61170717.tar.gz
Various changes to vm_object_page_remove():
- Eliminate an odd, special-case feature: if start == end == 0 then all pages are removed. Only one caller used this feature and that caller can trivially pass the object's size. - Assert that the vm_object is locked on entry; don't bother testing for a NULL vm_object. - Style: Fix lines that are longer than 80 characters.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 77c50de..087ef98 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1674,22 +1674,22 @@ vm_object_collapse(vm_object_t object)
* The object must be locked.
*/
void
-vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, boolean_t clean_only)
+vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
+ boolean_t clean_only)
{
vm_page_t p, next;
- int all;
- if (object == NULL ||
- object->resident_page_count == 0)
+ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+ if (object->resident_page_count == 0)
return;
- all = ((end == 0) && (start == 0));
/*
* Since physically-backed objects do not use managed pages, we can't
* remove pages from the object (we must instead remove the page
* references, and then destroy the object).
*/
- KASSERT(object->type != OBJT_PHYS, ("attempt to remove pages from a physical object"));
+ KASSERT(object->type != OBJT_PHYS,
+ ("attempt to remove pages from a physical object"));
vm_object_pip_add(object, 1);
again:
@@ -1707,7 +1707,7 @@ again:
* or (2) NULL.
*/
for (;
- p != NULL && (all || p->pindex < end);
+ p != NULL && p->pindex < end;
p = next) {
next = TAILQ_NEXT(p, listq);
OpenPOWER on IntegriCloud