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/file_table.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/file_table.c')
-rw-r--r-- | fs/file_table.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index aa07d3684a2e..cd4d87a82951 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -176,6 +176,7 @@ struct file *alloc_file(struct path *path, fmode_t mode, | |||
176 | return file; | 176 | return file; |
177 | 177 | ||
178 | file->f_path = *path; | 178 | file->f_path = *path; |
179 | file->f_inode = path->dentry->d_inode; | ||
179 | file->f_mapping = path->dentry->d_inode->i_mapping; | 180 | file->f_mapping = path->dentry->d_inode->i_mapping; |
180 | file->f_mode = mode; | 181 | file->f_mode = mode; |
181 | file->f_op = fop; | 182 | file->f_op = fop; |
@@ -258,6 +259,7 @@ static void __fput(struct file *file) | |||
258 | drop_file_write_access(file); | 259 | drop_file_write_access(file); |
259 | file->f_path.dentry = NULL; | 260 | file->f_path.dentry = NULL; |
260 | file->f_path.mnt = NULL; | 261 | file->f_path.mnt = NULL; |
262 | file->f_inode = NULL; | ||
261 | file_free(file); | 263 | file_free(file); |
262 | dput(dentry); | 264 | dput(dentry); |
263 | mntput(mnt); | 265 | mntput(mnt); |