Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dm-integrity: rename internal_hash

Rename "internal_hash" to "internal_shash" and introduce a boolean value
"internal_hash".

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

+11 -8
+11 -8
drivers/md/dm-integrity.c
··· 219 219 __u8 log2_blocks_per_bitmap_bit; 220 220 221 221 unsigned char mode; 222 + bool internal_hash; 222 223 223 224 int failed; 224 225 225 - struct crypto_shash *internal_hash; 226 + struct crypto_shash *internal_shash; 226 227 unsigned int internal_hash_digestsize; 227 228 228 229 struct dm_target *ti; ··· 1640 1639 const char *data, unsigned offset, char *result) 1641 1640 { 1642 1641 __le64 sector_le = cpu_to_le64(sector); 1643 - SHASH_DESC_ON_STACK(req, ic->internal_hash); 1642 + SHASH_DESC_ON_STACK(req, ic->internal_shash); 1644 1643 int r; 1645 1644 unsigned int digest_size; 1646 1645 1647 - req->tfm = ic->internal_hash; 1646 + req->tfm = ic->internal_shash; 1648 1647 1649 1648 r = crypto_shash_init(req); 1650 1649 if (unlikely(r < 0)) { ··· 4709 4708 buffer_sectors = 1; 4710 4709 ic->log2_buffer_sectors = min((int)__fls(buffer_sectors), 31 - SECTOR_SHIFT); 4711 4710 4712 - r = get_mac(&ic->internal_hash, &ic->internal_hash_alg, &ti->error, 4711 + r = get_mac(&ic->internal_shash, &ic->internal_hash_alg, &ti->error, 4713 4712 "Invalid internal hash", "Error setting internal hash key"); 4714 4713 if (r) 4715 4714 goto bad; 4716 - if (ic->internal_hash) 4717 - ic->internal_hash_digestsize = crypto_shash_digestsize(ic->internal_hash); 4715 + if (ic->internal_shash) { 4716 + ic->internal_hash = true; 4717 + ic->internal_hash_digestsize = crypto_shash_digestsize(ic->internal_shash); 4718 + } 4718 4719 4719 4720 r = get_mac(&ic->journal_mac, &ic->journal_mac_alg, &ti->error, 4720 4721 "Invalid journal mac", "Error setting journal mac key"); ··· 5238 5235 if (ic->sb) 5239 5236 free_pages_exact(ic->sb, SB_SECTORS << SECTOR_SHIFT); 5240 5237 5241 - if (ic->internal_hash) 5242 - crypto_free_shash(ic->internal_hash); 5238 + if (ic->internal_shash) 5239 + crypto_free_shash(ic->internal_shash); 5243 5240 free_alg(&ic->internal_hash_alg); 5244 5241 5245 5242 if (ic->journal_crypt)