diff options
author | Iuliana Prodan <iuliana.prodan@nxp.com> | 2020-04-28 17:49:03 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-05-08 07:30:40 +0200 |
commit | ec6e2bf33b54cc3351bd702452e5d016b8f9d2f4 (patch) | |
tree | 66e745497119d160bcbcbaadf806f8515e72f223 /crypto | |
parent | hwrng: cctrng - update help description (diff) | |
download | linux-ec6e2bf33b54cc3351bd702452e5d016b8f9d2f4.tar.xz linux-ec6e2bf33b54cc3351bd702452e5d016b8f9d2f4.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>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/algapi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index f1e6ccaff853..92abdf675992 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; |