Skip to content

Commit 8f21cf0

Browse files
committed
[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>
1 parent 6d7d684 commit 8f21cf0

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎crypto/cipher.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int crypt(const struct cipher_desc *desc,
145145
if (!nbytes)
146146
break;
147147

148-
crypto_yield(tfm);
148+
crypto_yield(tfm->crt_flags);
149149
}
150150

151151
if (buffer)

‎crypto/digest.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void update(struct crypto_tfm *tfm,
5555
tfm->__crt_alg->cra_digest.dia_update(tfm, p,
5656
bytes_from_page);
5757
crypto_kunmap(src, 0);
58-
crypto_yield(tfm);
58+
crypto_yield(tfm->crt_flags);
5959
offset = 0;
6060
pg++;
6161
l -= bytes_from_page;

‎crypto/internal.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ static inline void crypto_kunmap(void *vaddr, int out)
6767
kunmap_atomic(vaddr, crypto_kmap_type(out));
6868
}
6969

70-
static inline void crypto_yield(struct crypto_tfm *tfm)
70+
static inline void crypto_yield(u32 flags)
7171
{
72-
if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP)
72+
if (flags & CRYPTO_TFM_REQ_MAY_SLEEP)
7373
cond_resched();
7474
}
7575

0 commit comments

Comments
 (0)