aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-03-31 01:18:48 -0400
committerMike Snitzer <snitzer@redhat.com>2017-04-25 16:12:03 -0400
commit86f917adea2dc0ef440a248601e48154dc48e6d0 (patch)
treed23ebff0683d9481af9fe692876bed88e81d8fd7
parentd1ac3ff008fb9a48f91fc15920b4c8db24c0f03e (diff)
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: Eric Biggers <ebiggers@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/dm-crypt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 64c5022449ee..e2de5715d528 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -225,7 +225,7 @@ static struct scatterlist *crypt_get_sg_data(struct crypt_config *cc,
225 struct scatterlist *sg); 225 struct scatterlist *sg);
226 226
227/* 227/*
228 * Use this to access cipher attributes that are the same for each CPU. 228 * Use this to access cipher attributes that are independent of the key.
229 */ 229 */
230static struct crypto_skcipher *any_tfm(struct crypt_config *cc) 230static struct crypto_skcipher *any_tfm(struct crypt_config *cc)
231{ 231{
@@ -349,10 +349,11 @@ static int crypt_iv_essiv_wipe(struct crypt_config *cc)
349 return err; 349 return err;
350} 350}
351 351
352/* Set up per cpu cipher state */ 352/* Allocate the cipher for ESSIV */
353static struct crypto_cipher *setup_essiv_cpu(struct crypt_config *cc, 353static struct crypto_cipher *alloc_essiv_cipher(struct crypt_config *cc,
354 struct dm_target *ti, 354 struct dm_target *ti,
355 u8 *salt, unsigned saltsize) 355 const u8 *salt,
356 unsigned int saltsize)
356{ 357{
357 struct crypto_cipher *essiv_tfm; 358 struct crypto_cipher *essiv_tfm;
358 int err; 359 int err;
@@ -431,9 +432,8 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
431 cc->iv_gen_private.essiv.salt = salt; 432 cc->iv_gen_private.essiv.salt = salt;
432 cc->iv_gen_private.essiv.hash_tfm = hash_tfm; 433 cc->iv_gen_private.essiv.hash_tfm = hash_tfm;
433 434
434 essiv_tfm = setup_essiv_cpu(cc, ti, salt, 435 essiv_tfm = alloc_essiv_cipher(cc, ti, salt,
435 crypto_ahash_digestsize(hash_tfm)); 436 crypto_ahash_digestsize(hash_tfm));
436
437 if (IS_ERR(essiv_tfm)) { 437 if (IS_ERR(essiv_tfm)) {
438 crypt_iv_essiv_dtr(cc); 438 crypt_iv_essiv_dtr(cc);
439 return PTR_ERR(essiv_tfm); 439 return PTR_ERR(essiv_tfm);