Commit 8f21cf0d2bae04ece761595036c9da8328b279aa

Authored by Herbert Xu
1 parent 6d7d684d63

[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: Herbert Xu <herbert@gondor.apana.org.au>

Showing 3 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -145,7 +145,7 @@
145 145 if (!nbytes)
146 146 break;
147 147  
148   - crypto_yield(tfm);
  148 + crypto_yield(tfm->crt_flags);
149 149 }
150 150  
151 151 if (buffer)
... ... @@ -55,7 +55,7 @@
55 55 tfm->__crt_alg->cra_digest.dia_update(tfm, p,
56 56 bytes_from_page);
57 57 crypto_kunmap(src, 0);
58   - crypto_yield(tfm);
  58 + crypto_yield(tfm->crt_flags);
59 59 offset = 0;
60 60 pg++;
61 61 l -= bytes_from_page;
... ... @@ -67,9 +67,9 @@
67 67 kunmap_atomic(vaddr, crypto_kmap_type(out));
68 68 }
69 69  
70   -static inline void crypto_yield(struct crypto_tfm *tfm)
  70 +static inline void crypto_yield(u32 flags)
71 71 {
72   - if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP)
  72 + if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
73 73 cond_resched();
74 74 }
75 75