[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>
diff --git a/fs/inotify.c b/fs/inotify.c
index a1bedf3..f25c218 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -232,7 +232,7 @@
static void remove_watch(struct inotify_watch *watch, struct inotify_handle *ih)
{
remove_watch_no_event(watch, ih);
- ih->in_ops->handle_event(watch, watch->wd, IN_IGNORED, 0, NULL);
+ ih->in_ops->handle_event(watch, watch->wd, IN_IGNORED, 0, NULL, NULL);
}
/* Kernel API for producing events */
@@ -275,9 +275,10 @@
* @mask: event mask describing this event
* @cookie: cookie for synchronization, or zero
* @name: filename, if any
+ * @n_inode: inode associated with name
*/
void inotify_inode_queue_event(struct inode *inode, u32 mask, u32 cookie,
- const char *name)
+ const char *name, struct inode *n_inode)
{
struct inotify_watch *watch, *next;
@@ -292,7 +293,8 @@
mutex_lock(&ih->mutex);
if (watch_mask & IN_ONESHOT)
remove_watch_no_event(watch, ih);
- ih->in_ops->handle_event(watch, watch->wd, mask, cookie, name);
+ ih->in_ops->handle_event(watch, watch->wd, mask, cookie,
+ name, n_inode);
mutex_unlock(&ih->mutex);
}
}
@@ -323,7 +325,8 @@
if (inotify_inode_watched(inode)) {
dget(parent);
spin_unlock(&dentry->d_lock);
- inotify_inode_queue_event(inode, mask, cookie, name);
+ inotify_inode_queue_event(inode, mask, cookie, name,
+ dentry->d_inode);
dput(parent);
} else
spin_unlock(&dentry->d_lock);
@@ -407,7 +410,7 @@
struct inotify_handle *ih= watch->ih;
mutex_lock(&ih->mutex);
ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0,
- NULL);
+ NULL, NULL);
remove_watch(watch, ih);
mutex_unlock(&ih->mutex);
}
diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index 845dc79..8b83c71 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -253,7 +253,8 @@
* Can sleep (calls kernel_event()).
*/
static void inotify_dev_queue_event(struct inotify_watch *w, u32 wd, u32 mask,
- u32 cookie, const char *name)
+ u32 cookie, const char *name,
+ struct inode *ignored)
{
struct inotify_user_watch *watch;
struct inotify_device *dev;