Page MenuHomeFreeBSD

D28158.diff
No OneTemporary

D28158.diff

diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -134,7 +134,6 @@
struct crypto_session {
struct cryptocap *cap;
- void *softc;
struct crypto_session_params csp;
};
@@ -201,7 +200,6 @@
#endif
static uma_zone_t cryptop_zone;
-static uma_zone_t cryptoses_zone;
int crypto_userasymcrypto = 1;
SYSCTL_INT(_kern_crypto, OID_AUTO, asym_enable, CTLFLAG_RW,
@@ -332,9 +330,6 @@
cryptop_zone = uma_zcreate("cryptop",
sizeof(struct cryptop), NULL, NULL, NULL, NULL,
UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
- cryptoses_zone = uma_zcreate("crypto_session",
- sizeof(struct crypto_session), NULL, NULL, NULL, NULL,
- UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
crypto_drivers_size = CRYPTO_DRIVERS_INITIAL;
crypto_drivers = malloc(crypto_drivers_size *
@@ -487,8 +482,6 @@
}
free(crypto_drivers, M_CRYPTO_DATA);
- if (cryptoses_zone != NULL)
- uma_zdestroy(cryptoses_zone);
if (cryptop_zone != NULL)
uma_zdestroy(cryptop_zone);
mtx_destroy(&crypto_q_mtx);
@@ -515,7 +508,7 @@
void *
crypto_get_driver_session(crypto_session_t crypto_session)
{
- return (crypto_session->softc);
+ return (crypto_session + 1);
}
const struct crypto_session_params *
@@ -895,8 +888,7 @@
cap = cses->cap;
- zfree(cses->softc, M_CRYPTO_DATA);
- uma_zfree(cryptoses_zone, cses);
+ zfree(cses, M_CRYPTO_DATA);
CRYPTO_DRIVER_LOCK();
cap->cc_sessions--;
@@ -948,10 +940,9 @@
cap->cc_sessions++;
CRYPTO_DRIVER_UNLOCK();
- res = uma_zalloc(cryptoses_zone, M_WAITOK | M_ZERO);
+ res = malloc(sizeof(*res) + cap->cc_session_size, M_CRYPTO_DATA,
+ M_WAITOK | M_ZERO);
res->cap = cap;
- res->softc = malloc(cap->cc_session_size, M_CRYPTO_DATA, M_WAITOK |
- M_ZERO);
res->csp = *csp;
/* Call the driver initialization routine. */

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 9:08 PM (7 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14633777
Default Alt Text
D28158.diff (1 KB)

Event Timeline