summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-06-11 11:09:47 -0400
committerEric Paris <eparis@redhat.com>2009-06-11 14:57:54 -0400
commitff52cc2158b32b3b979ca7802b1fd7c70f36e13c (patch)
tree1156b8a138adef3698636bf28ad3a739c3c5bff3 /include
parent63c882a05416e18de6fb59f7dd6da48f3bbe8273 (diff)
fsnotify: move events should indicate the event was on a child
fsnotify tells its listeners explicitly when an event happened on the given inode verses on the child of the given inode. (see __fsnotify_parent) However, the semantics of fsnotify_move() are such that we deliver events directly to the two parent directories in question (old_dir and new_dir) directly without using the __fsnotify_parent() call. fsnotify should be adding FS_EVENT_ON_CHILD for the notifications to these parents. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fsnotify.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index c25b39ddd62a..936f9aa8bb97 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -71,12 +71,11 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
struct inode *source = moved->d_inode;
u32 in_cookie = inotify_get_cookie();
u32 fs_cookie = fsnotify_get_cookie();
- __u32 old_dir_mask = 0;
- __u32 new_dir_mask = 0;
+ __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM);
+ __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO);
- if (old_dir == new_dir) {
- old_dir_mask = FS_DN_RENAME;
- }
+ if (old_dir == new_dir)
+ old_dir_mask |= FS_DN_RENAME;
if (isdir) {
isdir = IN_ISDIR;
@@ -84,9 +83,6 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
new_dir_mask |= FS_IN_ISDIR;
}
- old_dir_mask |= FS_MOVED_FROM;
- new_dir_mask |= FS_MOVED_TO;
-
inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir, in_cookie, old_name,
source);
inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, in_cookie, new_name,