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
This commit is contained in:
John Baldwin 2020-11-05 23:42:36 +00:00
parent 195105254f
commit c54004c6a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367407

View File

@ -904,8 +904,6 @@ cryptof_ioctl(struct file *fp, u_long cmd, void *data,
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)
{
@ -935,6 +933,23 @@ cod_free(struct cryptop_data *cod)
free(cod, M_XDATA);
}
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 @@ cryptodev_aead(struct csession *cse, struct crypt_aead *caead,
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)
{