summaryrefslogtreecommitdiff
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-05-20 23:13:45 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2016-05-20 23:13:45 +0300
commita118084432d642eeccb961c7c8cc61525a941fcb (patch)
tree13583657704b821ad875c0d2fbacab07fc50f53d /include/linux/dcache.h
parent2dcd0af568b0cf583645c8a317dd12e344b1c72a (diff)
downloadlinux-a118084432d642eeccb961c7c8cc61525a941fcb.tar.xz
vfs: add d_real_inode() helper
Needed by the following fix. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 7e9422cb5989..ad5d582f9b14 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -576,5 +576,17 @@ static inline struct inode *vfs_select_inode(struct dentry *dentry,
return inode;
}
+/**
+ * d_real_inode - Return the real inode
+ * @dentry: The dentry to query
+ *
+ * If dentry is on an union/overlay, then return the underlying, real inode.
+ * Otherwise return d_inode().
+ */
+static inline struct inode *d_real_inode(struct dentry *dentry)
+{
+ return d_backing_inode(d_real(dentry));
+}
+
#endif /* __LINUX_DCACHE_H */