summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMathieu Desnoyers <compudj@krystal.dyndns.org>2006-11-24 19:45:37 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-14 00:38:45 +0100
commit4f36557fbe4ab59feb2783cdb5d049cb8c3f34f3 (patch)
treef45a5b1057f7650f25b7b5d6d87d0d624a10596d /fs
parentdriver core: delete virtual directory on class_unregister() (diff)
downloadlinux-4f36557fbe4ab59feb2783cdb5d049cb8c3f34f3.tar.xz
linux-4f36557fbe4ab59feb2783cdb5d049cb8c3f34f3.zip
DebugFS : inotify create/mkdir support
Add inotify create and mkdir events to DebugFS. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/debugfs/inode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 137d76c3f90a..020da4c60593 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)