diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2017-09-04 21:42:22 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-09-04 21:42:22 +0200 |
commit | 495e642939114478a5237a7d91661ba93b76f15a (patch) | |
tree | 99d9efa957ece9af764956d9ae2532de375351fa /include | |
parent | ovl: cleanup d_real for negative (diff) | |
download | linux-495e642939114478a5237a7d91661ba93b76f15a.tar.xz linux-495e642939114478a5237a7d91661ba93b76f15a.zip |
vfs: add flags to d_real()
Add a separate flags argument (in addition to the open flags) to control
the behavior of d_real().
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dcache.h | 11 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index aae1cdb76851..fd0721e520f4 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -147,7 +147,7 @@ struct dentry_operations { struct vfsmount *(*d_automount)(struct path *); int (*d_manage)(const struct path *, bool); struct dentry *(*d_real)(struct dentry *, const struct inode *, - unsigned int); + unsigned int, unsigned int); } ____cacheline_aligned; /* @@ -566,7 +566,8 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) * d_real - Return the real dentry * @dentry: the dentry to query * @inode: inode to select the dentry from multiple layers (can be NULL) - * @flags: open flags to control copy-up behavior + * @open_flags: open flags to control copy-up behavior + * @flags: flags to control what is returned by this function * * If dentry is on a union/overlay, then return the underlying, real dentry. * Otherwise return the dentry itself. @@ -575,10 +576,10 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper) */ static inline struct dentry *d_real(struct dentry *dentry, const struct inode *inode, - unsigned int flags) + unsigned int open_flags, unsigned int flags) { if (unlikely(dentry->d_flags & DCACHE_OP_REAL)) - return dentry->d_op->d_real(dentry, inode, flags); + return dentry->d_op->d_real(dentry, inode, open_flags, flags); else return dentry; } @@ -593,7 +594,7 @@ static inline struct dentry *d_real(struct dentry *dentry, static inline struct inode *d_real_inode(const struct dentry *dentry) { /* This usage of d_real() results in const dentry */ - return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0)); + return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0, 0)); } struct name_snapshot { diff --git a/include/linux/fs.h b/include/linux/fs.h index 6e1fd5d21248..ee1db83c39cb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1233,7 +1233,7 @@ static inline struct inode *file_inode(const struct file *f) static inline struct dentry *file_dentry(const struct file *file) { - return d_real(file->f_path.dentry, file_inode(file), 0); + return d_real(file->f_path.dentry, file_inode(file), 0, 0); } static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) |