summaryrefslogtreecommitdiff
path: root/fs/f2fs/inode.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-20 08:26:54 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2015-06-02 02:21:04 +0300
commit26bf3dc7e25b813ff5c92234f8165941fdc12a63 (patch)
tree1486f8923c5f9c05fc6684d2c4b425f65b1ca459 /fs/f2fs/inode.c
parentda554e48caab95a48afe0d7be8d9eae2bbdaa28d (diff)
downloadlinux-26bf3dc7e25b813ff5c92234f8165941fdc12a63.tar.xz
f2fs crypto: use per-inode tfm structure
This patch applies the following ext4 patch: ext4 crypto: use per-inode tfm structure As suggested by Herbert Xu, we shouldn't allocate a new tfm each time we read or write a page. Instead we can use a single tfm hanging off the inode's crypt_info structure for all of our encryption needs for that inode, since the tfm can be used by multiple crypto requests in parallel. Also use cmpxchg() to avoid races that could result in crypt_info structure getting doubly allocated or doubly freed. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r--fs/f2fs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index ea6ba3bc8472..2550868dc651 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -364,7 +364,7 @@ no_delete:
out_clear:
#ifdef CONFIG_F2FS_FS_ENCRYPTION
if (F2FS_I(inode)->i_crypt_info)
- f2fs_free_encryption_info(inode);
+ f2fs_free_encryption_info(inode, F2FS_I(inode)->i_crypt_info);
#endif
clear_inode(inode);
}