summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-04-13 11:15:40 +0000
committeralfred <alfred@FreeBSD.org>2001-04-13 11:15:40 +0000
commit7e6ce027ecf8060fa51ec90851742266d9103965 (patch)
tree18f017c61f5d35f9d238e241c901bbc9f71873b5 /sys/vm/vm_object.c
parent3bdd87f1b96212b8e535042a0a730ba8a7b0c4de (diff)
downloadFreeBSD-src-7e6ce027ecf8060fa51ec90851742266d9103965.zip
FreeBSD-src-7e6ce027ecf8060fa51ec90851742266d9103965.tar.gz
if/panic -> KASSERT
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 780b2c6..dc1eb57 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -423,8 +423,9 @@ vm_object_terminate(object)
vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0);
}
- if (object->ref_count != 0)
- panic("vm_object_terminate: object with references, ref_count=%d", object->ref_count);
+ KASSERT(object->ref_count == 0,
+ ("vm_object_terminate: object with references, ref_count=%d",
+ object->ref_count));
/*
* Now free any remaining pages. For internal objects, this also
@@ -433,8 +434,9 @@ vm_object_terminate(object)
*/
s = splvm();
while ((p = TAILQ_FIRST(&object->memq)) != NULL) {
- if (p->busy || (p->flags & PG_BUSY))
- panic("vm_object_terminate: freeing busy page %p\n", p);
+ KASSERT(!p->busy && (p->flags & PG_BUSY) == 0,
+ ("vm_object_terminate: freeing busy page %p "
+ "p->busy = %d, p->flags %x\n", p, p->busy, p->flags));
if (p->wire_count == 0) {
vm_page_busy(p);
vm_page_free(p);
@@ -910,9 +912,8 @@ vm_object_shadow(object, offset, length)
/*
* Allocate a new object with the given length
*/
-
- if ((result = vm_object_allocate(OBJT_DEFAULT, length)) == NULL)
- panic("vm_object_shadow: no object for shadowing");
+ result = vm_object_allocate(OBJT_DEFAULT, length);
+ KASSERT(result != NULL, ("vm_object_shadow: no object for shadowing"));
/*
* The new object shadows the source object, adding a reference to it.
OpenPOWER on IntegriCloud