summaryrefslogtreecommitdiffstats
path: root/fs/inotify.c
diff options
context:
space:
mode:
authorAmy Griffis <amy.griffis@hp.com>2006-06-01 13:11:01 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2006-06-20 05:25:18 -0400
commit7c29772288b7026504cfe75bfd90d40fbd1574bf (patch)
treedfc0cfef97c4c5fdbd87bbd9abdbf44bcd21c906 /fs/inotify.c
parent2d9048e201bfb67ba21f05e647b1286b8a4a5667 (diff)
downloadblackbird-obmc-linux-7c29772288b7026504cfe75bfd90d40fbd1574bf.tar.gz
blackbird-obmc-linux-7c29772288b7026504cfe75bfd90d40fbd1574bf.zip
[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.c13
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,
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 @@ void inotify_d_move(struct dentry *entry)
* @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 @@ void inotify_inode_queue_event(struct inode *inode, u32 mask, u32 cookie,
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 @@ void inotify_dentry_parent_queue_event(struct dentry *dentry, u32 mask,
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 @@ void inotify_unmount_inodes(struct list_head *list)
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);
}
OpenPOWER on IntegriCloud