diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2010-08-08 04:10:50 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2010-08-08 04:10:50 +0000 |
commit | 33eadfed71c3cf29f3e93c6b8f3b285a24f8e435 (patch) | |
tree | 7ad88f4a3442a0970ac3f6134bd5f32be967458c | |
parent | 990234a5ff75467ba2607094711c94242607ec29 (diff) |
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@
-rw-r--r-- | sys/crypto/crypto.c | 17 |
1 files changed, 11 insertions, 6 deletions
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); } |