Lines Matching full:file
104 * is on a file/dentry.
116 static inline int fsnotify_file(struct file *file, __u32 mask) in fsnotify_file() argument
122 * handle creation / destruction events and not "real" file events. in fsnotify_file()
124 if (FMODE_FSNOTIFY_NONE(file->f_mode)) in fsnotify_file()
127 return fsnotify_path(&file->f_path, mask); in fsnotify_file()
132 void file_set_fsnotify_mode_from_watchers(struct file *file);
135 * fsnotify_file_area_perm - permission hook before access to file range
137 static inline int fsnotify_file_area_perm(struct file *file, int perm_mask, in fsnotify_file_area_perm() argument
142 * (e.g. by HSM filling a file on access), so sb freeze protection in fsnotify_file_area_perm()
145 lockdep_assert_once(file_write_not_started(file)); in fsnotify_file_area_perm()
150 if (likely(!FMODE_FSNOTIFY_PERM(file->f_mode))) in fsnotify_file_area_perm()
156 if (unlikely(FMODE_FSNOTIFY_HSM(file->f_mode))) { in fsnotify_file_area_perm()
157 int ret = fsnotify_pre_content(&file->f_path, ppos, count); in fsnotify_file_area_perm()
170 return fsnotify_path(&file->f_path, FS_ACCESS_PERM); in fsnotify_file_area_perm()
174 * fsnotify_mmap_perm - permission hook before mmap of file range
176 static inline int fsnotify_mmap_perm(struct file *file, int prot, in fsnotify_mmap_perm() argument
182 if (!file || likely(!FMODE_FSNOTIFY_HSM(file->f_mode))) in fsnotify_mmap_perm()
185 return fsnotify_pre_content(&file->f_path, &off, len); in fsnotify_mmap_perm()
189 * fsnotify_truncate_perm - permission hook before file truncate
204 * fsnotify_file_perm - permission hook before file access (unknown range)
206 static inline int fsnotify_file_perm(struct file *file, int perm_mask) in fsnotify_file_perm() argument
208 return fsnotify_file_area_perm(file, perm_mask, NULL, 0); in fsnotify_file_perm()
212 * fsnotify_open_perm - permission hook before file open
214 static inline int fsnotify_open_perm(struct file *file) in fsnotify_open_perm() argument
218 if (likely(!FMODE_FSNOTIFY_PERM(file->f_mode))) in fsnotify_open_perm()
221 if (file->f_flags & __FMODE_EXEC) { in fsnotify_open_perm()
222 ret = fsnotify_path(&file->f_path, FS_OPEN_EXEC_PERM); in fsnotify_open_perm()
227 return fsnotify_path(&file->f_path, FS_OPEN_PERM); in fsnotify_open_perm()
231 static inline void file_set_fsnotify_mode_from_watchers(struct file *file) in file_set_fsnotify_mode_from_watchers() argument
235 static inline int fsnotify_file_area_perm(struct file *file, int perm_mask, in fsnotify_file_area_perm() argument
241 static inline int fsnotify_mmap_perm(struct file *file, int prot, in fsnotify_mmap_perm() argument
252 static inline int fsnotify_file_perm(struct file *file, int perm_mask) in fsnotify_file_perm() argument
257 static inline int fsnotify_open_perm(struct file *file) in fsnotify_open_perm() argument
272 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
441 * fsnotify_access - file was read
443 static inline void fsnotify_access(struct file *file) in fsnotify_access() argument
445 fsnotify_file(file, FS_ACCESS); in fsnotify_access()
449 * fsnotify_modify - file was modified
451 static inline void fsnotify_modify(struct file *file) in fsnotify_modify() argument
453 fsnotify_file(file, FS_MODIFY); in fsnotify_modify()
457 * fsnotify_open - file was opened
459 static inline void fsnotify_open(struct file *file) in fsnotify_open() argument
463 if (file->f_flags & __FMODE_EXEC) in fsnotify_open()
466 fsnotify_file(file, mask); in fsnotify_open()
470 * fsnotify_close - file was closed
472 static inline void fsnotify_close(struct file *file) in fsnotify_close() argument
474 __u32 mask = (file->f_mode & FMODE_WRITE) ? FS_CLOSE_WRITE : in fsnotify_close()
477 fsnotify_file(file, mask); in fsnotify_close()
489 * fsnotify_change - notify_change event. file was modified and/or metadata