Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207685
b: refs/heads/master
c: e898386
h: refs/heads/master
i:
  207683: 3c57e37
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 555d91a commit b9a5e0e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9e4e3bd0495fea9e8f8e712889c9cd8ffa43c94
refs/heads/master: e898386146deb49a0b45ff1887d9da149c003209
31 changes: 31 additions & 0 deletions trunk/fs/notify/fsnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,33 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
}
EXPORT_SYMBOL_GPL(__fsnotify_parent);

void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is)
{
struct fsnotify_mark *mark;
struct hlist_node *node;

if (!hlist_empty(&inode->i_fsnotify_marks)) {
spin_lock(&inode->i_lock);
hlist_for_each_entry(mark, node, &inode->i_fsnotify_marks, i.i_list) {
mark->ignored_mask = 0;
}
spin_unlock(&inode->i_lock);
}

if (data_is == FSNOTIFY_EVENT_PATH) {
struct vfsmount *mnt;

mnt = ((struct path *)data)->mnt;
if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) {
spin_lock(&mnt->mnt_root->d_lock);
hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) {
mark->ignored_mask = 0;
}
spin_unlock(&mnt->mnt_root->d_lock);
}
}
}

static void send_to_group(struct fsnotify_group *group, struct inode *to_tell,
struct vfsmount *mnt, __u32 mask, void *data,
int data_is, u32 cookie, const char *file_name,
Expand Down Expand Up @@ -170,6 +197,7 @@ static bool needed_by_vfsmount(__u32 test_mask, struct vfsmount *mnt)

return (test_mask & mnt->mnt_fsnotify_mask);
}

/*
* This is the main call to fsnotify. The VFS calls into hook specific functions
* in linux/fsnotify.h. Those functions then in turn call here. Here will call
Expand All @@ -190,6 +218,9 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const
list_empty(&fsnotify_vfsmount_groups))
return;

if (mask & FS_MODIFY)
__fsnotify_flush_ignored_mask(to_tell, data, data_is);

/* if none of the directed listeners or vfsmount listeners care */
if (!(test_mask & fsnotify_inode_mask) &&
!(test_mask & fsnotify_vfsmount_mask))
Expand Down

0 comments on commit b9a5e0e

Please sign in to comment.