From patchwork Fri Sep 16 12:19:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9335681 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 19F6F6077F for ; Fri, 16 Sep 2016 12:22:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BE2129F10 for ; Fri, 16 Sep 2016 12:22:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00AEA29F29; Fri, 16 Sep 2016 12:22:49 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7DBFE29F10 for ; Fri, 16 Sep 2016 12:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934890AbcIPMVl (ORCPT ); Fri, 16 Sep 2016 08:21:41 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:37674 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934873AbcIPMTq (ORCPT ); Fri, 16 Sep 2016 08:19:46 -0400 Received: by mail-wm0-f41.google.com with SMTP id k186so38179846wmd.0 for ; Fri, 16 Sep 2016 05:19:45 -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=vn7X4uw1cxuBQsg/uE1rBKO4Yj2YQ28FP71/OfyyedA=; b=Tm9Lz5Y66u+hC3uV8/lp0wH2KDMAdGT3weMbuf9GTEUQX7AvO6bfH36of1NpVFSN67 jaylvrk5yLxAFIsrGVbc7Hh2mDbsYzx5Id0ZLsuIoIDsOje1/ZjJRz96wyBEfs7GEEEd kUI15rm6bjp9ZRlgINtOGOQf06+VCc0/OMiSN7pQI/tmYtS7pzM0BhKLKei9U16SNf9+ cyrzas4t8MXKwuqDMdfxrN6gLGDy75RsUgt19Rt6k/4m6RekEcwmF2lrP49yTuggjMYc eqBj+wskTFpsT2zHRVoyjYDC6B+D1bDa3kdyZweuoHvVqExCP1vSYGmVhl6rJ32XEOwu jFvQ== X-Gm-Message-State: AE9vXwP0UpLfuH1F0JoKc6/kVth85OaGbLDkiQweL0PlLCokgpS78edDj+Fk8HXf993VCFZa X-Received: by 10.28.173.205 with SMTP id w196mr8073155wme.86.1474028384099; Fri, 16 Sep 2016 05:19:44 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (4E5CE698.dsl.pool.telekom.hu. [78.92.230.152]) by smtp.gmail.com with ESMTPSA id n7sm8169812wjs.34.2016.09.16.05.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Sep 2016 05:19:43 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH 06/12] vfs: make argument of d_real_inode() const Date: Fri, 16 Sep 2016 14:19:25 +0200 Message-Id: <1474028371-21288-7-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1474028371-21288-1-git-send-email-mszeredi@redhat.com> References: <1474028371-21288-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 Acked-by: Jeff Layton --- 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 5ff3e9a4fe5f..5beed7b30561 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -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)); }