diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2016-06-30 08:53:27 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-06-30 08:53:27 +0200 |
commit | 2d902671ce1cd98cdc88d78c481889a1b2996101 (patch) | |
tree | 48c4bc8f90ee3209b7fba9b70169e8528b781eaa /fs/open.c | |
parent | 4c2e07c6a29e0129e975727b9f57eede813eea85 (diff) | |
download | lwn-2d902671ce1cd98cdc88d78c481889a1b2996101.tar.gz lwn-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 'fs/open.c')
-rw-r--r-- | fs/open.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c index 93ae3cdee4ab..bf66cf1a9f5c 100644 --- a/fs/open.c +++ b/fs/open.c @@ -840,13 +840,13 @@ EXPORT_SYMBOL(file_path); int vfs_open(const struct path *path, struct file *file, const struct cred *cred) { - struct inode *inode = vfs_select_inode(path->dentry, file->f_flags); + struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags); - if (IS_ERR(inode)) - return PTR_ERR(inode); + if (IS_ERR(dentry)) + return PTR_ERR(dentry); file->f_path = *path; - return do_dentry_open(file, inode, NULL, cred); + return do_dentry_open(file, d_backing_inode(dentry), NULL, cred); } struct file *dentry_open(const struct path *path, int flags, |