diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-05-21 17:30:08 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:11:57 -0400 |
commit | decf3400879d02d0eafedea52c7f208587be062a (patch) | |
tree | 988c4006b9689c50cb43a379069dc5ea019567d8 /fs/namei.c | |
parent | a1eb33153090549e622ab42cb375af06614dd7a8 (diff) |
vfs: do_last(): use inode variable
Use helper variable instead of path->dentry->d_inode before complete_walk().
This will allow this code to be used in RCU mode.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c index f6b31c94c110..41445e7fd339 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2358,15 +2358,17 @@ static struct file *do_last(struct nameidata *nd, struct path *path, if (error) nd->flags |= LOOKUP_JUMPED; + BUG_ON(nd->flags & LOOKUP_RCU); + inode = path->dentry->d_inode; error = -ENOENT; - if (!path->dentry->d_inode) + if (!inode) goto exit_dput; - if (path->dentry->d_inode->i_op->follow_link) + if (inode->i_op->follow_link) return NULL; path_to_nameidata(path, nd); - nd->inode = path->dentry->d_inode; + nd->inode = inode; /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ error = complete_walk(nd); if (error) |