Lines Matching refs:sreq
75 static void skcipher_free_async_sgls(struct skcipher_async_req *sreq) in skcipher_free_async_sgls() argument
82 list_for_each_entry_safe(rsgl, tmp, &sreq->list, list) { in skcipher_free_async_sgls()
84 if (rsgl != &sreq->first_sgl) in skcipher_free_async_sgls()
87 sgl = sreq->tsg; in skcipher_free_async_sgls()
92 kfree(sreq->tsg); in skcipher_free_async_sgls()
97 struct skcipher_async_req *sreq = req->data; in skcipher_async_cb() local
98 struct kiocb *iocb = sreq->iocb; in skcipher_async_cb()
100 atomic_dec(sreq->inflight); in skcipher_async_cb()
101 skcipher_free_async_sgls(sreq); in skcipher_async_cb()
102 kzfree(sreq); in skcipher_async_cb()
511 struct skcipher_async_req *sreq; in skcipher_recvmsg_async() local
521 sreq = kzalloc(sizeof(*sreq) + reqsize + ivsize, GFP_KERNEL); in skcipher_recvmsg_async()
522 if (unlikely(!sreq)) in skcipher_recvmsg_async()
525 req = &sreq->req; in skcipher_recvmsg_async()
527 sreq->iocb = msg->msg_iocb; in skcipher_recvmsg_async()
528 INIT_LIST_HEAD(&sreq->list); in skcipher_recvmsg_async()
529 sreq->inflight = &ctx->inflight; in skcipher_recvmsg_async()
533 sreq->tsg = kcalloc(tx_nents, sizeof(*sg), GFP_KERNEL); in skcipher_recvmsg_async()
534 if (unlikely(!sreq->tsg)) in skcipher_recvmsg_async()
536 sg_init_table(sreq->tsg, tx_nents); in skcipher_recvmsg_async()
540 skcipher_async_cb, sreq); in skcipher_recvmsg_async()
574 sg_set_page(&tmp[x], sg_page(&sreq->tsg[x]), in skcipher_recvmsg_async()
575 sreq->tsg[x].length, in skcipher_recvmsg_async()
576 sreq->tsg[x].offset); in skcipher_recvmsg_async()
577 kfree(sreq->tsg); in skcipher_recvmsg_async()
578 sreq->tsg = tmp; in skcipher_recvmsg_async()
584 sg_set_page(sreq->tsg + txbufs++, sg_page(sg), sg->length, in skcipher_recvmsg_async()
587 if (list_empty(&sreq->list)) { in skcipher_recvmsg_async()
588 rsgl = &sreq->first_sgl; in skcipher_recvmsg_async()
589 list_add_tail(&rsgl->list, &sreq->list); in skcipher_recvmsg_async()
596 list_add_tail(&rsgl->list, &sreq->list); in skcipher_recvmsg_async()
613 sg_mark_end(sreq->tsg + txbufs - 1); in skcipher_recvmsg_async()
615 skcipher_request_set_crypt(req, sreq->tsg, sreq->first_sgl.sgl.sg, in skcipher_recvmsg_async()
622 sreq = NULL; in skcipher_recvmsg_async()
626 skcipher_free_async_sgls(sreq); in skcipher_recvmsg_async()
630 kzfree(sreq); in skcipher_recvmsg_async()