[Devel] [PATCH RHEL7 COMMIT] ms/vfs: add vfs_select_inode() helper

Konstantin Khorenko khorenko at virtuozzo.com
Tue Aug 9 01:16:36 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.22.2.vz7.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.22.2.vz7.16.3
------>
commit 496ad53a5b4922635f7b6fb7f079aa44a068bf2d
Author: Maxim Patlasov <mpatlasov at virtuozzo.com>
Date:   Tue Aug 9 12:16:36 2016 +0400

    ms/vfs: add vfs_select_inode() helper
    
    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