aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/notify/fsnotify.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 523337b600a0..806beede24a3 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -78,13 +78,16 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
78} 78}
79 79
80/* Notify this dentry's parent about a child's events. */ 80/* Notify this dentry's parent about a child's events. */
81void __fsnotify_parent(struct dentry *dentry, __u32 mask) 81void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask)
82{ 82{
83 struct dentry *parent; 83 struct dentry *parent;
84 struct inode *p_inode; 84 struct inode *p_inode;
85 bool send = false; 85 bool send = false;
86 bool should_update_children = false; 86 bool should_update_children = false;
87 87
88 if (file)
89 dentry = file->f_path.dentry;
90
88 if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) 91 if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED))
89 return; 92 return;
90 93
@@ -115,8 +118,12 @@ void __fsnotify_parent(struct dentry *dentry, __u32 mask)
115 * specifies these are events which came from a child. */ 118 * specifies these are events which came from a child. */
116 mask |= FS_EVENT_ON_CHILD; 119 mask |= FS_EVENT_ON_CHILD;
117 120
118 fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, 121 if (file)
119 dentry->d_name.name, 0); 122 fsnotify(p_inode, mask, file, FSNOTIFY_EVENT_FILE,
123 dentry->d_name.name, 0);
124 else
125 fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
126 dentry->d_name.name, 0);
120 dput(parent); 127 dput(parent);
121 } 128 }
122 129