diff options
author | Eric Paris <eparis@redhat.com> | 2009-05-21 17:01:43 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2009-06-11 14:57:53 -0400 |
commit | 62ffe5dfba056f7ba81d710fee9f28c58a42fdd6 (patch) | |
tree | ac0d4afc641bdc8ff76779545fde9c6ae539bdaf /include/linux/fsnotify.h | |
parent | a2d8bc6cb4a3024661baf877242f123787d0c054 (diff) |
fsnotify: include pathnames with entries when possible
When inotify wants to send events to a directory about a child it includes
the name of the original file. This patch collects that filename and makes
it available for notification.
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/fsnotify.h')
-rw-r--r-- | include/linux/fsnotify.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index db12d9de3526..180740e9ec82 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -58,7 +58,7 @@ static inline void fsnotify_link_count(struct inode *inode) | |||
58 | { | 58 | { |
59 | inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL); | 59 | inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL); |
60 | 60 | ||
61 | fsnotify(inode, FS_ATTRIB, inode, FSNOTIFY_EVENT_INODE); | 61 | fsnotify(inode, FS_ATTRIB, inode, FSNOTIFY_EVENT_INODE, NULL); |
62 | } | 62 | } |
63 | 63 | ||
64 | /* | 64 | /* |
@@ -91,8 +91,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
91 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name, | 91 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name, |
92 | source); | 92 | source); |
93 | 93 | ||
94 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE); | 94 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name); |
95 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE); | 95 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name); |
96 | 96 | ||
97 | if (target) { | 97 | if (target) { |
98 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL); | 98 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL); |
@@ -104,7 +104,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
104 | 104 | ||
105 | if (source) { | 105 | if (source) { |
106 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); | 106 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); |
107 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE); | 107 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL); |
108 | } | 108 | } |
109 | audit_inode_child(new_name, moved, new_dir); | 109 | audit_inode_child(new_name, moved, new_dir); |
110 | } | 110 | } |
@@ -138,7 +138,7 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
138 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL); | 138 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL); |
139 | inotify_inode_is_dead(inode); | 139 | inotify_inode_is_dead(inode); |
140 | 140 | ||
141 | fsnotify(inode, FS_DELETE_SELF, inode, FSNOTIFY_EVENT_INODE); | 141 | fsnotify(inode, FS_DELETE_SELF, inode, FSNOTIFY_EVENT_INODE, NULL); |
142 | __fsnotify_inode_delete(inode); | 142 | __fsnotify_inode_delete(inode); |
143 | } | 143 | } |
144 | 144 | ||
@@ -151,7 +151,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
151 | dentry->d_inode); | 151 | dentry->d_inode); |
152 | audit_inode_child(dentry->d_name.name, dentry, inode); | 152 | audit_inode_child(dentry->d_name.name, dentry, inode); |
153 | 153 | ||
154 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE); | 154 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name); |
155 | } | 155 | } |
156 | 156 | ||
157 | /* | 157 | /* |
@@ -166,7 +166,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct | |||
166 | fsnotify_link_count(inode); | 166 | fsnotify_link_count(inode); |
167 | audit_inode_child(new_dentry->d_name.name, new_dentry, dir); | 167 | audit_inode_child(new_dentry->d_name.name, new_dentry, dir); |
168 | 168 | ||
169 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE); | 169 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name); |
170 | } | 170 | } |
171 | 171 | ||
172 | /* | 172 | /* |
@@ -180,7 +180,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
180 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); | 180 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); |
181 | audit_inode_child(dentry->d_name.name, dentry, inode); | 181 | audit_inode_child(dentry->d_name.name, dentry, inode); |
182 | 182 | ||
183 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE); | 183 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name); |
184 | } | 184 | } |
185 | 185 | ||
186 | /* | 186 | /* |
@@ -197,7 +197,7 @@ static inline void fsnotify_access(struct dentry *dentry) | |||
197 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 197 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
198 | 198 | ||
199 | fsnotify_parent(dentry, mask); | 199 | fsnotify_parent(dentry, mask); |
200 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE); | 200 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL); |
201 | } | 201 | } |
202 | 202 | ||
203 | /* | 203 | /* |
@@ -214,7 +214,7 @@ static inline void fsnotify_modify(struct dentry *dentry) | |||
214 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 214 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
215 | 215 | ||
216 | fsnotify_parent(dentry, mask); | 216 | fsnotify_parent(dentry, mask); |
217 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE); | 217 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL); |
218 | } | 218 | } |
219 | 219 | ||
220 | /* | 220 | /* |
@@ -231,7 +231,7 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
231 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 231 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
232 | 232 | ||
233 | fsnotify_parent(dentry, mask); | 233 | fsnotify_parent(dentry, mask); |
234 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE); | 234 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL); |
235 | } | 235 | } |
236 | 236 | ||
237 | /* | 237 | /* |
@@ -250,7 +250,7 @@ static inline void fsnotify_close(struct file *file) | |||
250 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 250 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
251 | 251 | ||
252 | fsnotify_parent(dentry, mask); | 252 | fsnotify_parent(dentry, mask); |
253 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE); | 253 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL); |
254 | } | 254 | } |
255 | 255 | ||
256 | /* | 256 | /* |
@@ -267,7 +267,7 @@ static inline void fsnotify_xattr(struct dentry *dentry) | |||
267 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 267 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
268 | 268 | ||
269 | fsnotify_parent(dentry, mask); | 269 | fsnotify_parent(dentry, mask); |
270 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE); | 270 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL); |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
@@ -303,7 +303,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) | |||
303 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 303 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); |
304 | 304 | ||
305 | fsnotify_parent(dentry, mask); | 305 | fsnotify_parent(dentry, mask); |
306 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE); | 306 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL); |
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||