Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217815
b: refs/heads/master
c: 4d4eb36
h: refs/heads/master
i:
  217813: 01921d7
  217811: 70eadd6
  217807: fb1b7a3
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Oct 26, 2010
1 parent 764fc98 commit 0086e47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be9eee2e8b87e335531a3ae13abb8d26e834c438
refs/heads/master: 4d4eb36679adbdd75495e1bbfe7ac40e4ae41dea
33 changes: 5 additions & 28 deletions trunk/fs/notify/fsnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,38 +88,19 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
{
struct dentry *parent;
struct inode *p_inode;
bool send = false;
bool should_update_children = false;

if (!dentry)
dentry = path->dentry;

if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED))
return;

spin_lock(&dentry->d_lock);
parent = dentry->d_parent;
parent = dget_parent(dentry);
p_inode = parent->d_inode;

if (fsnotify_inode_watches_children(p_inode)) {
if (p_inode->i_fsnotify_mask & mask) {
dget(parent);
send = true;
}
} else {
/*
* The parent doesn't care about events on it's children but
* at least one child thought it did. We need to run all the
* children and update their d_flags to let them know p_inode
* doesn't care about them any more.
*/
dget(parent);
should_update_children = true;
}

spin_unlock(&dentry->d_lock);

if (send) {
if (unlikely(!fsnotify_inode_watches_children(p_inode)))
__fsnotify_update_child_dentry_flags(p_inode);
else if (p_inode->i_fsnotify_mask & mask) {
/* we are notifying a parent so come up with the new mask which
* specifies these are events which came from a child. */
mask |= FS_EVENT_ON_CHILD;
Expand All @@ -130,13 +111,9 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
else
fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
dentry->d_name.name, 0);
dput(parent);
}

if (unlikely(should_update_children)) {
__fsnotify_update_child_dentry_flags(p_inode);
dput(parent);
}
dput(parent);
}
EXPORT_SYMBOL_GPL(__fsnotify_parent);

Expand Down

0 comments on commit 0086e47

Please sign in to comment.