aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMathieu Desnoyers <compudj@krystal.dyndns.org>2006-11-24 13:45:37 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-13 18:38:45 -0500
commit4f36557fbe4ab59feb2783cdb5d049cb8c3f34f3 (patch)
treef45a5b1057f7650f25b7b5d6d87d0d624a10596d /fs
parent44c53c4ff01a3551e9d73604eba42e372e9d0c1a (diff)
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 @@
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/namei.h> 25#include <linux/namei.h>
26#include <linux/debugfs.h> 26#include <linux/debugfs.h>
27#include <linux/fsnotify.h>
27 28
28#define DEBUGFS_MAGIC 0x64626720 29#define DEBUGFS_MAGIC 0x64626720
29 30
@@ -87,15 +88,22 @@ static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
87 88
88 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; 89 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
89 res = debugfs_mknod(dir, dentry, mode, 0); 90 res = debugfs_mknod(dir, dentry, mode, 0);
90 if (!res) 91 if (!res) {
91 inc_nlink(dir); 92 inc_nlink(dir);
93 fsnotify_mkdir(dir, dentry);
94 }
92 return res; 95 return res;
93} 96}
94 97
95static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode) 98static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode)
96{ 99{
100 int res;
101
97 mode = (mode & S_IALLUGO) | S_IFREG; 102 mode = (mode & S_IALLUGO) | S_IFREG;
98 return debugfs_mknod(dir, dentry, mode, 0); 103 res = debugfs_mknod(dir, dentry, mode, 0);
104 if (!res)
105 fsnotify_create(dir, dentry);
106 return res;
99} 107}
100 108
101static inline int debugfs_positive(struct dentry *dentry) 109static inline int debugfs_positive(struct dentry *dentry)