add some KASSERTs.

This commit is contained in:
yamt 2008-08-11 02:46:40 +00:00
parent ae231875d3
commit 53d1c25e34
1 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_pool.c,v 1.167 2008/08/08 16:58:01 skrll Exp $ */
/* $NetBSD: subr_pool.c,v 1.168 2008/08/11 02:46:40 yamt Exp $ */
/*-
* Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.167 2008/08/08 16:58:01 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.168 2008/08/11 02:46:40 yamt Exp $");
#include "opt_ddb.h"
#include "opt_pool.h"
@ -1527,6 +1527,8 @@ pool_update_curpage(struct pool *pp)
if (pp->pr_curpage == NULL) {
pp->pr_curpage = LIST_FIRST(&pp->pr_emptypages);
}
KASSERT((pp->pr_curpage == NULL && pp->pr_nitems == 0) ||
(pp->pr_curpage != NULL && pp->pr_nitems > 0));
}
void
@ -2367,6 +2369,9 @@ pool_cache_get_slow(pool_cache_cpu_t *cc, int s, void **objectp,
pool_cache_t pc;
void *object;
KASSERT(cc->cc_current->pcg_avail == 0);
KASSERT(cc->cc_previous->pcg_avail == 0);
pc = cc->cc_cache;
cc->cc_misses++;
@ -2519,6 +2524,9 @@ pool_cache_put_slow(pool_cache_cpu_t *cc, int s, void *object)
uint64_t ncsw;
pool_cache_t pc;
KASSERT(cc->cc_current->pcg_avail == cc->cc_current->pcg_size);
KASSERT(cc->cc_previous->pcg_avail == cc->cc_previous->pcg_size);
pc = cc->cc_cache;
cc->cc_misses++;