From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621AbcGUNyS (ORCPT ); Thu, 21 Jul 2016 09:54:18 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38742 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbcGUNxm (ORCPT ); Thu, 21 Jul 2016 09:53:42 -0400 From: Miklos Szeredi To: Jeff Layton , "J. Bruce Fields" , Al Viro 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 Message-Id: <1469109216-24353-3-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1469109216-24353-1-git-send-email-mszeredi@redhat.com> References: <1469109216-24353-1-git-send-email-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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