diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-23 00:15:10 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-23 00:15:10 +0000 |
commit | e57546c26868d94f12277bdb2f95fb0ac8d7cc96 (patch) | |
tree | d9eaf89f8205ac5f5ff2d71ff3926182c303af44 /sys | |
parent | b3ea3f534e980d62689e9cd04f3f93a5d5d36bd9 (diff) |
pools lock themselves now, we just have to tell them what IPL they
will be used from.
this adds pool_setipl at IPL_VM to the crypto descriptor pools, and
removes all the splvm handling around the use of those pools.
tested by many via tech@
ok kettenis@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/crypto/crypto.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index 0f98c014370..de2840a1ed3 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.71 2014/10/23 00:11:48 dlg Exp $ */ +/* $OpenBSD: crypto.c,v 1.72 2014/10/23 00:15:09 dlg Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -453,20 +453,16 @@ void crypto_freereq(struct cryptop *crp) { struct cryptodesc *crd; - int s; if (crp == NULL) return; - s = splvm(); - while ((crd = crp->crp_desc) != NULL) { crp->crp_desc = crd->crd_next; pool_put(&cryptodesc_pool, crd); } pool_put(&cryptop_pool, crp); - splx(s); } /* @@ -477,20 +473,14 @@ crypto_getreq(int num) { struct cryptodesc *crd; struct cryptop *crp; - int s; - s = splvm(); - crp = pool_get(&cryptop_pool, PR_NOWAIT | PR_ZERO); - if (crp == NULL) { - splx(s); + if (crp == NULL) return NULL; - } while (num--) { crd = pool_get(&cryptodesc_pool, PR_NOWAIT | PR_ZERO); if (crd == NULL) { - splx(s); crypto_freereq(crp); return NULL; } @@ -499,7 +489,6 @@ crypto_getreq(int num) crp->crp_desc = crd; } - splx(s); return crp; } @@ -510,8 +499,10 @@ crypto_init(void) pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0, 0, "cryptop", NULL); + pool_setipl(&cryptop_pool, IPL_VM); pool_init(&cryptodesc_pool, sizeof(struct cryptodesc), 0, 0, 0, "cryptodesc", NULL); + pool_setipl(&cryptodesc_pool, IPL_VM); } /* |