diff options
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 8 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 6 | ||||
-rw-r--r-- | fs/notify/fsnotify.c | 16 | ||||
-rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 12 | ||||
-rw-r--r-- | fs/notify/notification.c | 20 |
5 files changed, 30 insertions, 32 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index f3c40c0e2b86..c2a3029052bc 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -17,9 +17,9 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new) | |||
17 | old->data_type == new->data_type && | 17 | old->data_type == new->data_type && |
18 | old->tgid == new->tgid) { | 18 | old->tgid == new->tgid) { |
19 | switch (old->data_type) { | 19 | switch (old->data_type) { |
20 | case (FSNOTIFY_EVENT_PATH): | 20 | case (FSNOTIFY_EVENT_FILE): |
21 | if ((old->path.mnt == new->path.mnt) && | 21 | if ((old->file->f_path.mnt == new->file->f_path.mnt) && |
22 | (old->path.dentry == new->path.dentry)) | 22 | (old->file->f_path.dentry == new->file->f_path.dentry)) |
23 | return true; | 23 | return true; |
24 | case (FSNOTIFY_EVENT_NONE): | 24 | case (FSNOTIFY_EVENT_NONE): |
25 | return true; | 25 | return true; |
@@ -226,7 +226,7 @@ static bool fanotify_should_send_event(struct fsnotify_group *group, struct inod | |||
226 | return false; | 226 | return false; |
227 | 227 | ||
228 | /* if we don't have enough info to send an event to userspace say no */ | 228 | /* if we don't have enough info to send an event to userspace say no */ |
229 | if (data_type != FSNOTIFY_EVENT_PATH) | 229 | if (data_type != FSNOTIFY_EVENT_FILE) |
230 | return false; | 230 | return false; |
231 | 231 | ||
232 | if (mnt) | 232 | if (mnt) |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 7182c83be90e..50cea74bf1c8 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -65,7 +65,7 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) | |||
65 | if (client_fd < 0) | 65 | if (client_fd < 0) |
66 | return client_fd; | 66 | return client_fd; |
67 | 67 | ||
68 | if (event->data_type != FSNOTIFY_EVENT_PATH) { | 68 | if (event->data_type != FSNOTIFY_EVENT_FILE) { |
69 | WARN_ON(1); | 69 | WARN_ON(1); |
70 | put_unused_fd(client_fd); | 70 | put_unused_fd(client_fd); |
71 | return -EINVAL; | 71 | return -EINVAL; |
@@ -75,8 +75,8 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) | |||
75 | * we need a new file handle for the userspace program so it can read even if it was | 75 | * we need a new file handle for the userspace program so it can read even if it was |
76 | * originally opened O_WRONLY. | 76 | * originally opened O_WRONLY. |
77 | */ | 77 | */ |
78 | dentry = dget(event->path.dentry); | 78 | dentry = dget(event->file->f_path.dentry); |
79 | mnt = mntget(event->path.mnt); | 79 | mnt = mntget(event->file->f_path.mnt); |
80 | /* it's possible this event was an overflow event. in that case dentry and mnt | 80 | /* it's possible this event was an overflow event. in that case dentry and mnt |
81 | * are NULL; That's fine, just don't call dentry open */ | 81 | * are NULL; That's fine, just don't call dentry open */ |
82 | if (dentry && mnt) | 82 | if (dentry && mnt) |
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 72aae4045314..4788c866473a 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -84,7 +84,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | /* Notify this dentry's parent about a child's events. */ | 86 | /* Notify this dentry's parent about a child's events. */ |
87 | void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 87 | void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
88 | { | 88 | { |
89 | struct dentry *parent; | 89 | struct dentry *parent; |
90 | struct inode *p_inode; | 90 | struct inode *p_inode; |
@@ -92,7 +92,7 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | |||
92 | bool should_update_children = false; | 92 | bool should_update_children = false; |
93 | 93 | ||
94 | if (!dentry) | 94 | if (!dentry) |
95 | dentry = path->dentry; | 95 | dentry = file->f_path.dentry; |
96 | 96 | ||
97 | if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) | 97 | if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) |
98 | return; | 98 | return; |
@@ -124,8 +124,8 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | |||
124 | * specifies these are events which came from a child. */ | 124 | * specifies these are events which came from a child. */ |
125 | mask |= FS_EVENT_ON_CHILD; | 125 | mask |= FS_EVENT_ON_CHILD; |
126 | 126 | ||
127 | if (path) | 127 | if (file) |
128 | fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, | 128 | fsnotify(p_inode, mask, file, FSNOTIFY_EVENT_FILE, |
129 | dentry->d_name.name, 0); | 129 | dentry->d_name.name, 0); |
130 | else | 130 | else |
131 | fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, | 131 | fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, |
@@ -154,10 +154,10 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is) | |||
154 | spin_unlock(&inode->i_lock); | 154 | spin_unlock(&inode->i_lock); |
155 | } | 155 | } |
156 | 156 | ||
157 | if (data_is == FSNOTIFY_EVENT_PATH) { | 157 | if (data_is == FSNOTIFY_EVENT_FILE) { |
158 | struct vfsmount *mnt; | 158 | struct vfsmount *mnt; |
159 | 159 | ||
160 | mnt = ((struct path *)data)->mnt; | 160 | mnt = ((struct file *)data)->f_path.mnt; |
161 | if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) { | 161 | if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) { |
162 | spin_lock(&mnt->mnt_root->d_lock); | 162 | spin_lock(&mnt->mnt_root->d_lock); |
163 | hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) { | 163 | hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) { |
@@ -228,8 +228,8 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
228 | !(test_mask & fsnotify_vfsmount_mask)) | 228 | !(test_mask & fsnotify_vfsmount_mask)) |
229 | return 0; | 229 | return 0; |
230 | 230 | ||
231 | if (data_is == FSNOTIFY_EVENT_PATH) | 231 | if (data_is == FSNOTIFY_EVENT_FILE) |
232 | mnt = ((struct path *)data)->mnt; | 232 | mnt = ((struct file *)data)->f_path.mnt; |
233 | 233 | ||
234 | /* if this inode's directed listeners don't care and nothing on the vfsmount | 234 | /* if this inode's directed listeners don't care and nothing on the vfsmount |
235 | * listeners list cares, nothing to do */ | 235 | * listeners list cares, nothing to do */ |
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index 73a1106b3542..3c506e0364cc 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -52,9 +52,9 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new | |||
52 | !strcmp(old->file_name, new->file_name)) | 52 | !strcmp(old->file_name, new->file_name)) |
53 | return true; | 53 | return true; |
54 | break; | 54 | break; |
55 | case (FSNOTIFY_EVENT_PATH): | 55 | case (FSNOTIFY_EVENT_FILE): |
56 | if ((old->path.mnt == new->path.mnt) && | 56 | if ((old->file->f_path.mnt == new->file->f_path.mnt) && |
57 | (old->path.dentry == new->path.dentry)) | 57 | (old->file->f_path.dentry == new->file->f_path.dentry)) |
58 | return true; | 58 | return true; |
59 | break; | 59 | break; |
60 | case (FSNOTIFY_EVENT_NONE): | 60 | case (FSNOTIFY_EVENT_NONE): |
@@ -165,10 +165,10 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode | |||
165 | send = (fsn_mark->mask & mask); | 165 | send = (fsn_mark->mask & mask); |
166 | 166 | ||
167 | if (send && (fsn_mark->mask & FS_EXCL_UNLINK) && | 167 | if (send && (fsn_mark->mask & FS_EXCL_UNLINK) && |
168 | (data_type == FSNOTIFY_EVENT_PATH)) { | 168 | (data_type == FSNOTIFY_EVENT_FILE)) { |
169 | struct path *path = data; | 169 | struct file *file = data; |
170 | 170 | ||
171 | if (d_unlinked(path->dentry)) | 171 | if (d_unlinked(file->f_path.dentry)) |
172 | send = false; | 172 | send = false; |
173 | } | 173 | } |
174 | 174 | ||
diff --git a/fs/notify/notification.c b/fs/notify/notification.c index f39260f8f865..c106cdd7ff5e 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c | |||
@@ -31,6 +31,7 @@ | |||
31 | * allocated and used. | 31 | * allocated and used. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/file.h> | ||
34 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
35 | #include <linux/init.h> | 36 | #include <linux/init.h> |
36 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
@@ -89,8 +90,8 @@ void fsnotify_put_event(struct fsnotify_event *event) | |||
89 | if (atomic_dec_and_test(&event->refcnt)) { | 90 | if (atomic_dec_and_test(&event->refcnt)) { |
90 | pr_debug("%s: event=%p\n", __func__, event); | 91 | pr_debug("%s: event=%p\n", __func__, event); |
91 | 92 | ||
92 | if (event->data_type == FSNOTIFY_EVENT_PATH) | 93 | if (event->data_type == FSNOTIFY_EVENT_FILE) |
93 | path_put(&event->path); | 94 | fput(event->file); |
94 | 95 | ||
95 | BUG_ON(!list_empty(&event->private_data_list)); | 96 | BUG_ON(!list_empty(&event->private_data_list)); |
96 | 97 | ||
@@ -375,8 +376,8 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event) | |||
375 | } | 376 | } |
376 | } | 377 | } |
377 | event->tgid = get_pid(old_event->tgid); | 378 | event->tgid = get_pid(old_event->tgid); |
378 | if (event->data_type == FSNOTIFY_EVENT_PATH) | 379 | if (event->data_type == FSNOTIFY_EVENT_FILE) |
379 | path_get(&event->path); | 380 | get_file(event->file); |
380 | 381 | ||
381 | return event; | 382 | return event; |
382 | } | 383 | } |
@@ -423,11 +424,9 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | |||
423 | event->data_type = data_type; | 424 | event->data_type = data_type; |
424 | 425 | ||
425 | switch (data_type) { | 426 | switch (data_type) { |
426 | case FSNOTIFY_EVENT_PATH: { | 427 | case FSNOTIFY_EVENT_FILE: { |
427 | struct path *path = data; | 428 | event->file = data; |
428 | event->path.dentry = path->dentry; | 429 | get_file(event->file); |
429 | event->path.mnt = path->mnt; | ||
430 | path_get(&event->path); | ||
431 | break; | 430 | break; |
432 | } | 431 | } |
433 | case FSNOTIFY_EVENT_INODE: | 432 | case FSNOTIFY_EVENT_INODE: |
@@ -435,8 +434,7 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | |||
435 | break; | 434 | break; |
436 | case FSNOTIFY_EVENT_NONE: | 435 | case FSNOTIFY_EVENT_NONE: |
437 | event->inode = NULL; | 436 | event->inode = NULL; |
438 | event->path.dentry = NULL; | 437 | event->file = NULL; |
439 | event->path.mnt = NULL; | ||
440 | break; | 438 | break; |
441 | default: | 439 | default: |
442 | BUG(); | 440 | BUG(); |