summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-05-06 17:59:00 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-11 15:13:10 +0300
commit63afdfc781e10c6b3ec38274e6163422876caa9a (patch)
treef6f27074c78bbc7831df32d4c77aebb02fce6b81 /fs/namei.c
parent237d8b327abb428ff39b49e32ce07fdac468e32f (diff)
downloadlinux-63afdfc781e10c6b3ec38274e6163422876caa9a.tar.xz
VFS: Handle lower layer dentry/inode in pathwalk
Make use of d_backing_inode() in pathwalk to gain access to an inode or dentry that's on a lower layer. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 366b0f348d1c..bcacb3100317 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1423,7 +1423,7 @@ static int lookup_fast(struct nameidata *nd,
* This sequence count validates that the inode matches
* the dentry name information from lookup.
*/
- *inode = dentry->d_inode;
+ *inode = d_backing_inode(dentry);
negative = d_is_negative(dentry);
if (read_seqcount_retry(&dentry->d_seq, seq))
return -ECHILD;
@@ -1483,7 +1483,7 @@ unlazy:
path->dentry = dentry;
err = follow_managed(path, nd);
if (likely(!err))
- *inode = path->dentry->d_inode;
+ *inode = d_backing_inode(path->dentry);
return err;
need_lookup:
@@ -1618,7 +1618,7 @@ static int walk_component(struct nameidata *nd, int flags)
if (err < 0)
return err;
- inode = path.dentry->d_inode;
+ inode = d_backing_inode(path.dentry);
seq = 0; /* we are already out of RCU mode */
err = -ENOENT;
if (d_is_negative(path.dentry))
@@ -2471,7 +2471,7 @@ EXPORT_SYMBOL(__check_sticky);
*/
static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
{
- struct inode *inode = victim->d_inode;
+ struct inode *inode = d_backing_inode(victim);
int error;
if (d_is_negative(victim))
@@ -3054,7 +3054,7 @@ retry_lookup:
return error;
BUG_ON(nd->flags & LOOKUP_RCU);
- inode = path.dentry->d_inode;
+ inode = d_backing_inode(path.dentry);
seq = 0; /* out of RCU mode, so the value doesn't matter */
if (unlikely(d_is_negative(path.dentry))) {
path_to_nameidata(&path, nd);