summaryrefslogtreecommitdiffstats
path: root/fs/ext4/crypto.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-18 13:20:47 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-05-18 13:20:47 -0400
commit1aaa6e8b24114757a836ae0e62d2096deb76f274 (patch)
tree3f9e93f18c1c1d7ce9e66f844efed706755d0281 /fs/ext4/crypto.c
parent8ee0371470038371729a39ee6669a2132ac47649 (diff)
downloadlinux-1aaa6e8b24114757a836ae0e62d2096deb76f274.tar.bz2
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>
Diffstat (limited to 'fs/ext4/crypto.c')
-rw-r--r--fs/ext4/crypto.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
index 1c34f0eb125b..9969d054cd88 100644
--- a/fs/ext4/crypto.c
+++ b/fs/ext4/crypto.c
@@ -137,14 +137,13 @@ struct ext4_crypto_ctx *ext4_get_crypto_ctx(struct inode *inode)
/* Allocate a new Crypto API context if we don't already have
* one or if it isn't the right mode. */
- BUG_ON(ci->ci_mode == EXT4_ENCRYPTION_MODE_INVALID);
- if (ctx->tfm && (ctx->mode != ci->ci_mode)) {
+ if (ctx->tfm && (ctx->mode != ci->ci_data_mode)) {
crypto_free_tfm(ctx->tfm);
ctx->tfm = NULL;
ctx->mode = EXT4_ENCRYPTION_MODE_INVALID;
}
if (!ctx->tfm) {
- switch (ci->ci_mode) {
+ switch (ci->ci_data_mode) {
case EXT4_ENCRYPTION_MODE_AES_256_XTS:
ctx->tfm = crypto_ablkcipher_tfm(
crypto_alloc_ablkcipher("xts(aes)", 0, 0));
@@ -162,9 +161,9 @@ struct ext4_crypto_ctx *ext4_get_crypto_ctx(struct inode *inode)
ctx->tfm = NULL;
goto out;
}
- ctx->mode = ci->ci_mode;
+ ctx->mode = ci->ci_data_mode;
}
- BUG_ON(ci->ci_size != ext4_encryption_key_size(ci->ci_mode));
+ BUG_ON(ci->ci_size != ext4_encryption_key_size(ci->ci_data_mode));
/* There shouldn't be a bounce page attached to the crypto
* context at this point. */
@@ -321,7 +320,7 @@ static int ext4_page_crypto(struct ext4_crypto_ctx *ctx,
int res = 0;
BUG_ON(!ctx->tfm);
- BUG_ON(ctx->mode != ei->i_crypt_info->ci_mode);
+ BUG_ON(ctx->mode != ei->i_crypt_info->ci_data_mode);
if (ctx->mode != EXT4_ENCRYPTION_MODE_AES_256_XTS) {
printk_ratelimited(KERN_ERR