From patchwork Thu Jul 21 13:53:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9241721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E6EE60574 for ; Thu, 21 Jul 2016 13:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 012C01FF2F for ; Thu, 21 Jul 2016 13:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA19027F3E; Thu, 21 Jul 2016 13:54:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BF301FF2F for ; Thu, 21 Jul 2016 13:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752597AbcGUNyS (ORCPT ); Thu, 21 Jul 2016 09:54:18 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36661 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbcGUNxm (ORCPT ); Thu, 21 Jul 2016 09:53:42 -0400 Received: by mail-wm0-f53.google.com with SMTP id q128so22763282wma.1 for ; Thu, 21 Jul 2016 06:53:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=shvSSxWWJyFilW210zdd5pj+8Ah84lhFlvvh0hbCTlI=; b=bp2u9C9mswyzHogIV4tvWddpkNTlEkPb+cHgHx6WefHQy6/IWDnWunPpwkrKVnN0T9 uuCzfkxD/C1+QfT2ghl4BwEa9ixH7tOFy4VRQ3Rmg6oayv7Ylr62M53Pyr1tCkNHCYDB 6tM6c0dLjAyUokvKr7PlJRis5EbqLU+MAtikPpxSzyZ6XMtu//wGMufsKhPChnjpMFR6 e3Pm+8CBq1QZGgITh9rqNuUSjw2kBR9mnBIjzgaZTUxYgQFagwIAlbhecw1Qb+NF/GSi gSj7Zb6kOL0Iv5iO6Y02vCnsY8jBaCnNlyasmH/iEICMDnotu48VirdgW6Ss7fj0iwb/ CgxA== X-Gm-Message-State: ALyK8tJc4I1yQ5WQkMB10LEKSlv0uw804eKkjkJL3bDxfLFzkqSr4fMVjATP/bBqHdtaFcfX X-Received: by 10.28.44.193 with SMTP id s184mr15875790wms.73.1469109221448; Thu, 21 Jul 2016 06:53:41 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id g184sm4260615wme.15.2016.07.21.06.53.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jul 2016 06:53:40 -0700 (PDT) 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)); }