Commit 8f21cf0d authored by Herbert Xu's avatar Herbert Xu

[CRYPTO] api: Feed flag directly to crypto_yield

The sleeping flag used to determine whether crypto_yield can actually
yield is really a per-operation flag rather than a per-tfm flag.  This
patch changes crypto_yield to take a flag directly so that we can start
using a per-operation flag instead the tfm flag.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 6d7d684d
...@@ -145,7 +145,7 @@ static int crypt(const struct cipher_desc *desc, ...@@ -145,7 +145,7 @@ static int crypt(const struct cipher_desc *desc,
if (!nbytes) if (!nbytes)
break; break;
crypto_yield(tfm); crypto_yield(tfm->crt_flags);
} }
if (buffer) if (buffer)
......
...@@ -55,7 +55,7 @@ static void update(struct crypto_tfm *tfm, ...@@ -55,7 +55,7 @@ static void update(struct crypto_tfm *tfm,
tfm->__crt_alg->cra_digest.dia_update(tfm, p, tfm->__crt_alg->cra_digest.dia_update(tfm, p,
bytes_from_page); bytes_from_page);
crypto_kunmap(src, 0); crypto_kunmap(src, 0);
crypto_yield(tfm); crypto_yield(tfm->crt_flags);
offset = 0; offset = 0;
pg++; pg++;
l -= bytes_from_page; l -= bytes_from_page;
......
...@@ -67,9 +67,9 @@ static inline void crypto_kunmap(void *vaddr, int out) ...@@ -67,9 +67,9 @@ static inline void crypto_kunmap(void *vaddr, int out)
kunmap_atomic(vaddr, crypto_kmap_type(out)); kunmap_atomic(vaddr, crypto_kmap_type(out));
} }
static inline void crypto_yield(struct crypto_tfm *tfm) static inline void crypto_yield(u32 flags)
{ {
if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP) if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
cond_resched(); cond_resched();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment