aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fsnotify.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fsnotify.h')
-rw-r--r--include/linux/fsnotify.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index d07a92c94776..602c305c8585 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -21,7 +21,7 @@
21 */ 21 */
22static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, 22static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
23 const char *old_name, const char *new_name, 23 const char *old_name, const char *new_name,
24 int isdir) 24 int isdir, struct inode *target)
25{ 25{
26 u32 cookie = inotify_get_cookie(); 26 u32 cookie = inotify_get_cookie();
27 27
@@ -36,31 +36,30 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
36 isdir = IN_ISDIR; 36 isdir = IN_ISDIR;
37 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); 37 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name);
38 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); 38 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name);
39
40 if (target) {
41 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL);
42 inotify_inode_is_dead(target);
43 }
39} 44}
40 45
41/* 46/*
42 * fsnotify_unlink - file was unlinked 47 * fsnotify_nameremove - a filename was removed from a directory
43 */ 48 */
44static inline void fsnotify_unlink(struct dentry *dentry, struct inode *dir) 49static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
45{ 50{
46 struct inode *inode = dentry->d_inode; 51 if (isdir)
47 52 isdir = IN_ISDIR;
48 inode_dir_notify(dir, DN_DELETE); 53 dnotify_parent(dentry, DN_DELETE);
49 inotify_inode_queue_event(dir, IN_DELETE, 0, dentry->d_name.name); 54 inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name);
50 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
51
52 inotify_inode_is_dead(inode);
53} 55}
54 56
55/* 57/*
56 * fsnotify_rmdir - directory was removed 58 * fsnotify_inoderemove - an inode is going away
57 */ 59 */
58static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode, 60static inline void fsnotify_inoderemove(struct inode *inode)
59 struct inode *dir)
60{ 61{
61 inode_dir_notify(dir, DN_DELETE); 62 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
62 inotify_inode_queue_event(dir,IN_DELETE|IN_ISDIR,0,dentry->d_name.name);
63 inotify_inode_queue_event(inode, IN_DELETE_SELF | IN_ISDIR, 0, NULL);
64 inotify_inode_is_dead(inode); 63 inotify_inode_is_dead(inode);
65} 64}
66 65