summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-06-30 08:53:27 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2016-06-30 08:53:27 +0200
commit2d902671ce1cd98cdc88d78c481889a1b2996101 (patch)
tree48c4bc8f90ee3209b7fba9b70169e8528b781eaa /include/linux/fs.h
parent4c2e07c6a29e0129e975727b9f57eede813eea85 (diff)
downloadlinux-2d902671ce1cd98cdc88d78c481889a1b2996101.tar.gz
linux-2d902671ce1cd98cdc88d78c481889a1b2996101.tar.bz2
linux-2d902671ce1cd98cdc88d78c481889a1b2996101.zip
vfs: merge .d_select_inode() into .d_real()
The two methods essentially do the same: find the real dentry/inode belonging to an overlay dentry. The difference is in the usage: vfs_open() uses ->d_select_inode() and expects the function to perform copy-up if necessary based on the open flags argument. file_dentry() uses ->d_real() passing in the overlay dentry as well as the underlying inode. vfs_rename() uses ->d_select_inode() but passes zero flags. ->d_real() with a zero inode would have worked just as well here. This patch merges the functionality of ->d_select_inode() into ->d_real() by adding an 'open_flags' argument to the latter. [Al Viro] Make the signature of d_real() match that of ->d_real() again. And constify the inode argument, while we are at it. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index dd288148a6b1..bacc0733663c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1272,12 +1272,7 @@ static inline struct inode *file_inode(const struct file *f)
static inline struct dentry *file_dentry(const struct file *file)
{
- struct dentry *dentry = file->f_path.dentry;
-
- if (unlikely(dentry->d_flags & DCACHE_OP_REAL))
- return dentry->d_op->d_real(dentry, file_inode(file));
- else
- return dentry;
+ return d_real(file->f_path.dentry, file_inode(file), 0);
}
static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl)