[PATCH 3/3] VFS: call d_inode() from d_backing_inode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>

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@xxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux