summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-05-31 17:11:15 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-05-31 17:11:15 +0000
commite7efeba3453124e29efa6e347ad74898bd0b4ccd (patch)
tree2667db6ff2bc2b3ee653673ef45af553b8f7769f
parentd978db156467c4c8858947d5112c464eb42baf33 (diff)
Move splassert checks from pool_do_get to pool_get(). Since the former
is invoked with the pool mutex held, the asserts are satisfied by design. ok tedu@
-rw-r--r--sys/kern/subr_pool.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 28428f41c54..de08f385b4b 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.79 2009/04/22 01:16:11 dlg Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.80 2009/05/31 17:11:14 miod Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -449,6 +449,11 @@ pool_get(struct pool *pp, int flags)
{
void *v;
+#ifdef DIAGNOSTIC
+ if ((flags & PR_WAITOK) != 0)
+ splassert(IPL_NONE);
+#endif /* DIAGNOSTIC */
+
mtx_enter(&pp->pr_mtx);
v = pool_do_get(pp, flags);
mtx_leave(&pp->pr_mtx);
@@ -477,13 +482,6 @@ pool_do_get(struct pool *pp, int flags)
int i, *ip;
#endif
-#ifdef DIAGNOSTIC
- if ((flags & PR_WAITOK) != 0)
- splassert(IPL_NONE);
- if (pp->pr_ipl != -1)
- splassert(pp->pr_ipl);
-#endif /* DIAGNOSTIC */
-
#ifdef MALLOC_DEBUG
if (pp->pr_roflags & PR_DEBUG) {
void *addr;