summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-01 19:48:30 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-01 19:48:30 -0500
commitdd37978c50bc8b354e5c4633f69387f16572fdac (patch)
treed233c7027f26869485f96556cc9cddacbb3a8f2d /fs/open.c
parent5e608671dfbfd6a9556c31df65a4f147439eed59 (diff)
downloadlinux-stable-dd37978c50bc8b354e5c4633f69387f16572fdac.tar.gz
linux-stable-dd37978c50bc8b354e5c4633f69387f16572fdac.tar.bz2
linux-stable-dd37978c50bc8b354e5c4633f69387f16572fdac.zip
cache the value of file_inode() in struct file
Note that this thing does *not* contribute to inode refcount; it's pinned down by dentry. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 62f907e3bc36..806d4589559f 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -689,7 +689,7 @@ static int do_dentry_open(struct file *f,
f->f_mode = FMODE_PATH;
path_get(&f->f_path);
- inode = file_inode(f);
+ inode = f->f_inode = f->f_path.dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = __get_file_write_access(inode, f->f_path.mnt);
if (error)
@@ -752,6 +752,7 @@ cleanup_file:
path_put(&f->f_path);
f->f_path.mnt = NULL;
f->f_path.dentry = NULL;
+ f->f_inode = NULL;
return error;
}