diff options
author | Amy Griffis <amy.griffis@hp.com> | 2006-06-01 16:11:01 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-06-20 05:25:18 -0400 |
commit | 7c29772288b7026504cfe75bfd90d40fbd1574bf (patch) | |
tree | dfc0cfef97c4c5fdbd87bbd9abdbf44bcd21c906 /fs/inotify.c | |
parent | 2d9048e201bfb67ba21f05e647b1286b8a4a5667 (diff) |
[PATCH] inotify (2/5): add name's inode to event handler
When an inotify event includes a dentry name, also include the inode
associated with that name.
Signed-off-by: Amy Griffis <amy.griffis@hp.com>
Acked-by: Robert Love <rml@novell.com>
Acked-by: John McCutchan <john@johnmccutchan.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inotify.c')
-rw-r--r-- | fs/inotify.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index a1bedf3975ca..f25c21801fdc 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -232,7 +232,7 @@ static void remove_watch_no_event(struct inotify_watch *watch, | |||
232 | static void remove_watch(struct inotify_watch *watch, struct inotify_handle *ih) | 232 | static void remove_watch(struct inotify_watch *watch, struct inotify_handle *ih) |
233 | { | 233 | { |
234 | remove_watch_no_event(watch, ih); | 234 | remove_watch_no_event(watch, ih); |
235 | ih->in_ops->handle_event(watch, watch->wd, IN_IGNORED, 0, NULL); | 235 | ih->in_ops->handle_event(watch, watch->wd, IN_IGNORED, 0, NULL, NULL); |
236 | } | 236 | } |
237 | 237 | ||
238 | /* Kernel API for producing events */ | 238 | /* Kernel API for producing events */ |
@@ -275,9 +275,10 @@ void inotify_d_move(struct dentry *entry) | |||
275 | * @mask: event mask describing this event | 275 | * @mask: event mask describing this event |
276 | * @cookie: cookie for synchronization, or zero | 276 | * @cookie: cookie for synchronization, or zero |
277 | * @name: filename, if any | 277 | * @name: filename, if any |
278 | * @n_inode: inode associated with name | ||
278 | */ | 279 | */ |
279 | void inotify_inode_queue_event(struct inode *inode, u32 mask, u32 cookie, | 280 | void inotify_inode_queue_event(struct inode *inode, u32 mask, u32 cookie, |
280 | const char *name) | 281 | const char *name, struct inode *n_inode) |
281 | { | 282 | { |
282 | struct inotify_watch *watch, *next; | 283 | struct inotify_watch *watch, *next; |
283 | 284 | ||
@@ -292,7 +293,8 @@ void inotify_inode_queue_event(struct inode *inode, u32 mask, u32 cookie, | |||
292 | mutex_lock(&ih->mutex); | 293 | mutex_lock(&ih->mutex); |
293 | if (watch_mask & IN_ONESHOT) | 294 | if (watch_mask & IN_ONESHOT) |
294 | remove_watch_no_event(watch, ih); | 295 | remove_watch_no_event(watch, ih); |
295 | ih->in_ops->handle_event(watch, watch->wd, mask, cookie, name); | 296 | ih->in_ops->handle_event(watch, watch->wd, mask, cookie, |
297 | name, n_inode); | ||
296 | mutex_unlock(&ih->mutex); | 298 | mutex_unlock(&ih->mutex); |
297 | } | 299 | } |
298 | } | 300 | } |
@@ -323,7 +325,8 @@ void inotify_dentry_parent_queue_event(struct dentry *dentry, u32 mask, | |||
323 | if (inotify_inode_watched(inode)) { | 325 | if (inotify_inode_watched(inode)) { |
324 | dget(parent); | 326 | dget(parent); |
325 | spin_unlock(&dentry->d_lock); | 327 | spin_unlock(&dentry->d_lock); |
326 | inotify_inode_queue_event(inode, mask, cookie, name); | 328 | inotify_inode_queue_event(inode, mask, cookie, name, |
329 | dentry->d_inode); | ||
327 | dput(parent); | 330 | dput(parent); |
328 | } else | 331 | } else |
329 | spin_unlock(&dentry->d_lock); | 332 | spin_unlock(&dentry->d_lock); |
@@ -407,7 +410,7 @@ void inotify_unmount_inodes(struct list_head *list) | |||
407 | struct inotify_handle *ih= watch->ih; | 410 | struct inotify_handle *ih= watch->ih; |
408 | mutex_lock(&ih->mutex); | 411 | mutex_lock(&ih->mutex); |
409 | ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0, | 412 | ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0, |
410 | NULL); | 413 | NULL, NULL); |
411 | remove_watch(watch, ih); | 414 | remove_watch(watch, ih); |
412 | mutex_unlock(&ih->mutex); | 415 | mutex_unlock(&ih->mutex); |
413 | } | 416 | } |