summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2008-10-24 00:08:44 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2008-10-24 00:08:44 +0000
commit60ec62448559336476e1059ea702385db2297770 (patch)
treedd19933df9378819da8beaa461227fba414b6d40
parenta589fbadefc286c5b9f79ad996596a1006bcdea3 (diff)
yet again i prove unable to commit what i really wanted. spotted by deraadt
-rw-r--r--sys/kern/subr_pool.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index fc01bd3e366..c168adfe9df 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.63 2008/10/23 23:54:02 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.64 2008/10/24 00:08:43 tedu Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -85,7 +85,6 @@ struct pool_item {
#endif
/* Other entries use only this list entry */
TAILQ_ENTRY(pool_item) pi_list;
- int pi_fillstart;
};
#define POOL_NEEDS_CATCHUP(pp) \
@@ -518,19 +517,6 @@ startover:
" item addr %p",
pp->pr_wchan, pi->pi_magic, ph->ph_page, pi);
}
- {
- int i, *ip = v;
-
- for (i = 0; i < pp->pr_size / sizeof(int); i++) {
- if (++ip < &pi->pi_fillstart)
- continue;
- if (*ip != PI_MAGIC) {
- panic("pool_do_get(%s): free list modified: magic=%x; page %p;"
- " item addr %p",
- pp->pr_wchan, *ip, ph->ph_page, pi);
- }
- }
- }
#endif
/*
@@ -636,6 +622,9 @@ pool_do_put(struct pool *pp, void *v)
* Return to item list.
*/
#ifdef DIAGNOSTIC
+ pi->pi_magic = PI_MAGIC;
+#endif
+#ifdef DEBUG
{
int i, *ip = v;
@@ -643,10 +632,9 @@ pool_do_put(struct pool *pp, void *v)
*ip++ = PI_MAGIC;
}
}
- pi->pi_magic = PI_MAGIC;
#endif
- TAILQ_INSERT_TAIL(&ph->ph_itemlist, pi, pi_list);
+ TAILQ_INSERT_HEAD(&ph->ph_itemlist, pi, pi_list);
ph->ph_nmissing--;
pp->pr_nitems++;
pp->pr_nout--;
@@ -792,13 +780,6 @@ pool_prime_page(struct pool *pp, caddr_t storage, struct pool_item_header *ph)
/* Insert on page list */
TAILQ_INSERT_TAIL(&ph->ph_itemlist, pi, pi_list);
#ifdef DIAGNOSTIC
- {
- int i, *ip = (int *)pi;
-
- for (i = 0; i < pp->pr_size / sizeof(int); i++) {
- *ip++ = PI_MAGIC;
- }
- }
pi->pi_magic = PI_MAGIC;
#endif
cp = (caddr_t)(cp + pp->pr_size);