aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2016-02-07 19:35:05 -0500
committerMister Oyster <oysterized@gmail.com>2017-05-29 03:52:06 +0200
commit1487abde26ae07c507d95f4a59021b2f647e64f1 (patch)
treea589facb5e481b13cf9abf2450312d18a69364b1 /include
parent72e896d8d5698abc18c4e22995edabc242a7fa62 (diff)
ext4 crypto: revalidate dentry after adding or removing the key
Add a validation check for dentries for encrypted directory to make sure we're not caching stale data after a key has been added or removed. Also check to make sure that status of the encryption key is updated when readdir(2) is executed. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com> Change-Id: Ic7a90d79d9447272fc512ae2abbd299523de02b8
Diffstat (limited to 'include')
-rw-r--r--include/linux/dcache.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index f2c042f1c..15b03546d 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -420,6 +420,23 @@ static inline bool d_is_su(const struct dentry *dentry)
!memcmp(dentry->d_name.name, "su", 2);
}
+/**
+ * d_inode - Get the actual inode of this dentry
+ * @dentry: The dentry to query
+ *
+ * This is the helper normal filesystems should use to get at their own inodes
+ * in their own dentries and ignore the layering superimposed upon them.
+ */
+static inline struct inode *d_inode(const struct dentry *dentry)
+{
+ return dentry->d_inode;
+}
+
+static inline bool d_is_negative(const struct dentry *dentry)
+{
+ return (dentry->d_inode == NULL);
+}
+
extern int sysctl_vfs_cache_pressure;
#endif /* __LINUX_DCACHE_H */