summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/crypto.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-12 22:33:00 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2015-06-02 01:20:56 +0200
commit640778fbc97b36757bd1f857ba4b599a200517c2 (patch)
tree9cbbe8144f1a4090c23ebdf96104287224df2d2a /fs/f2fs/crypto.c
parentf2fs crypto: use slab caches (diff)
downloadlinux-640778fbc97b36757bd1f857ba4b599a200517c2.tar.xz
linux-640778fbc97b36757bd1f857ba4b599a200517c2.zip
f2fs crypto: get rid of ci_mode from struct f2fs_crypt_info
This patch integrates the below patch into f2fs. "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> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/crypto.c')
-rw-r--r--fs/f2fs/crypto.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c
index 4057c07242c6..e4058b92c774 100644
--- a/fs/f2fs/crypto.c
+++ b/fs/f2fs/crypto.c
@@ -151,14 +151,13 @@ struct f2fs_crypto_ctx *f2fs_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 == F2FS_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 = F2FS_ENCRYPTION_MODE_INVALID;
}
if (!ctx->tfm) {
- switch (ci->ci_mode) {
+ switch (ci->ci_data_mode) {
case F2FS_ENCRYPTION_MODE_AES_256_XTS:
ctx->tfm = crypto_ablkcipher_tfm(
crypto_alloc_ablkcipher("xts(aes)", 0, 0));
@@ -178,9 +177,9 @@ struct f2fs_crypto_ctx *f2fs_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 != f2fs_encryption_key_size(ci->ci_mode));
+ BUG_ON(ci->ci_size != f2fs_encryption_key_size(ci->ci_data_mode));
/*
* There shouldn't be a bounce page attached to the crypto
@@ -388,7 +387,7 @@ static int f2fs_page_crypto(struct f2fs_crypto_ctx *ctx,
int res = 0;
BUG_ON(!ctx->tfm);
- BUG_ON(ctx->mode != fi->i_crypt_info->ci_mode);
+ BUG_ON(ctx->mode != fi->i_crypt_info->ci_data_mode);
if (ctx->mode != F2FS_ENCRYPTION_MODE_AES_256_XTS) {
printk_ratelimited(KERN_ERR