ext4 crypto: get rid of ci_mode from struct ext4_crypt_info
The ci_mode field was superfluous, and getting rid of it gets rid of
an unused hole in the structure.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index d6abe46..858d7d6 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -152,14 +152,13 @@
memcpy(crypt_info->ci_master_key, ctx.master_key_descriptor,
sizeof(crypt_info->ci_master_key));
if (S_ISREG(inode->i_mode))
- crypt_info->ci_mode = ctx.contents_encryption_mode;
+ crypt_info->ci_size =
+ ext4_encryption_key_size(crypt_info->ci_data_mode);
else if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))
- crypt_info->ci_mode = ctx.filenames_encryption_mode;
- else {
- printk(KERN_ERR "ext4 crypto: Unsupported inode type.\n");
+ crypt_info->ci_size =
+ ext4_encryption_key_size(crypt_info->ci_filename_mode);
+ else
BUG();
- }
- crypt_info->ci_size = ext4_encryption_key_size(crypt_info->ci_mode);
BUG_ON(!crypt_info->ci_size);
if (DUMMY_ENCRYPTION_ENABLED(sbi)) {
memset(crypt_info->ci_raw, 0x42, EXT4_AES_256_XTS_KEY_SIZE);