Skip to content

Commit

Permalink
[CRYPTO] api: Feed flag directly to crypto_yield
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Sep 21, 2006
1 parent 6d7d684 commit 8f21cf0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int crypt(const struct cipher_desc *desc,
if (!nbytes)
break;

crypto_yield(tfm);
crypto_yield(tfm->crt_flags);
}

if (buffer)
Expand Down
2 changes: 1 addition & 1 deletion crypto/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void update(struct crypto_tfm *tfm,
tfm->__crt_alg->cra_digest.dia_update(tfm, p,
bytes_from_page);
crypto_kunmap(src, 0);
crypto_yield(tfm);
crypto_yield(tfm->crt_flags);
offset = 0;
pg++;
l -= bytes_from_page;
Expand Down
4 changes: 2 additions & 2 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ static inline void crypto_kunmap(void *vaddr, int 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();
}

Expand Down

0 comments on commit 8f21cf0

Please sign in to comment.