summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-05-11 01:16:37 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-10 23:55:01 -0400
commit54d5ca871e72f2bb172ec9323497f01cd5091ec7 (patch)
tree1fc2a5f3017793f70f32c88bc9fdbd8107ca7a99 /include
parent44549e8f5eea4e0a41b487b63e616cb089922b99 (diff)
vfs: add vfs_select_inode() helper
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: <stable@vger.kernel.org> # v4.2+
Diffstat (limited to 'include')
-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 4bb4de8d95ea..7e9422cb5989 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -565,4 +565,16 @@ static inline struct dentry *d_real(struct dentry *dentry)
return dentry;
}
+static inline struct inode *vfs_select_inode(struct dentry *dentry,
+ unsigned open_flags)
+{
+ struct inode *inode = d_inode(dentry);
+
+ if (inode && unlikely(dentry->d_flags & DCACHE_OP_SELECT_INODE))
+ inode = dentry->d_op->d_select_inode(dentry, open_flags);
+
+ return inode;
+}
+
+
#endif /* __LINUX_DCACHE_H */