Skip to content

Commit

Permalink
vfs: make argument of d_real_inode() const
Browse files Browse the repository at this point in the history
d_op->d_real() leaves the dentry alone except if the third argument is
non-zero.  Unfortunately very difficult to explain to the compiler without
a cast.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: Jeff Layton <jlayton@poochiereds.net>
  • Loading branch information
Miklos Szeredi committed Sep 16, 2016
1 parent c568d68 commit 7b1742e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ static inline struct dentry *d_real(struct dentry *dentry,
* If dentry is on an union/overlay, then return the underlying, real inode.
* Otherwise return d_inode().
*/
static inline struct inode *d_real_inode(struct dentry *dentry)
static inline struct inode *d_real_inode(const struct dentry *dentry)
{
return d_backing_inode(d_real(dentry, NULL, 0));
/* This usage of d_real() results in const dentry */
return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0));
}


Expand Down

0 comments on commit 7b1742e

Please sign in to comment.