OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx*
[safe/jmp/linux-2.6] / fs / notify / fsnotify.c
index 7fc7600..037e878 100644 (file)
@@ -114,7 +114,8 @@ void __fsnotify_parent(struct dentry *dentry, __u32 mask)
                 * specifies these are events which came from a child. */
                mask |= FS_EVENT_ON_CHILD;
 
-               fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE);
+               fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
+                        dentry->d_name.name, 0);
                dput(parent);
        }
 
@@ -131,19 +132,21 @@ EXPORT_SYMBOL_GPL(__fsnotify_parent);
  * out to all of the registered fsnotify_group.  Those groups can then use the
  * notification event in whatever means they feel necessary.
  */
-void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is)
+void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const char *file_name, u32 cookie)
 {
        struct fsnotify_group *group;
        struct fsnotify_event *event = NULL;
        int idx;
+       /* global tests shouldn't care about events on child only the specific event */
+       __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD);
 
        if (list_empty(&fsnotify_groups))
                return;
 
-       if (!(mask & fsnotify_mask))
+       if (!(test_mask & fsnotify_mask))
                return;
 
-       if (!(mask & to_tell->i_fsnotify_mask))
+       if (!(test_mask & to_tell->i_fsnotify_mask))
                return;
        /*
         * SRCU!!  the groups list is very very much read only and the path is
@@ -152,11 +155,13 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is)
         */
        idx = srcu_read_lock(&fsnotify_grp_srcu);
        list_for_each_entry_rcu(group, &fsnotify_groups, group_list) {
-               if (mask & group->mask) {
+               if (test_mask & group->mask) {
                        if (!group->ops->should_send_event(group, to_tell, mask))
                                continue;
                        if (!event) {
-                               event = fsnotify_create_event(to_tell, mask, data, data_is);
+                               event = fsnotify_create_event(to_tell, mask, data,
+                                                             data_is, file_name, cookie,
+                                                             GFP_KERNEL);
                                /* shit, we OOM'd and now we can't tell, maybe
                                 * someday someone else will want to do something
                                 * here */