diff options
| author | David Howells <dhowells@redhat.com> | 2013-06-13 18:37:49 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:13 -0400 |
| commit | c77cecee52e9b599da1f8ffd9170d4374c99a345 (patch) | |
| tree | 7f3b178cda88ca3e94cf2992b438ccabd7938a62 | |
| parent | 656d09df8f73b6f2ae0c7205c6eb79f1642353f8 (diff) | |
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>
| -rw-r--r-- | fs/file_table.c | 2 | ||||
| -rw-r--r-- | include/linux/fsnotify.h | 8 | ||||
| -rw-r--r-- | security/integrity/ima/ima_main.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 485dc0eddd67..08e719b884ca 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
| @@ -227,7 +227,7 @@ static void __fput(struct file *file) | |||
| 227 | { | 227 | { |
| 228 | struct dentry *dentry = file->f_path.dentry; | 228 | struct dentry *dentry = file->f_path.dentry; |
| 229 | struct vfsmount *mnt = file->f_path.mnt; | 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 | might_sleep(); | 232 | might_sleep(); |
| 233 | 233 | ||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index a78680a92dba..1c804b057fb1 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -38,7 +38,7 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3 | |||
| 38 | static inline int fsnotify_perm(struct file *file, int mask) | 38 | static inline int fsnotify_perm(struct file *file, int mask) |
| 39 | { | 39 | { |
| 40 | struct path *path = &file->f_path; | 40 | struct path *path = &file->f_path; |
| 41 | struct inode *inode = path->dentry->d_inode; | 41 | struct inode *inode = file_inode(file); |
| 42 | __u32 fsnotify_mask = 0; | 42 | __u32 fsnotify_mask = 0; |
| 43 | int ret; | 43 | int ret; |
| 44 | 44 | ||
| @@ -192,7 +192,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
| 192 | static inline void fsnotify_access(struct file *file) | 192 | static inline void fsnotify_access(struct file *file) |
| 193 | { | 193 | { |
| 194 | struct path *path = &file->f_path; | 194 | struct path *path = &file->f_path; |
| 195 | struct inode *inode = path->dentry->d_inode; | 195 | struct inode *inode = file_inode(file); |
| 196 | __u32 mask = FS_ACCESS; | 196 | __u32 mask = FS_ACCESS; |
| 197 | 197 | ||
| 198 | if (S_ISDIR(inode->i_mode)) | 198 | if (S_ISDIR(inode->i_mode)) |
| @@ -210,7 +210,7 @@ static inline void fsnotify_access(struct file *file) | |||
| 210 | static inline void fsnotify_modify(struct file *file) | 210 | static inline void fsnotify_modify(struct file *file) |
| 211 | { | 211 | { |
| 212 | struct path *path = &file->f_path; | 212 | struct path *path = &file->f_path; |
| 213 | struct inode *inode = path->dentry->d_inode; | 213 | struct inode *inode = file_inode(file); |
| 214 | __u32 mask = FS_MODIFY; | 214 | __u32 mask = FS_MODIFY; |
| 215 | 215 | ||
| 216 | if (S_ISDIR(inode->i_mode)) | 216 | if (S_ISDIR(inode->i_mode)) |
| @@ -228,7 +228,7 @@ static inline void fsnotify_modify(struct file *file) | |||
| 228 | static inline void fsnotify_open(struct file *file) | 228 | static inline void fsnotify_open(struct file *file) |
| 229 | { | 229 | { |
| 230 | struct path *path = &file->f_path; | 230 | struct path *path = &file->f_path; |
| 231 | struct inode *inode = path->dentry->d_inode; | 231 | struct inode *inode = file_inode(file); |
| 232 | __u32 mask = FS_OPEN; | 232 | __u32 mask = FS_OPEN; |
| 233 | 233 | ||
| 234 | if (S_ISDIR(inode->i_mode)) | 234 | if (S_ISDIR(inode->i_mode)) |
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 6c491a63128e..e9508d5bbfcf 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
| @@ -57,7 +57,7 @@ __setup("ima_hash=", hash_setup); | |||
| 57 | static void ima_rdwr_violation_check(struct file *file) | 57 | static void ima_rdwr_violation_check(struct file *file) |
| 58 | { | 58 | { |
| 59 | struct dentry *dentry = file->f_path.dentry; | 59 | struct dentry *dentry = file->f_path.dentry; |
| 60 | struct inode *inode = dentry->d_inode; | 60 | struct inode *inode = file_inode(file); |
| 61 | fmode_t mode = file->f_mode; | 61 | fmode_t mode = file->f_mode; |
| 62 | int must_measure; | 62 | int must_measure; |
| 63 | bool send_tomtou = false, send_writers = false; | 63 | bool send_tomtou = false, send_writers = false; |
