From patchwork Wed Jun 20 19:39:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 10478625 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 3541A60230 for ; Wed, 20 Jun 2018 19:39:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25FB028F5F for ; Wed, 20 Jun 2018 19:39:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AC4828F67; Wed, 20 Jun 2018 19:39:35 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 99C9A28F5F for ; Wed, 20 Jun 2018 19:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932383AbeFTTjc (ORCPT ); Wed, 20 Jun 2018 15:39:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:52346 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932847AbeFTTj1 (ORCPT ); Wed, 20 Jun 2018 15:39:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB08DAE6D; Wed, 20 Jun 2018 19:39:26 +0000 (UTC) From: Goldwyn Rodrigues To: linux-fsdevel@vger.kernel.org Cc: dhowells@redhat.com, viro@ZenIV.linux.org.uk, Goldwyn Rodrigues Subject: [PATCH 3/3] VFS: call d_inode() from d_backing_inode() Date: Wed, 20 Jun 2018 14:39:10 -0500 Message-Id: <20180620193910.6804-4-rgoldwyn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180620193910.6804-1-rgoldwyn@suse.de> References: <20180620193910.6804-1-rgoldwyn@suse.de> 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 From: Goldwyn Rodrigues d_backing_inode and d_inode perform the same task: return dentry->d_inode Introduced in df1a085af1f6 ("VFS: Add a fallthrough flag for marking virtual dentries") These functions are being used by many but it does not serve the purpose it was originally meant for. So, changed the comments which are not relevant anymore and removed d_backing_dentry() which is not used. Signed-off-by: Goldwyn Rodrigues --- include/linux/dcache.h | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6bb1ba14af8d..5abb0866dca5 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -491,9 +491,6 @@ static inline unsigned long vfs_pressure_ratio(unsigned long val) /** * d_inode - Get the actual inode of this dentry * @dentry: The dentry to query - * - * This is the helper normal filesystems should use to get at their own inodes - * in their own dentries and ignore the layering superimposed upon them. */ static inline struct inode *d_inode(const struct dentry *dentry) { @@ -503,9 +500,6 @@ static inline struct inode *d_inode(const struct dentry *dentry) /** * d_inode_rcu - Get the actual inode of this dentry with READ_ONCE() * @dentry: The dentry to query - * - * This is the helper normal filesystems should use to get at their own inodes - * in their own dentries and ignore the layering superimposed upon them. */ static inline struct inode *d_inode_rcu(const struct dentry *dentry) { @@ -513,35 +507,12 @@ static inline struct inode *d_inode_rcu(const struct dentry *dentry) } /** - * d_backing_inode - Get upper or lower inode we should be using - * @upper: The upper layer - * - * This is the helper that should be used to get at the inode that will be used - * if this dentry were to be opened as a file. The inode may be on the upper - * dentry or it may be on a lower dentry pinned by the upper. - * - * Normal filesystems should not use this to access their own inodes. - */ -static inline struct inode *d_backing_inode(const struct dentry *upper) -{ - struct inode *inode = upper->d_inode; - - return inode; -} - -/** - * d_backing_dentry - Get upper or lower dentry we should be using - * @upper: The upper layer - * - * This is the helper that should be used to get the dentry of the inode that - * will be used if this dentry were opened as a file. It may be the upper - * dentry or it may be a lower dentry pinned by the upper. - * - * Normal filesystems should not use this to access their own dentries. + * d_backing_inode - same as d_inode(). Use d_inode() instead. + * @dentry: dentry to query */ -static inline struct dentry *d_backing_dentry(struct dentry *upper) +static inline struct inode *d_backing_inode(const struct dentry *dentry) { - return upper; + return d_inode(dentry); } /* d_real() flags */