[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11660396091326-git-send-email-greg@kroah.com>
Date: Wed, 13 Dec 2006 11:52:58 -0800
From: Greg KH <greg@...ah.com>
To: linux-kernel@...r.kernel.org
Cc: Mathieu Desnoyers <compudj@...stal.dyndns.org>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH 7/14] DebugFS : inotify create/mkdir support
From: Mathieu Desnoyers <compudj@...stal.dyndns.org>
Add inotify create and mkdir events to DebugFS.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
fs/debugfs/inode.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 137d76c..020da4c 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -24,6 +24,7 @@
#include <linux/kobject.h>
#include <linux/namei.h>
#include <linux/debugfs.h>
+#include <linux/fsnotify.h>
#define DEBUGFS_MAGIC 0x64626720
@@ -87,15 +88,22 @@ static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
res = debugfs_mknod(dir, dentry, mode, 0);
- if (!res)
+ if (!res) {
inc_nlink(dir);
+ fsnotify_mkdir(dir, dentry);
+ }
return res;
}
static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode)
{
+ int res;
+
mode = (mode & S_IALLUGO) | S_IFREG;
- return debugfs_mknod(dir, dentry, mode, 0);
+ res = debugfs_mknod(dir, dentry, mode, 0);
+ if (!res)
+ fsnotify_create(dir, dentry);
+ return res;
}
static inline int debugfs_positive(struct dentry *dentry)
--
1.4.4.2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists