@@ -26,19 +26,18 @@ static inline void fsnotify_d_instantiate(struct dentry *dentry,
2626}
2727
2828/* Notify this dentry's parent about a child's events. */
29- static inline void fsnotify_parent (struct path * path , struct dentry * dentry , __u32 mask )
29+ static inline void fsnotify_parent (struct file * file , struct dentry * dentry , __u32 mask )
3030{
3131 if (!dentry )
32- dentry = path -> dentry ;
32+ dentry = file -> f_path . dentry ;
3333
34- __fsnotify_parent (path , dentry , mask );
34+ __fsnotify_parent (file , dentry , mask );
3535}
3636
3737/* simple call site for access decisions */
3838static inline int fsnotify_perm (struct file * file , int mask )
3939{
40- struct path * path = & file -> f_path ;
41- struct inode * inode = path -> dentry -> d_inode ;
40+ struct inode * inode = file -> f_path .dentry -> d_inode ;
4241 __u32 fsnotify_mask = 0 ;
4342
4443 if (file -> f_mode & FMODE_NONOTIFY )
@@ -52,7 +51,7 @@ static inline int fsnotify_perm(struct file *file, int mask)
5251 else
5352 BUG ();
5453
55- return fsnotify (inode , fsnotify_mask , path , FSNOTIFY_EVENT_PATH , NULL , 0 );
54+ return fsnotify (inode , fsnotify_mask , file , FSNOTIFY_EVENT_FILE , NULL , 0 );
5655}
5756
5857/*
@@ -187,16 +186,15 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
187186 */
188187static inline void fsnotify_access (struct file * file )
189188{
190- struct path * path = & file -> f_path ;
191- struct inode * inode = path -> dentry -> d_inode ;
189+ struct inode * inode = file -> f_path .dentry -> d_inode ;
192190 __u32 mask = FS_ACCESS ;
193191
194192 if (S_ISDIR (inode -> i_mode ))
195193 mask |= FS_IN_ISDIR ;
196194
197195 if (!(file -> f_mode & FMODE_NONOTIFY )) {
198- fsnotify_parent (path , NULL , mask );
199- fsnotify (inode , mask , path , FSNOTIFY_EVENT_PATH , NULL , 0 );
196+ fsnotify_parent (file , NULL , mask );
197+ fsnotify (inode , mask , file , FSNOTIFY_EVENT_FILE , NULL , 0 );
200198 }
201199}
202200
@@ -205,16 +203,15 @@ static inline void fsnotify_access(struct file *file)
205203 */
206204static inline void fsnotify_modify (struct file * file )
207205{
208- struct path * path = & file -> f_path ;
209- struct inode * inode = path -> dentry -> d_inode ;
206+ struct inode * inode = file -> f_path .dentry -> d_inode ;
210207 __u32 mask = FS_MODIFY ;
211208
212209 if (S_ISDIR (inode -> i_mode ))
213210 mask |= FS_IN_ISDIR ;
214211
215212 if (!(file -> f_mode & FMODE_NONOTIFY )) {
216- fsnotify_parent (path , NULL , mask );
217- fsnotify (inode , mask , path , FSNOTIFY_EVENT_PATH , NULL , 0 );
213+ fsnotify_parent (file , NULL , mask );
214+ fsnotify (inode , mask , file , FSNOTIFY_EVENT_FILE , NULL , 0 );
218215 }
219216}
220217
@@ -223,16 +220,15 @@ static inline void fsnotify_modify(struct file *file)
223220 */
224221static inline void fsnotify_open (struct file * file )
225222{
226- struct path * path = & file -> f_path ;
227- struct inode * inode = path -> dentry -> d_inode ;
223+ struct inode * inode = file -> f_path .dentry -> d_inode ;
228224 __u32 mask = FS_OPEN ;
229225
230226 if (S_ISDIR (inode -> i_mode ))
231227 mask |= FS_IN_ISDIR ;
232228
233229 if (!(file -> f_mode & FMODE_NONOTIFY )) {
234- fsnotify_parent (path , NULL , mask );
235- fsnotify (inode , mask , path , FSNOTIFY_EVENT_PATH , NULL , 0 );
230+ fsnotify_parent (file , NULL , mask );
231+ fsnotify (inode , mask , file , FSNOTIFY_EVENT_FILE , NULL , 0 );
236232 }
237233}
238234
@@ -241,7 +237,6 @@ static inline void fsnotify_open(struct file *file)
241237 */
242238static inline void fsnotify_close (struct file * file )
243239{
244- struct path * path = & file -> f_path ;
245240 struct inode * inode = file -> f_path .dentry -> d_inode ;
246241 fmode_t mode = file -> f_mode ;
247242 __u32 mask = (mode & FMODE_WRITE ) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE ;
@@ -250,8 +245,8 @@ static inline void fsnotify_close(struct file *file)
250245 mask |= FS_IN_ISDIR ;
251246
252247 if (!(file -> f_mode & FMODE_NONOTIFY )) {
253- fsnotify_parent (path , NULL , mask );
254- fsnotify (inode , mask , path , FSNOTIFY_EVENT_PATH , NULL , 0 );
248+ fsnotify_parent (file , NULL , mask );
249+ fsnotify (inode , mask , file , FSNOTIFY_EVENT_FILE , NULL , 0 );
255250 }
256251}
257252
0 commit comments