Lines Matching refs:fcr

392 cse_create(struct fcrypt *fcr, struct session2_op *sop)  in cse_create()  argument
684 mtx_lock(&fcr->lock); in cse_create()
685 TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); in cse_create()
686 cse->ses = fcr->sesn++; in cse_create()
687 mtx_unlock(&fcr->lock); in cse_create()
702 cse_find(struct fcrypt *fcr, u_int ses) in cse_find() argument
706 mtx_lock(&fcr->lock); in cse_find()
707 TAILQ_FOREACH(cse, &fcr->csessions, next) { in cse_find()
710 mtx_unlock(&fcr->lock); in cse_find()
714 mtx_unlock(&fcr->lock); in cse_find()
734 cse_delete(struct fcrypt *fcr, u_int ses) in cse_delete() argument
738 mtx_lock(&fcr->lock); in cse_delete()
739 TAILQ_FOREACH(cse, &fcr->csessions, next) { in cse_delete()
741 TAILQ_REMOVE(&fcr->csessions, cse, next); in cse_delete()
742 mtx_unlock(&fcr->lock); in cse_delete()
747 mtx_unlock(&fcr->lock); in cse_delete()
1349 struct fcrypt *fcr = data; in fcrypt_dtor() local
1352 while ((cse = TAILQ_FIRST(&fcr->csessions))) { in fcrypt_dtor()
1353 TAILQ_REMOVE(&fcr->csessions, cse, next); in fcrypt_dtor()
1359 mtx_destroy(&fcr->lock); in fcrypt_dtor()
1360 free(fcr, M_XDATA); in fcrypt_dtor()
1366 struct fcrypt *fcr; in crypto_open() local
1369 fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); in crypto_open()
1370 TAILQ_INIT(&fcr->csessions); in crypto_open()
1371 mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); in crypto_open()
1372 error = devfs_set_cdevpriv(fcr, fcrypt_dtor); in crypto_open()
1374 fcrypt_dtor(fcr); in crypto_open()
1383 struct fcrypt *fcr; in crypto_ioctl() local
1449 devfs_get_cdevpriv((void **)&fcr); in crypto_ioctl()
1475 error = cse_create(fcr, sop); in crypto_ioctl()
1481 if (!cse_delete(fcr, ses)) { in crypto_ioctl()
1488 cse = cse_find(fcr, cop->ses); in crypto_ioctl()
1541 cse = cse_find(fcr, caead->ses); in crypto_ioctl()