summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIuliana Prodan <iuliana.prodan@nxp.com>2020-04-28 18:49:03 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 15:30:40 +1000
commite54990733f49b0e779f6be53047009370182907f (patch)
tree8c727bee13e9bb750c4aa2a0de41d21f007124e7
parent7baaaeb714b393b275c80633585ab0455fd8e649 (diff)
downloadlinux-crypto-e54990733f49b0e779f6be53047009370182907f.tar.gz
linux-crypto-e54990733f49b0e779f6be53047009370182907f.zip
crypto: algapi - create function to add request in front of queue
Add crypto_enqueue_request_head function that enqueues a request in front of queue. This will be used in crypto-engine, on error path. In case a request was not executed by hardware, enqueue it back in front of queue (to keep the order of requests). Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/algapi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index f1e6ccaf..92abdf67 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -914,6 +914,14 @@ out:
}
EXPORT_SYMBOL_GPL(crypto_enqueue_request);
+void crypto_enqueue_request_head(struct crypto_queue *queue,
+ struct crypto_async_request *request)
+{
+ queue->qlen++;
+ list_add(&request->list, &queue->list);
+}
+EXPORT_SYMBOL_GPL(crypto_enqueue_request_head);
+
struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue)
{
struct list_head *request;