summaryrefslogtreecommitdiff
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-31 20:35:02 +0300
committerTheodore Ts'o <tytso@mit.edu>2015-05-31 20:35:02 +0300
commite709e9df64928a99d41da75910b844976a535db7 (patch)
tree3661c61b6709f910f5ef1d365890c120819ac380 /fs/ext4/ext4.h
parent6bc445e0ff44c7e83225124c214d350407e68ccf (diff)
downloadlinux-e709e9df64928a99d41da75910b844976a535db7.tar.xz
ext4 crypto: encrypt tmpfile located in encryption protected directory
Factor out calls to ext4_inherit_context() and move them to __ext4_new_inode(); this fixes a problem where ext4_tmpfile() wasn't calling calling ext4_inherit_context(), so the temporary file wasn't getting protected. Since the blocks for the tmpfile could end up on disk, they really should be protected if the tmpfile is created within the context of an encrypted directory. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 7435ff2c3efb..bd8d32d5214d 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2149,6 +2149,11 @@ static inline int ext4_get_encryption_info(struct inode *inode)
return 0;
}
+static inline struct ext4_crypt_info *ext4_encryption_info(struct inode *inode)
+{
+ return EXT4_I(inode)->i_crypt_info;
+}
+
#else
static inline int ext4_has_encryption_key(struct inode *inode)
{
@@ -2158,6 +2163,10 @@ static inline int ext4_get_encryption_info(struct inode *inode)
{
return 0;
}
+static inline struct ext4_crypt_info *ext4_encryption_info(struct inode *inode)
+{
+ return NULL;
+}
#endif