aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/notify/fsnotify.c12
-rw-r--r--fs/notify/notification.c9
2 files changed, 5 insertions, 16 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 78c440c343a8..60e84fd338dd 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -79,15 +79,15 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
79} 79}
80 80
81/* Notify this dentry's parent about a child's events. */ 81/* Notify this dentry's parent about a child's events. */
82void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) 82void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
83{ 83{
84 struct dentry *parent; 84 struct dentry *parent;
85 struct inode *p_inode; 85 struct inode *p_inode;
86 bool send = false; 86 bool send = false;
87 bool should_update_children = false; 87 bool should_update_children = false;
88 88
89 if (file) 89 if (!dentry)
90 dentry = file->f_path.dentry; 90 dentry = path->dentry;
91 91
92 if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) 92 if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED))
93 return; 93 return;
@@ -119,8 +119,8 @@ void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask)
119 * specifies these are events which came from a child. */ 119 * specifies these are events which came from a child. */
120 mask |= FS_EVENT_ON_CHILD; 120 mask |= FS_EVENT_ON_CHILD;
121 121
122 if (file) 122 if (path)
123 fsnotify(p_inode, mask, file, FSNOTIFY_EVENT_FILE, 123 fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH,
124 dentry->d_name.name, 0); 124 dentry->d_name.name, 0);
125 else 125 else
126 fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, 126 fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
@@ -194,8 +194,6 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const
194 194
195 if (data_is == FSNOTIFY_EVENT_PATH) 195 if (data_is == FSNOTIFY_EVENT_PATH)
196 mnt = ((struct path *)data)->mnt; 196 mnt = ((struct path *)data)->mnt;
197 else if (data_is == FSNOTIFY_EVENT_FILE)
198 mnt = ((struct file *)data)->f_path.mnt;
199 197
200 /* if this inode's directed listeners don't care and nothing on the vfsmount 198 /* if this inode's directed listeners don't care and nothing on the vfsmount
201 * listeners list cares, nothing to do */ 199 * listeners list cares, nothing to do */
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index dafd0b7687b8..066f1f988bac 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -390,15 +390,6 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
390 event->data_type = data_type; 390 event->data_type = data_type;
391 391
392 switch (data_type) { 392 switch (data_type) {
393 case FSNOTIFY_EVENT_FILE: {
394 struct file *file = data;
395 struct path *path = &file->f_path;
396 event->path.dentry = path->dentry;
397 event->path.mnt = path->mnt;
398 path_get(&event->path);
399 event->data_type = FSNOTIFY_EVENT_PATH;
400 break;
401 }
402 case FSNOTIFY_EVENT_PATH: { 393 case FSNOTIFY_EVENT_PATH: {
403 struct path *path = data; 394 struct path *path = data;
404 event->path.dentry = path->dentry; 395 event->path.dentry = path->dentry;