diff options
Diffstat (limited to 'fs/notify/fsnotify.c')
-rw-r--r-- | fs/notify/fsnotify.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 56bee0f10c38..d5654629c659 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -26,6 +26,15 @@ | |||
26 | #include "fsnotify.h" | 26 | #include "fsnotify.h" |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Clear all of the marks on an inode when it is being evicted from core | ||
30 | */ | ||
31 | void __fsnotify_inode_delete(struct inode *inode) | ||
32 | { | ||
33 | fsnotify_clear_marks_by_inode(inode); | ||
34 | } | ||
35 | EXPORT_SYMBOL_GPL(__fsnotify_inode_delete); | ||
36 | |||
37 | /* | ||
29 | * This is the main call to fsnotify. The VFS calls into hook specific functions | 38 | * This is the main call to fsnotify. The VFS calls into hook specific functions |
30 | * in linux/fsnotify.h. Those functions then in turn call here. Here will call | 39 | * in linux/fsnotify.h. Those functions then in turn call here. Here will call |
31 | * out to all of the registered fsnotify_group. Those groups can then use the | 40 | * out to all of the registered fsnotify_group. Those groups can then use the |
@@ -43,6 +52,8 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is) | |||
43 | if (!(mask & fsnotify_mask)) | 52 | if (!(mask & fsnotify_mask)) |
44 | return; | 53 | return; |
45 | 54 | ||
55 | if (!(mask & to_tell->i_fsnotify_mask)) | ||
56 | return; | ||
46 | /* | 57 | /* |
47 | * SRCU!! the groups list is very very much read only and the path is | 58 | * SRCU!! the groups list is very very much read only and the path is |
48 | * very hot. The VAST majority of events are not going to need to do | 59 | * very hot. The VAST majority of events are not going to need to do |
@@ -51,6 +62,8 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is) | |||
51 | idx = srcu_read_lock(&fsnotify_grp_srcu); | 62 | idx = srcu_read_lock(&fsnotify_grp_srcu); |
52 | list_for_each_entry_rcu(group, &fsnotify_groups, group_list) { | 63 | list_for_each_entry_rcu(group, &fsnotify_groups, group_list) { |
53 | if (mask & group->mask) { | 64 | if (mask & group->mask) { |
65 | if (!group->ops->should_send_event(group, to_tell, mask)) | ||
66 | continue; | ||
54 | if (!event) { | 67 | if (!event) { |
55 | event = fsnotify_create_event(to_tell, mask, data, data_is); | 68 | event = fsnotify_create_event(to_tell, mask, data, data_is); |
56 | /* shit, we OOM'd and now we can't tell, maybe | 69 | /* shit, we OOM'd and now we can't tell, maybe |