aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/dnotify/dnotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify/dnotify/dnotify.c')
-rw-r--r--fs/notify/dnotify/dnotify.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
index 1fedd5f7ccc4..abc8cbcfe90e 100644
--- a/fs/notify/dnotify/dnotify.c
+++ b/fs/notify/dnotify/dnotify.c
@@ -82,20 +82,23 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark)
82 * events. 82 * events.
83 */ 83 */
84static int dnotify_handle_event(struct fsnotify_group *group, 84static int dnotify_handle_event(struct fsnotify_group *group,
85 struct inode *inode,
85 struct fsnotify_mark *inode_mark, 86 struct fsnotify_mark *inode_mark,
86 struct fsnotify_mark *vfsmount_mark, 87 struct fsnotify_mark *vfsmount_mark,
87 struct fsnotify_event *event) 88 u32 mask, void *data, int data_type,
89 const unsigned char *file_name, u32 cookie)
88{ 90{
89 struct dnotify_mark *dn_mark; 91 struct dnotify_mark *dn_mark;
90 struct inode *to_tell;
91 struct dnotify_struct *dn; 92 struct dnotify_struct *dn;
92 struct dnotify_struct **prev; 93 struct dnotify_struct **prev;
93 struct fown_struct *fown; 94 struct fown_struct *fown;
94 __u32 test_mask = event->mask & ~FS_EVENT_ON_CHILD; 95 __u32 test_mask = mask & ~FS_EVENT_ON_CHILD;
95 96
96 BUG_ON(vfsmount_mark); 97 /* not a dir, dnotify doesn't care */
98 if (!S_ISDIR(inode->i_mode))
99 return 0;
97 100
98 to_tell = event->to_tell; 101 BUG_ON(vfsmount_mark);
99 102
100 dn_mark = container_of(inode_mark, struct dnotify_mark, fsn_mark); 103 dn_mark = container_of(inode_mark, struct dnotify_mark, fsn_mark);
101 104
@@ -122,23 +125,6 @@ static int dnotify_handle_event(struct fsnotify_group *group,
122 return 0; 125 return 0;
123} 126}
124 127
125/*
126 * Given an inode and mask determine if dnotify would be interested in sending
127 * userspace notification for that pair.
128 */
129static bool dnotify_should_send_event(struct fsnotify_group *group,
130 struct inode *inode,
131 struct fsnotify_mark *inode_mark,
132 struct fsnotify_mark *vfsmount_mark,
133 __u32 mask, void *data, int data_type)
134{
135 /* not a dir, dnotify doesn't care */
136 if (!S_ISDIR(inode->i_mode))
137 return false;
138
139 return true;
140}
141
142static void dnotify_free_mark(struct fsnotify_mark *fsn_mark) 128static void dnotify_free_mark(struct fsnotify_mark *fsn_mark)
143{ 129{
144 struct dnotify_mark *dn_mark = container_of(fsn_mark, 130 struct dnotify_mark *dn_mark = container_of(fsn_mark,
@@ -152,10 +138,6 @@ static void dnotify_free_mark(struct fsnotify_mark *fsn_mark)
152 138
153static struct fsnotify_ops dnotify_fsnotify_ops = { 139static struct fsnotify_ops dnotify_fsnotify_ops = {
154 .handle_event = dnotify_handle_event, 140 .handle_event = dnotify_handle_event,
155 .should_send_event = dnotify_should_send_event,
156 .free_group_priv = NULL,
157 .freeing_mark = NULL,
158 .free_event_priv = NULL,
159}; 141};
160 142
161/* 143/*