From: Miklos Szeredi <mszeredi@redhat.com>
To: Jeff Layton <jlayton@poochiereds.net>,
"J. Bruce Fields" <bfields@fieldses.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: [RFC PATCH v2 2/3] vfs: make argument of d_real_inode() const
Date: Thu, 21 Jul 2016 15:53:35 +0200 [thread overview]
Message-ID: <1469109216-24353-3-git-send-email-mszeredi@redhat.com> (raw)
In-Reply-To: <1469109216-24353-1-git-send-email-mszeredi@redhat.com>
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>
---
include/linux/dcache.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 14df83609c7f..b965751c6b71 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -583,9 +583,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));
}
--
2.5.5
next prev parent reply other threads:[~2016-07-21 13:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 13:53 [RFC PATCH v2 0/3] fix overlayfs locks and leases Miklos Szeredi
2016-07-21 13:53 ` [RFC PATCH v2 1/3] locks: fix file locking on overlayfs Miklos Szeredi
2016-07-21 13:53 ` Miklos Szeredi [this message]
2016-07-21 13:53 ` [RFC PATCH v2 3/3] vfs: do get_write_access() on upper layer of overlayfs Miklos Szeredi
2016-07-21 20:19 ` [RFC PATCH v2 0/3] fix overlayfs locks and leases Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469109216-24353-3-git-send-email-mszeredi@redhat.com \
--to=mszeredi@redhat.com \
--cc=bfields@fieldses.org \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).