]> git.baikalelectronics.ru Git - kernel.git/commit
ext4 crypto: use per-inode tfm structure
authorTheodore Ts'o <tytso@mit.edu>
Sun, 31 May 2015 17:34:22 +0000 (13:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 31 May 2015 17:34:22 +0000 (13:34 -0400)
commitad7dc939cd569c95e936a099f62d290169d94afb
treea09688def0b1c75f7e23a9b1c98848f41e043d2e
parentf238ddcf78cbfa6016c652851c77837885e7257f
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>
fs/ext4/crypto.c
fs/ext4/crypto_fname.c
fs/ext4/crypto_key.c
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/ext4_crypto.h
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/symlink.c