Commit 86f917ad authored by Eric Biggers's avatar Eric Biggers Committed by Mike Snitzer

dm crypt: remove obsolete references to per-CPU state

dm-crypt used to use separate crypto transforms for each CPU, but this
is no longer the case.  To avoid confusion, fix up obsolete comments and
rename setup_essiv_cpu().
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent d1ac3ff0
...@@ -225,7 +225,7 @@ static struct scatterlist *crypt_get_sg_data(struct crypt_config *cc, ...@@ -225,7 +225,7 @@ static struct scatterlist *crypt_get_sg_data(struct crypt_config *cc,
struct scatterlist *sg); struct scatterlist *sg);
/* /*
* Use this to access cipher attributes that are the same for each CPU. * Use this to access cipher attributes that are independent of the key.
*/ */
static struct crypto_skcipher *any_tfm(struct crypt_config *cc) static struct crypto_skcipher *any_tfm(struct crypt_config *cc)
{ {
...@@ -349,10 +349,11 @@ static int crypt_iv_essiv_wipe(struct crypt_config *cc) ...@@ -349,10 +349,11 @@ static int crypt_iv_essiv_wipe(struct crypt_config *cc)
return err; return err;
} }
/* Set up per cpu cipher state */ /* Allocate the cipher for ESSIV */
static struct crypto_cipher *setup_essiv_cpu(struct crypt_config *cc, static struct crypto_cipher *alloc_essiv_cipher(struct crypt_config *cc,
struct dm_target *ti, struct dm_target *ti,
u8 *salt, unsigned saltsize) const u8 *salt,
unsigned int saltsize)
{ {
struct crypto_cipher *essiv_tfm; struct crypto_cipher *essiv_tfm;
int err; int err;
...@@ -431,9 +432,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, ...@@ -431,9 +432,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
cc->iv_gen_private.essiv.salt = salt; cc->iv_gen_private.essiv.salt = salt;
cc->iv_gen_private.essiv.hash_tfm = hash_tfm; cc->iv_gen_private.essiv.hash_tfm = hash_tfm;
essiv_tfm = setup_essiv_cpu(cc, ti, salt, essiv_tfm = alloc_essiv_cipher(cc, ti, salt,
crypto_ahash_digestsize(hash_tfm)); crypto_ahash_digestsize(hash_tfm));
if (IS_ERR(essiv_tfm)) { if (IS_ERR(essiv_tfm)) {
crypt_iv_essiv_dtr(cc); crypt_iv_essiv_dtr(cc);
return PTR_ERR(essiv_tfm); return PTR_ERR(essiv_tfm);
......
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