]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/fs.h
cache the value of file_inode() in struct file
[mirror_ubuntu-artful-kernel.git] / include / linux / fs.h
index 4e686a099465ea5279d329938bb406d6c45aa1b9..74a907b8b950c5c7d8e2e736003258429f01abf0 100644 (file)
@@ -769,6 +769,7 @@ struct file {
        } f_u;
        struct path             f_path;
 #define f_dentry       f_path.dentry
+       struct inode            *f_inode;       /* cached value */
        const struct file_operations    *f_op;
 
        /*
@@ -2217,7 +2218,7 @@ static inline bool execute_ok(struct inode *inode)
 
 static inline struct inode *file_inode(struct file *f)
 {
-       return f->f_path.dentry->d_inode;
+       return f->f_inode;
 }
 
 /*