diff options
author | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:38 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:52 -0400 |
commit | 3a9b16b407f10b2a771bcae13fb5791e527d6bcf (patch) | |
tree | 0d88cac61bd6d3f5028eb0c9a45e7af9fbd24311 /fs/notify/fsnotify.c | |
parent | 8778abb9a88fc4a74d8776ffaadf7214cf33c61e (diff) |
fsnotify: send fsnotify_mark to groups in event handling functions
With the change of fsnotify to use srcu walking the marks list instead of
walking the global groups list we now know the mark in question. The code can
send the mark to the group's handling functions and the groups won't have to
find those marks themselves.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/fsnotify.c')
-rw-r--r-- | fs/notify/fsnotify.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 4678b416241e..59d639996cad 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -171,15 +171,16 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is) | |||
171 | } | 171 | } |
172 | 172 | ||
173 | static int send_to_group(struct fsnotify_group *group, struct inode *to_tell, | 173 | static int send_to_group(struct fsnotify_group *group, struct inode *to_tell, |
174 | struct vfsmount *mnt, __u32 mask, void *data, | 174 | struct vfsmount *mnt, struct fsnotify_mark *mark, |
175 | int data_is, u32 cookie, const unsigned char *file_name, | 175 | __u32 mask, void *data, int data_is, u32 cookie, |
176 | const unsigned char *file_name, | ||
176 | struct fsnotify_event **event) | 177 | struct fsnotify_event **event) |
177 | { | 178 | { |
178 | pr_debug("%s: group=%p to_tell=%p mnt=%p mask=%x data=%p data_is=%d" | 179 | pr_debug("%s: group=%p to_tell=%p mnt=%p mark=%p mask=%x data=%p" |
179 | " cookie=%d event=%p\n", __func__, group, to_tell, mnt, | 180 | " data_is=%d cookie=%d event=%p\n", __func__, group, to_tell, |
180 | mask, data, data_is, cookie, *event); | 181 | mnt, mark, mask, data, data_is, cookie, *event); |
181 | 182 | ||
182 | if (!group->ops->should_send_event(group, to_tell, mnt, mask, | 183 | if (!group->ops->should_send_event(group, to_tell, mnt, mark, mask, |
183 | data, data_is)) | 184 | data, data_is)) |
184 | return 0; | 185 | return 0; |
185 | if (!*event) { | 186 | if (!*event) { |
@@ -189,7 +190,7 @@ static int send_to_group(struct fsnotify_group *group, struct inode *to_tell, | |||
189 | if (!*event) | 190 | if (!*event) |
190 | return -ENOMEM; | 191 | return -ENOMEM; |
191 | } | 192 | } |
192 | return group->ops->handle_event(group, *event); | 193 | return group->ops->handle_event(group, mark, *event); |
193 | } | 194 | } |
194 | 195 | ||
195 | static bool needed_by_vfsmount(__u32 test_mask, struct vfsmount *mnt) | 196 | static bool needed_by_vfsmount(__u32 test_mask, struct vfsmount *mnt) |
@@ -252,7 +253,7 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
252 | group = mark->group; | 253 | group = mark->group; |
253 | if (!group) | 254 | if (!group) |
254 | continue; | 255 | continue; |
255 | ret = send_to_group(group, to_tell, NULL, mask, | 256 | ret = send_to_group(group, to_tell, NULL, mark, mask, |
256 | data, data_is, cookie, file_name, | 257 | data, data_is, cookie, file_name, |
257 | &event); | 258 | &event); |
258 | if (ret) | 259 | if (ret) |
@@ -271,7 +272,7 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
271 | group = mark->group; | 272 | group = mark->group; |
272 | if (!group) | 273 | if (!group) |
273 | continue; | 274 | continue; |
274 | ret = send_to_group(group, to_tell, mnt, mask, | 275 | ret = send_to_group(group, to_tell, mnt, mark, mask, |
275 | data, data_is, cookie, file_name, | 276 | data, data_is, cookie, file_name, |
276 | &event); | 277 | &event); |
277 | if (ret) | 278 | if (ret) |