Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1726672
| From | Gilad Ben-Yossef <gilad@benyossef.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v8 04/20] crypto: remove redundant backlog checks on EBUSY |
| Date | 2017-09-05 14:50 +0200 |
| Message-ID | <umlsJ-2FV-5@gated-at.bofh.it> (permalink) |
| References | <umlj3-2Cy-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Now that -EBUSY return code only indicates backlog queueing we can safely remove the now redundant check for the CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> --- crypto/ahash.c | 12 +++--------- crypto/cts.c | 6 ++---- crypto/lrw.c | 8 ++------ crypto/rsa-pkcs1pad.c | 16 ++++------------ crypto/xts.c | 8 ++------ 5 files changed, 13 insertions(+), 37 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index 5e8666e..3a35d67 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -334,9 +334,7 @@ static int ahash_op_unaligned(struct ahash_request *req, return err; err = op(req); - if (err == -EINPROGRESS || - (err == -EBUSY && (ahash_request_flags(req) & - CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err == -EINPROGRESS || err == -EBUSY) return err; ahash_restore_req(req, err); @@ -394,9 +392,7 @@ static int ahash_def_finup_finish1(struct ahash_request *req, int err) req->base.complete = ahash_def_finup_done2; err = crypto_ahash_reqtfm(req)->final(req); - if (err == -EINPROGRESS || - (err == -EBUSY && (ahash_request_flags(req) & - CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err == -EINPROGRESS || err == -EBUSY) return err; out: @@ -432,9 +428,7 @@ static int ahash_def_finup(struct ahash_request *req) return err; err = tfm->update(req); - if (err == -EINPROGRESS || - (err == -EBUSY && (ahash_request_flags(req) & - CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err == -EINPROGRESS || err == -EBUSY) return err; return ahash_def_finup_finish1(req, err); diff --git a/crypto/cts.c b/crypto/cts.c index 243f591..4773c18 100644 --- a/crypto/cts.c +++ b/crypto/cts.c @@ -136,8 +136,7 @@ static void crypto_cts_encrypt_done(struct crypto_async_request *areq, int err) goto out; err = cts_cbc_encrypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return; out: @@ -229,8 +228,7 @@ static void crypto_cts_decrypt_done(struct crypto_async_request *areq, int err) goto out; err = cts_cbc_decrypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return; out: diff --git a/crypto/lrw.c b/crypto/lrw.c index a8bfae4..695cea9 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -328,9 +328,7 @@ static int do_encrypt(struct skcipher_request *req, int err) crypto_skcipher_encrypt(subreq) ?: post_crypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && - req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return err; } @@ -380,9 +378,7 @@ static int do_decrypt(struct skcipher_request *req, int err) crypto_skcipher_decrypt(subreq) ?: post_crypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && - req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return err; } diff --git a/crypto/rsa-pkcs1pad.c b/crypto/rsa-pkcs1pad.c index 407c64b..2908f93 100644 --- a/crypto/rsa-pkcs1pad.c +++ b/crypto/rsa-pkcs1pad.c @@ -279,9 +279,7 @@ static int pkcs1pad_encrypt(struct akcipher_request *req) req->dst, ctx->key_size - 1, req->dst_len); err = crypto_akcipher_encrypt(&req_ctx->child_req); - if (err != -EINPROGRESS && - (err != -EBUSY || - !(req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err != -EINPROGRESS && err != -EBUSY) return pkcs1pad_encrypt_sign_complete(req, err); return err; @@ -383,9 +381,7 @@ static int pkcs1pad_decrypt(struct akcipher_request *req) ctx->key_size); err = crypto_akcipher_decrypt(&req_ctx->child_req); - if (err != -EINPROGRESS && - (err != -EBUSY || - !(req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err != -EINPROGRESS && err != -EBUSY) return pkcs1pad_decrypt_complete(req, err); return err; @@ -440,9 +436,7 @@ static int pkcs1pad_sign(struct akcipher_request *req) req->dst, ctx->key_size - 1, req->dst_len); err = crypto_akcipher_sign(&req_ctx->child_req); - if (err != -EINPROGRESS && - (err != -EBUSY || - !(req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err != -EINPROGRESS && err != -EBUSY) return pkcs1pad_encrypt_sign_complete(req, err); return err; @@ -561,9 +555,7 @@ static int pkcs1pad_verify(struct akcipher_request *req) ctx->key_size); err = crypto_akcipher_verify(&req_ctx->child_req); - if (err != -EINPROGRESS && - (err != -EBUSY || - !(req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG))) + if (err != -EINPROGRESS && err != -EBUSY) return pkcs1pad_verify_complete(req, err); return err; diff --git a/crypto/xts.c b/crypto/xts.c index d86c11a..af68012 100644 --- a/crypto/xts.c +++ b/crypto/xts.c @@ -269,9 +269,7 @@ static int do_encrypt(struct skcipher_request *req, int err) crypto_skcipher_encrypt(subreq) ?: post_crypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && - req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return err; } @@ -321,9 +319,7 @@ static int do_decrypt(struct skcipher_request *req, int err) crypto_skcipher_decrypt(subreq) ?: post_crypt(req); - if (err == -EINPROGRESS || - (err == -EBUSY && - req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) + if (err == -EINPROGRESS || err == -EBUSY) return err; } -- 2.1.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v8 00/20] simplify crypto wait for async op Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:40 +0200 [PATCH v8 09/20] crypto: move drbg to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 03/20] net: use -EAGAIN for transient busy indication Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 04/20] crypto: remove redundant backlog checks on EBUSY Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 14/20] cifs: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 12/20] fscrypt: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 20/20] crypto: adapt api sample to use async. op wait Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 02/20] crypto: ccp: use -EAGAIN for transient busy indication Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 05/20] crypto: marvell/cesa: remove redundant backlog checks on EBUSY Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 08/20] crypto: move pub key to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 10/20] crypto: move gcm to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 07/20] crypto: move algif to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 19/20] crypto: mediatek: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 17/20] crypto: talitos: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 06/20] crypto: introduce crypto wait for async op Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 13/20] dm: move dm-verity to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 18/20] crypto: qce: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 16/20] crypto: tcrypt: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 15/20] ima: move to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200 [PATCH v8 11/20] crypto: move testmgr to generic async completion Gilad Ben-Yossef <gilad@benyossef.com> - 2017-09-05 14:50 +0200
csiph-web