diff options
author | eivind <eivind@FreeBSD.org> | 1999-01-10 01:58:29 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1999-01-10 01:58:29 +0000 |
commit | 89e11995349cb9c2dab945decdcca7c775b1da23 (patch) | |
tree | cbf327b4157cdef7815c3325d5228ee8a2401bb7 /sys/vm | |
parent | 541b200a907df9730d6c52f272bc2eb5385c41fe (diff) | |
download | FreeBSD-src-89e11995349cb9c2dab945decdcca7c775b1da23.zip FreeBSD-src-89e11995349cb9c2dab945decdcca7c775b1da23.tar.gz |
KNFize, by bde.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 6 | ||||
-rw-r--r-- | sys/vm/vm_fault.c | 3 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 14 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_zone.c | 10 | ||||
-rw-r--r-- | sys/vm/vm_zone.h | 12 |
6 files changed, 27 insertions, 28 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index dff0490..1691168 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.105 1998/12/29 22:53:51 dt Exp $ + * $Id: swap_pager.c,v 1.106 1999/01/08 17:31:23 eivind Exp $ */ /* @@ -1297,7 +1297,7 @@ swap_pager_putpages(object, m, count, sync, rtvals) swb[i]->swb_locked--; } -#if defined(INVARIANTS) +#ifdef INVARIANTS for (i = firstidx; i < lastidx; i++) { if (reqaddr[i] == SWB_EMPTY) { printf("I/O to empty block???? -- pindex: %d, i: %d\n", @@ -1348,7 +1348,7 @@ swap_pager_putpages(object, m, count, sync, rtvals) } spc = TAILQ_FIRST(&swap_pager_free); - KASSERT(spc, + KASSERT(spc != NULL, ("swap_pager_putpages: free queue is empty, %d expected\n", swap_pager_free_count)); TAILQ_REMOVE(&swap_pager_free, spc, spc_list); diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index f1456b6..e3d64f9 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -66,7 +66,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_fault.c,v 1.91 1998/11/25 07:40:49 dg Exp $ + * $Id: vm_fault.c,v 1.92 1999/01/08 17:31:24 eivind Exp $ */ /* @@ -527,7 +527,6 @@ readrest: vm_object_pip_add(fs.object, 1); } } - KASSERT((fs.m->flags & PG_BUSY) != 0, ("vm_fault: not busy after main loop")); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index a00e995..a1477f2 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.136 1999/01/02 11:34:57 bde Exp $ + * $Id: vm_object.c,v 1.137 1999/01/08 17:31:26 eivind Exp $ */ /* @@ -243,7 +243,7 @@ vm_object_reference(object) return; KASSERT(!(object->flags & OBJ_DEAD), - ("vm_object_reference: attempting to reference dead obj")); + ("vm_object_reference: attempting to reference dead obj")); object->ref_count++; if (object->type == OBJT_VNODE) { @@ -260,10 +260,11 @@ vm_object_vndeallocate(object) vm_object_t object; { struct vnode *vp = (struct vnode *) object->handle; + KASSERT(object->type == OBJT_VNODE, - ("vm_object_vndeallocate: not a vnode object")); - KASSERT(vp, ("vm_object_vndeallocate: missing vp")); -#if defined(INVARIANTS) + ("vm_object_vndeallocate: not a vnode object")); + KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); +#ifdef INVARIANTS if (object->ref_count == 0) { vprint("vm_object_vndeallocate", vp); panic("vm_object_vndeallocate: bad object reference count"); @@ -326,8 +327,7 @@ vm_object_deallocate(object) robject = TAILQ_FIRST(&object->shadow_head); KASSERT(robject != NULL, - ("vm_object_deallocate: ref_count: %d," - " shadow_count: %d", + ("vm_object_deallocate: ref_count: %d, shadow_count: %d", object->ref_count, object->shadow_count)); if ((robject->handle == NULL) && diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 08bfc60..c953559 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_page.c,v 1.114 1998/12/23 01:52:47 dillon Exp $ + * $Id: vm_page.c,v 1.115 1999/01/08 17:31:27 eivind Exp $ */ /* @@ -884,7 +884,7 @@ vm_page_alloc(object, pindex, page_req) case VM_ALLOC_NORMAL: if (cnt.v_free_count >= cnt.v_free_reserved) { m = vm_page_select_free(object, pindex, PQ_FREE); - KASSERT(m, ("vm_page_alloc(NORMAL): missing page on free queue\n")); + KASSERT(m != NULL, ("vm_page_alloc(NORMAL): missing page on free queue\n")); } else { m = vm_page_select_cache(object, pindex); if (m == NULL) { @@ -903,7 +903,7 @@ vm_page_alloc(object, pindex, page_req) case VM_ALLOC_ZERO: if (cnt.v_free_count >= cnt.v_free_reserved) { m = vm_page_select_free(object, pindex, PQ_ZERO); - KASSERT(m, ("vm_page_alloc(ZERO): missing page on free queue\n")); + KASSERT(m != NULL, ("vm_page_alloc(ZERO): missing page on free queue\n")); } else { m = vm_page_select_cache(object, pindex); if (m == NULL) { @@ -924,7 +924,7 @@ vm_page_alloc(object, pindex, page_req) ((cnt.v_cache_count == 0) && (cnt.v_free_count >= cnt.v_interrupt_free_min))) { m = vm_page_select_free(object, pindex, PQ_FREE); - KASSERT(m, ("vm_page_alloc(SYSTEM): missing page on free queue\n")); + KASSERT(m != NULL, ("vm_page_alloc(SYSTEM): missing page on free queue\n")); } else { m = vm_page_select_cache(object, pindex); if (m == NULL) { @@ -943,7 +943,7 @@ vm_page_alloc(object, pindex, page_req) case VM_ALLOC_INTERRUPT: if (cnt.v_free_count > 0) { m = vm_page_select_free(object, pindex, PQ_FREE); - KASSERT(m, ("vm_page_alloc(INTERRUPT): missing page on free queue\n")); + KASSERT(m != NULL, ("vm_page_alloc(INTERRUPT): missing page on free queue\n")); } else { splx(s); vm_pageout_deficit++; diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index d90784e..0d684a7 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -11,7 +11,7 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vm_zone.c,v 1.24 1998/12/04 22:54:57 archie Exp $ + * $Id: vm_zone.c,v 1.25 1999/01/08 17:31:29 eivind Exp $ */ #include <sys/param.h> @@ -194,7 +194,7 @@ zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems) z->zitems = NULL; for (i = 0; i < nitems; i++) { ((void **) item)[0] = z->zitems; -#if defined(INVARIANTS) +#ifdef INVARIANTS ((void **) item)[1] = (void *) ZENTRY_FREE; #endif z->zitems = item; @@ -357,7 +357,7 @@ _zget(vm_zone_t z) nitems -= 1; for (i = 0; i < nitems; i++) { ((void **) item)[0] = z->zitems; -#if defined(INVARIANTS) +#ifdef INVARIANTS ((void **) item)[1] = (void *) ZENTRY_FREE; #endif z->zitems = item; @@ -367,7 +367,7 @@ _zget(vm_zone_t z) } else if (z->zfreecnt > 0) { item = z->zitems; z->zitems = ((void **) item)[0]; -#if defined(INVARIANTS) +#ifdef INVARIANTS if (((void **) item)[1] != (void *) ZENTRY_FREE) zerror(ZONE_ERROR_NOTFREE); ((void **) item)[1] = 0; @@ -432,7 +432,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS return (0); } -#if defined(INVARIANT_SUPPORT) +#ifdef INVARIANT_SUPPORT void zerror(int error) { diff --git a/sys/vm/vm_zone.h b/sys/vm/vm_zone.h index 6b322f5..8fe91d1 100644 --- a/sys/vm/vm_zone.h +++ b/sys/vm/vm_zone.h @@ -11,10 +11,10 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vm_zone.h,v 1.10 1998/04/25 04:50:03 dyson Exp $ + * $Id: vm_zone.h,v 1.11 1999/01/08 17:31:30 eivind Exp $ */ -#if !defined(_SYS_ZONE_H) +#ifndef _SYS_ZONE_H #define _SYS_ZONE_H @@ -76,7 +76,7 @@ _zalloc(vm_zone_t z) { void *item; -#if defined(INVARIANTS) +#ifdef INVARIANTS if (z == 0) zerror(ZONE_ERROR_INVALID); #endif @@ -86,7 +86,7 @@ _zalloc(vm_zone_t z) item = z->zitems; z->zitems = ((void **) item)[0]; -#if defined(INVARIANTS) +#ifdef INVARIANTS if (((void **) item)[1] != (void *) ZENTRY_FREE) zerror(ZONE_ERROR_NOTFREE); ((void **) item)[1] = 0; @@ -101,7 +101,7 @@ static __inline__ void _zfree(vm_zone_t z, void *item) { ((void **) item)[0] = z->zitems; -#if defined(INVARIANTS) +#ifdef INVARIANTS if (((void **) item)[1] == (void *) ZENTRY_FREE) zerror(ZONE_ERROR_ALREADYFREE); ((void **) item)[1] = (void *) ZENTRY_FREE; @@ -123,7 +123,7 @@ zalloc(vm_zone_t z) static __inline__ void zfree(vm_zone_t z, void *item) { -#if defined(SMP) +#ifdef SMP zfreei(z, item); #else _zfree(z, item); |