Re: [RFC][PATCH] inotify 0.13
From: Robert Love
Date: Wed Oct 06 2004 - 16:11:51 EST
On Wed, 2004-10-06 at 16:41 -0400, John McCutchan wrote:
> -add CLOSE_WRITE/CLOSE_NOWRITE events (rml)
> -CLOSE_* events are delivered in all circumstances now (rml)
The __fput() related bits here got dropped.
Attached, against 0.13.
Robert Love
add make missing __fput() logic.
Signed-Off-By: Robert Love <rml@xxxxxxxxxx>
fs/file_table.c | 7 +++++++
1 files changed, 7 insertions(+)
diff -urN linux-inotify-0.13/fs/file_table.c linux/fs/file_table.c
--- linux-inotify-0.13/fs/file_table.c 2004-10-06 16:47:28.785451776 -0400
+++ linux/fs/file_table.c 2004-10-06 16:49:01.200402568 -0400
@@ -16,6 +16,7 @@
#include <linux/eventpoll.h>
#include <linux/mount.h>
#include <linux/cdev.h>
+#include <linux/inotify.h>
/* sysctl tunables... */
struct files_stat_struct files_stat = {
@@ -122,8 +123,14 @@
struct dentry *dentry = file->f_dentry;
struct vfsmount *mnt = file->f_vfsmnt;
struct inode *inode = dentry->d_inode;
+ u32 mask;
might_sleep();
+
+ mask = (file->f_mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE;
+ inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
+ inotify_inode_queue_event(inode, mask, 0, NULL);
+
/*
* The function eventpoll_release() should be the first called
* in the file cleanup chain.