[Devel] [PATCH rh7 3/4] vfs: add vfs_select_inode() helper

Maxim Patlasov mpatlasov at virtuozzo.com
Tue Jul 26 18:07:22 PDT 2016


The patch backports upstream commit 54d5ca871e72f2bb172ec9323497f01cd5091ec7:

>    vfs: add vfs_select_inode() helper
>
>    Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>

The part about vfs_open is omitted because we don't use
d_op->d_select_inode() there. Our version of vfs_select_inode()
doesn't have "open_flags" arg because our d_select_inode()
doesn't have it.

https://jira.sw.ru/browse/PSBM-47981

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 include/linux/dcache.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 267dbc6..897814a 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -529,4 +529,14 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper)
 	return upper;
 }
 
+static inline struct inode *vfs_select_inode(struct dentry *dentry)
+{
+	struct inode *inode = d_inode(dentry);
+
+	if (inode && unlikely(dentry->d_flags & DCACHE_OP_SELECT_INODE))
+		inode = dentry->d_op->d_select_inode(dentry);
+
+	return inode;
+}
+
 #endif	/* __LINUX_DCACHE_H */



More information about the Devel mailing list