diff options
author | John Baldwin <jhb@FreeBSD.org> | 2020-11-05 23:42:36 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2020-11-05 23:42:36 +0000 |
commit | c54004c6a949c0b938634105ce7e33b5f92be3c9 (patch) | |
tree | 5684b1e7aee1c23a95ed408728696984239fdbb6 | |
parent | 195105254f3c76fb3304529f3be7311ad66989dd (diff) | |
download | src-test2-c54004c6a949c0b938634105ce7e33b5f92be3c9.tar.gz src-test2-c54004c6a949c0b938634105ce7e33b5f92be3c9.zip |
Notes
-rw-r--r-- | sys/opencrypto/cryptodev.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index fcbe5130033a..86da8450230a 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -904,8 +904,6 @@ bail: return (error); } -static int cryptodev_cb(struct cryptop *); - static struct cryptop_data * cod_alloc(struct csession *cse, size_t aad_len, size_t len, struct thread *td) { @@ -936,6 +934,23 @@ cod_free(struct cryptop_data *cod) } static int +cryptodev_cb(struct cryptop *crp) +{ + struct cryptop_data *cod = crp->crp_opaque; + + /* + * Lock to ensure the wakeup() is not missed by the loops + * waiting on cod->done in cryptodev_op() and + * cryptodev_aead(). + */ + mtx_lock(&cod->cse->lock); + cod->done = true; + mtx_unlock(&cod->cse->lock); + wakeup(cod); + return (0); +} + +static int cryptodev_op(struct csession *cse, const struct crypt_op *cop, struct ucred *active_cred, struct thread *td) { @@ -1340,23 +1355,6 @@ bail: return (error); } -static int -cryptodev_cb(struct cryptop *crp) -{ - struct cryptop_data *cod = crp->crp_opaque; - - /* - * Lock to ensure the wakeup() is not missed by the loops - * waiting on cod->done in cryptodev_op() and - * cryptodev_aead(). - */ - mtx_lock(&cod->cse->lock); - cod->done = true; - mtx_unlock(&cod->cse->lock); - wakeup(cod); - return (0); -} - static void cryptodevkey_cb(struct cryptkop *krp) { |