mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
fsnotify: merge file_set_fsnotify_mode_from_watchers() with open perm hook
Create helper fsnotify_open_perm_and_set_mode() that moves the fsnotify_open_perm() hook into file_set_fsnotify_mode_from_watchers(). This will allow some more optimizations. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20250708143641.418603-2-amir73il@gmail.com
This commit is contained in:
@@ -196,7 +196,7 @@ static int init_file(struct file *f, int flags, const struct cred *cred)
|
||||
file_ref_init(&f->f_ref, 1);
|
||||
/*
|
||||
* Disable permission and pre-content events for all files by default.
|
||||
* They may be enabled later by file_set_fsnotify_mode_from_watchers().
|
||||
* They may be enabled later by fsnotify_open_perm_and_set_mode().
|
||||
*/
|
||||
file_set_fsnotify_mode(f, FMODE_NONOTIFY_PERM);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user