diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-05-31 19:34:22 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-05-31 19:34:22 +0200 |
commit | c936e1ec2879e43599d801dfa6fe58e7ccfee433 (patch) | |
tree | a09688def0b1c75f7e23a9b1c98848f41e043d2e /fs/ext4/dir.c | |
parent | ext4 crypto: require CONFIG_CRYPTO_CTR if ext4 encryption is enabled (diff) | |
download | linux-c936e1ec2879e43599d801dfa6fe58e7ccfee433.tar.xz 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/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 28cb94fbb1c9..e11e6ae26baa 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -133,9 +133,6 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx) return err; } - err = ext4_setup_fname_crypto(inode); - if (err) - return err; if (ext4_encrypted_inode(inode)) { err = ext4_fname_crypto_alloc_buffer(inode, EXT4_NAME_LEN, &fname_crypto_str); |