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 /include/linux/fs.h | |
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 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4e686a099465..74a907b8b950 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -769,6 +769,7 @@ struct file { | |||
769 | } f_u; | 769 | } f_u; |
770 | struct path f_path; | 770 | struct path f_path; |
771 | #define f_dentry f_path.dentry | 771 | #define f_dentry f_path.dentry |
772 | struct inode *f_inode; /* cached value */ | ||
772 | const struct file_operations *f_op; | 773 | const struct file_operations *f_op; |
773 | 774 | ||
774 | /* | 775 | /* |
@@ -2217,7 +2218,7 @@ static inline bool execute_ok(struct inode *inode) | |||
2217 | 2218 | ||
2218 | static inline struct inode *file_inode(struct file *f) | 2219 | static inline struct inode *file_inode(struct file *f) |
2219 | { | 2220 | { |
2220 | return f->f_path.dentry->d_inode; | 2221 | return f->f_inode; |
2221 | } | 2222 | } |
2222 | 2223 | ||
2223 | /* | 2224 | /* |