mm: only drain per-cpu pagevecs once per pagevec usage
[linux-2.6-microblaze.git] / crypto / api.c
index 941cd4c..2a2479d 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/sched/signal.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/completion.h>
 #include "internal.h"
 
 LIST_HEAD(crypto_alg_list);
@@ -595,5 +596,17 @@ int crypto_has_alg(const char *name, u32 type, u32 mask)
 }
 EXPORT_SYMBOL_GPL(crypto_has_alg);
 
+void crypto_req_done(struct crypto_async_request *req, int err)
+{
+       struct crypto_wait *wait = req->data;
+
+       if (err == -EINPROGRESS)
+               return;
+
+       wait->err = err;
+       complete(&wait->completion);
+}
+EXPORT_SYMBOL_GPL(crypto_req_done);
+
 MODULE_DESCRIPTION("Cryptographic core API");
 MODULE_LICENSE("GPL");