Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7416
b: refs/heads/master
c: 7ea6040
h: refs/heads/master
v: v3
  • Loading branch information
John McCutchan authored and Linus Torvalds committed Sep 7, 2005
1 parent 102f3bc commit 4558557
Show file tree
Hide file tree
Showing 3 changed files with 10 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: 8191151d0933d65fb6b659ffbd765479f0f200e1
refs/heads/master: 7ea6040b0eff07d3a9a4e2d248ac137c6ad02d42
9 changes: 8 additions & 1 deletion trunk/fs/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
struct nameidata nd;
struct file *filp;
int ret, fput_needed;
int mask_add = 0;

filp = fget_light(fd, &fput_needed);
if (unlikely(!filp))
Expand All @@ -953,6 +954,9 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
down(&inode->inotify_sem);
down(&dev->sem);

if (mask & IN_MASK_ADD)
mask_add = 1;

/* don't let user-space set invalid bits: we don't want flags set */
mask &= IN_ALL_EVENTS;
if (unlikely(!mask)) {
Expand All @@ -966,7 +970,10 @@ asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
*/
old = inode_find_dev(inode, dev);
if (unlikely(old)) {
old->mask = mask;
if (mask_add)
old->mask |= mask;
else
old->mask = mask;
ret = old->wd;
goto out;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/inotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct inotify_event {
#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */

/* special flags */
#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
#define IN_ISDIR 0x40000000 /* event occurred against dir */
#define IN_ONESHOT 0x80000000 /* only send event once */

Expand Down

0 comments on commit 4558557

Please sign in to comment.