summaryrefslogtreecommitdiffstats
path: root/fs/ext4/symlink.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-31 13:34:22 -0400
committerTheodore Ts'o <tytso@mit.edu>2015-05-31 13:34:22 -0400
commitc936e1ec2879e43599d801dfa6fe58e7ccfee433 (patch)
treea09688def0b1c75f7e23a9b1c98848f41e043d2e /fs/ext4/symlink.c
parent71dea01ea2edb73f3c5d9a0cd7ba028bb9313287 (diff)
downloadlinux-c936e1ec2879e43599d801dfa6fe58e7ccfee433.tar.gz
linux-c936e1ec2879e43599d801dfa6fe58e7ccfee433.tar.bz2
linux-c936e1ec2879e43599d801dfa6fe58e7ccfee433.zip
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>
Diffstat (limited to 'fs/ext4/symlink.c')
-rw-r--r--fs/ext4/symlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index 32870881188e..68e915aac0fe 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -37,7 +37,7 @@ static void *ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
if (!ext4_encrypted_inode(inode))
return page_follow_link_light(dentry, nd);
- res = ext4_setup_fname_crypto(inode);
+ res = ext4_get_encryption_info(inode);
if (res)
return ERR_PTR(res);