diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-01 19:48:30 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-01 19:48:30 -0500 |
commit | dd37978c50bc8b354e5c4633f69387f16572fdac (patch) | |
tree | d233c7027f26869485f96556cc9cddacbb3a8f2d /fs/open.c | |
parent | 5e608671dfbfd6a9556c31df65a4f147439eed59 (diff) |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -689,7 +689,7 @@ static int do_dentry_open(struct file *f, | |||
689 | f->f_mode = FMODE_PATH; | 689 | f->f_mode = FMODE_PATH; |
690 | 690 | ||
691 | path_get(&f->f_path); | 691 | path_get(&f->f_path); |
692 | inode = file_inode(f); | 692 | inode = f->f_inode = f->f_path.dentry->d_inode; |
693 | if (f->f_mode & FMODE_WRITE) { | 693 | if (f->f_mode & FMODE_WRITE) { |
694 | error = __get_file_write_access(inode, f->f_path.mnt); | 694 | error = __get_file_write_access(inode, f->f_path.mnt); |
695 | if (error) | 695 | if (error) |
@@ -752,6 +752,7 @@ cleanup_file: | |||
752 | path_put(&f->f_path); | 752 | path_put(&f->f_path); |
753 | f->f_path.mnt = NULL; | 753 | f->f_path.mnt = NULL; |
754 | f->f_path.dentry = NULL; | 754 | f->f_path.dentry = NULL; |
755 | f->f_inode = NULL; | ||
755 | return error; | 756 | return error; |
756 | } | 757 | } |
757 | 758 | ||