Lines Matching defs:aio
74 static int afalg_init_aio(afalg_aio *aio);
185 static int afalg_setup_async_event_notification(afalg_aio *aio)
201 &aio->efd, &custom);
207 aio->efd = eventfd(0);
208 if (aio->efd == -1) {
216 aio->efd, custom,
220 close(aio->efd);
224 if (fcntl(aio->efd, F_SETFL, O_NONBLOCK) != 0) {
229 aio->mode = MODE_ASYNC;
232 aio->efd = eventfd(0);
233 if (aio->efd == -1) {
239 aio->mode = MODE_SYNC;
244 static int afalg_init_aio(afalg_aio *aio)
249 aio->aio_ctx = 0;
250 r = io_setup(MAX_INFLIGHTS, &aio->aio_ctx);
257 memset(aio->cbt, 0, sizeof(aio->cbt));
258 aio->efd = -1;
259 aio->mode = MODE_UNINIT;
264 static int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
279 if (aio->mode == MODE_UNINIT) {
280 r = afalg_setup_async_event_notification(aio);
285 cb = &(aio->cbt[0 % MAX_INFLIGHTS]);
298 cb->aio_resfd = aio->efd;
304 r = io_read(aio->aio_ctx, 1, &cb);
315 r = read(aio->efd, &eval, sizeof(eval));
337 r = io_getevents(aio->aio_ctx, 1, MAX_INFLIGHTS,
350 r = io_read(aio->aio_ctx, 1, &cb);
607 if (afalg_init_aio(&actx->aio) == 0)
661 ret = afalg_fin_cipher_aio(&actx->aio, actx->sfd, out, inl);
696 if (actx->aio.mode == MODE_SYNC)
697 close(actx->aio.efd);
698 io_destroy(actx->aio.aio_ctx);