linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: dhowells@redhat.com, viro@ZenIV.linux.org.uk,
	Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH 3/3] VFS: call d_inode() from d_backing_inode()
Date: Wed, 20 Jun 2018 14:39:10 -0500	[thread overview]
Message-ID: <20180620193910.6804-4-rgoldwyn@suse.de> (raw)
In-Reply-To: <20180620193910.6804-1-rgoldwyn@suse.de>

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

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 <rgoldwyn@suse.com>
---
 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 */
-- 
2.16.4

  parent reply	other threads:[~2018-06-20 19:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 19:39 [PATCH 0/3] VFS: Revert irrelevant dcache patches Goldwyn Rodrigues
2018-06-20 19:39 ` [PATCH 1/3] Revert: "VFS: Add a fallthrough flag for marking virtual dentries" Goldwyn Rodrigues
2018-06-20 19:39 ` [PATCH 2/3] Revert: "VFS: Add a whiteout dentry type" Goldwyn Rodrigues
2018-06-20 19:39 ` Goldwyn Rodrigues [this message]
2018-06-21 12:22   ` [PATCH 3/3] VFS: call d_inode() from d_backing_inode() Christoph Hellwig
2018-06-21 12:58     ` Goldwyn Rodrigues
2018-06-21 13:01       ` Christoph Hellwig
2018-06-21 13:40       ` Amir Goldstein

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=20180620193910.6804-4-rgoldwyn@suse.de \
    --to=rgoldwyn@suse.de \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    --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).