X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Finternal.h;h=959e602909a60e1042e2d07d4d19471d9b0cd23c;hb=92445eaaadc1f03f5a177ecc957bda76bf2ba8d5;hp=68612874b5fde627e571b67ce1533084055e6104;hpb=c27510c031cae15f84b90f28d6dc02c314d84cf8;p=linux-2.6 diff --git a/crypto/internal.h b/crypto/internal.h index 68612874b5..959e602909 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -2,6 +2,7 @@ * Cryptographic API. * * Copyright (c) 2002 James Morris + * Copyright (c) 2005 Herbert Xu * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -16,9 +17,15 @@ #include #include #include +#include #include +#include +#include #include +extern struct list_head crypto_alg_list; +extern struct rw_semaphore crypto_alg_sem; + extern enum km_type crypto_km_types[]; static inline enum km_type crypto_kmap_type(int out) @@ -38,7 +45,7 @@ static inline void crypto_kunmap(void *vaddr, int out) static inline void crypto_yield(struct crypto_tfm *tfm) { - if (!in_atomic()) + if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP) cond_resched(); } @@ -75,7 +82,7 @@ static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg, switch (flags & CRYPTO_TFM_MODE_MASK) { case CRYPTO_TFM_MODE_CBC: - len = ALIGN(len, alg->cra_alignmask + 1); + len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1); len += alg->cra_blocksize; break; }