Date: Thu, 5 Nov 2020 23:42:36 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367407 - head/sys/opencrypto Message-ID: <202011052342.0A5Ngauw056203@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Thu Nov 5 23:42:36 2020 New Revision: 367407 URL: https://svnweb.freebsd.org/changeset/base/367407 Log: Move cryptodev_cb earlier before it is used. This is consistent with cryptodevkey_cb being defined before it is used and removes a prototype in the middle of the file. Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27067 Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Nov 5 23:31:58 2020 (r367406) +++ head/sys/opencrypto/cryptodev.c Thu Nov 5 23:42:36 2020 (r367407) @@ -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) { @@ -1338,23 +1353,6 @@ bail: cod_free(cod); 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011052342.0A5Ngauw056203>