Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83372
b: refs/heads/master
c: 1c17d18
h: refs/heads/master
v: v3
  • Loading branch information
Yan Zheng authored and Linus Torvalds committed Feb 6, 2008
1 parent a1bead9 commit 9ef2972
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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: 19c561a60ffe52df88dd63de0bff480ca094efe4
refs/heads/master: 1c17d18e3775485bf1e0ce79575eb637a94494a2
15 changes: 14 additions & 1 deletion trunk/fs/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ inotify_dev_get_event(struct inotify_device *dev)
return list_entry(dev->events.next, struct inotify_kernel_event, list);
}

/*
* inotify_dev_get_last_event - return the last event in the given dev's queue
*
* Caller must hold dev->ev_mutex.
*/
static inline struct inotify_kernel_event *
inotify_dev_get_last_event(struct inotify_device *dev)
{
if (list_empty(&dev->events))
return NULL;
return list_entry(dev->events.prev, struct inotify_kernel_event, list);
}

/*
* inotify_dev_queue_event - event handler registered with core inotify, adds
* a new event to the given device
Expand All @@ -273,7 +286,7 @@ static void inotify_dev_queue_event(struct inotify_watch *w, u32 wd, u32 mask,
put_inotify_watch(w); /* final put */

/* coalescing: drop this event if it is a dupe of the previous */
last = inotify_dev_get_event(dev);
last = inotify_dev_get_last_event(dev);
if (last && last->event.mask == mask && last->event.wd == wd &&
last->event.cookie == cookie) {
const char *lastname = last->name;
Expand Down

0 comments on commit 9ef2972

Please sign in to comment.