From 33eadfed71c3cf29f3e93c6b8f3b285a24f8e435 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sun, 8 Aug 2010 04:10:50 +0000 Subject: Backout r1.55 since this breaks anything which does crypto ops prior to init_crypto() being called from late in init_main(). In particular, this breaks softraid crypto volumes that are assembled at boot. No cookies for thib/mikeb! "Back it out, right now" deraadt@ --- sys/crypto/crypto.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/crypto') diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index e34936c5bc4..e964768b6dc 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.56 2010/07/08 09:46:50 thib Exp $ */ +/* $OpenBSD: crypto.c,v 1.57 2010/08/08 04:10:49 jsing Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -35,6 +35,7 @@ int crypto_drivers_num = 0; struct pool cryptop_pool; struct pool cryptodesc_pool; +int crypto_pool_initialized = 0; struct workq *crypto_workq; @@ -592,6 +593,14 @@ crypto_getreq(int num) s = splvm(); + if (crypto_pool_initialized == 0) { + pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0, + 0, "cryptop", NULL); + pool_init(&cryptodesc_pool, sizeof(struct cryptodesc), 0, 0, + 0, "cryptodesc", NULL); + crypto_pool_initialized = 1; + } + crp = pool_get(&cryptop_pool, PR_NOWAIT); if (crp == NULL) { splx(s); @@ -617,12 +626,8 @@ crypto_getreq(int num) } void -init_crypto(void) +init_crypto() { - pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0, 0, - "cryptop", NULL); - pool_init(&cryptodesc_pool, sizeof(struct cryptodesc), 0, 0, 0, - "cryptodesc", NULL); crypto_workq = workq_create("crypto", 1, IPL_HIGH); } -- cgit v1.2.3