Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207724
b: refs/heads/master
c: c496313
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 7e297af commit 46a7dbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 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: 7f6b6117e1803777fcf48fe31bd236a7fbf740db
refs/heads/master: c496313fcc35a41e176e3f19cdda2544ea3a32a6
22 changes: 5 additions & 17 deletions trunk/fs/notify/dnotify/dnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ static int dnotify_handle_event(struct fsnotify_group *group,
struct fsnotify_mark *mark,
struct fsnotify_event *event)
{
struct fsnotify_mark *fsn_mark = NULL;
struct dnotify_mark *dn_mark;
struct inode *to_tell;
struct dnotify_struct *dn;
Expand All @@ -96,12 +95,9 @@ static int dnotify_handle_event(struct fsnotify_group *group,

to_tell = event->to_tell;

fsn_mark = fsnotify_find_inode_mark(group, to_tell);
if (unlikely(!fsn_mark))
return 0;
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
dn_mark = container_of(mark, struct dnotify_mark, fsn_mark);

spin_lock(&fsn_mark->lock);
spin_lock(&mark->lock);
prev = &dn_mark->dn;
while ((dn = *prev) != NULL) {
if ((dn->dn_mask & test_mask) == 0) {
Expand All @@ -115,12 +111,11 @@ static int dnotify_handle_event(struct fsnotify_group *group,
else {
*prev = dn->dn_next;
kmem_cache_free(dnotify_struct_cache, dn);
dnotify_recalc_inode_mask(fsn_mark);
dnotify_recalc_inode_mask(mark);
}
}

spin_unlock(&fsn_mark->lock);
fsnotify_put_mark(fsn_mark);
spin_unlock(&mark->lock);

return 0;
}
Expand All @@ -134,7 +129,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
struct fsnotify_mark *mark, __u32 mask,
void *data, int data_type)
{
struct fsnotify_mark *fsn_mark;
bool send;

/* !dir_notify_enable should never get here, don't waste time checking
Expand All @@ -145,14 +139,8 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
if (!S_ISDIR(inode->i_mode))
return false;

fsn_mark = fsnotify_find_inode_mark(group, inode);
if (!fsn_mark)
return false;

mask = (mask & ~FS_EVENT_ON_CHILD);
send = (mask & fsn_mark->mask);

fsnotify_put_mark(fsn_mark); /* matches fsnotify_find_inode_mark */
send = (mask & mark->mask);

return send;
}
Expand Down

0 comments on commit 46a7dbb

Please sign in to comment.