Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Replace a bunch of file->dentry->d_inode refs with file_inode()

Replace a bunch of file->dentry->d_inode refs with file_inode().

In __fput(), use file->f_inode instead so as not to be affected by any tricks
that file_inode() might grow.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

David Howells and committed by
Al Viro
c77cecee 656d09df

+6 -6
+1 -1
fs/file_table.c
··· 227 227 { 228 228 struct dentry *dentry = file->f_path.dentry; 229 229 struct vfsmount *mnt = file->f_path.mnt; 230 - struct inode *inode = dentry->d_inode; 230 + struct inode *inode = file->f_inode; 231 231 232 232 might_sleep(); 233 233
+4 -4
include/linux/fsnotify.h
··· 38 38 static inline int fsnotify_perm(struct file *file, int mask) 39 39 { 40 40 struct path *path = &file->f_path; 41 - struct inode *inode = path->dentry->d_inode; 41 + struct inode *inode = file_inode(file); 42 42 __u32 fsnotify_mask = 0; 43 43 int ret; 44 44 ··· 192 192 static inline void fsnotify_access(struct file *file) 193 193 { 194 194 struct path *path = &file->f_path; 195 - struct inode *inode = path->dentry->d_inode; 195 + struct inode *inode = file_inode(file); 196 196 __u32 mask = FS_ACCESS; 197 197 198 198 if (S_ISDIR(inode->i_mode)) ··· 210 210 static inline void fsnotify_modify(struct file *file) 211 211 { 212 212 struct path *path = &file->f_path; 213 - struct inode *inode = path->dentry->d_inode; 213 + struct inode *inode = file_inode(file); 214 214 __u32 mask = FS_MODIFY; 215 215 216 216 if (S_ISDIR(inode->i_mode)) ··· 228 228 static inline void fsnotify_open(struct file *file) 229 229 { 230 230 struct path *path = &file->f_path; 231 - struct inode *inode = path->dentry->d_inode; 231 + struct inode *inode = file_inode(file); 232 232 __u32 mask = FS_OPEN; 233 233 234 234 if (S_ISDIR(inode->i_mode))
+1 -1
security/integrity/ima/ima_main.c
··· 57 57 static void ima_rdwr_violation_check(struct file *file) 58 58 { 59 59 struct dentry *dentry = file->f_path.dentry; 60 - struct inode *inode = dentry->d_inode; 60 + struct inode *inode = file_inode(file); 61 61 fmode_t mode = file->f_mode; 62 62 int must_measure; 63 63 bool send_tomtou = false, send_writers = false;