summaryrefslogtreecommitdiff
path: root/fs/f2fs/crypto_key.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-12 23:26:54 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2015-06-02 02:20:55 +0300
commit8bacf6deb02367008cc25244d9c3d23b0f797048 (patch)
tree3d0aca12b7f09483945d4f9d3c7ec5b8131adf24 /fs/f2fs/crypto_key.c
parent06e1bc05cad8d06860b52c79d4669483c7e39a4f (diff)
downloadlinux-8bacf6deb02367008cc25244d9c3d23b0f797048.tar.xz
f2fs crypto: use slab caches
This patch integrates the below patch into f2fs. "ext4 crypto: use slab caches Use slab caches the ext4_crypto_ctx and ext4_crypt_info structures for slighly better memory efficiency and debuggability." Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/crypto_key.c')
-rw-r--r--fs/f2fs/crypto_key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/crypto_key.c b/fs/f2fs/crypto_key.c
index c7d414dd3a4a..6b9312b281b7 100644
--- a/fs/f2fs/crypto_key.c
+++ b/fs/f2fs/crypto_key.c
@@ -99,7 +99,7 @@ void f2fs_free_encryption_info(struct inode *inode)
key_put(ci->ci_keyring_key);
crypto_free_ablkcipher(ci->ci_ctfm);
memzero_explicit(&ci->ci_raw, sizeof(ci->ci_raw));
- kfree(ci);
+ kmem_cache_free(f2fs_crypt_info_cachep, ci);
fi->i_crypt_info = NULL;
}
@@ -137,7 +137,7 @@ int _f2fs_get_encryption_info(struct inode *inode)
return -EINVAL;
res = 0;
- crypt_info = kmalloc(sizeof(struct f2fs_crypt_info), GFP_NOFS);
+ crypt_info = kmem_cache_alloc(f2fs_crypt_info_cachep, GFP_NOFS);
if (!crypt_info)
return -ENOMEM;
@@ -187,7 +187,7 @@ out:
if (res < 0) {
if (res == -ENOKEY)
res = 0;
- kfree(crypt_info);
+ kmem_cache_free(f2fs_crypt_info_cachep, crypt_info);
} else {
fi->i_crypt_info = crypt_info;
crypt_info->ci_keyring_key = keyring_key;