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>


authored by Mathieu Desnoyers and committed by Greg Kroah-Hartman 4f36557f 44c53c4f

+10 -2
+10 -2
fs/debugfs/inode.c
··· 24 #include <linux/kobject.h> 25 #include <linux/namei.h> 26 #include <linux/debugfs.h> 27 28 #define DEBUGFS_MAGIC 0x64626720 29 ··· 88 89 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; 90 res = debugfs_mknod(dir, dentry, mode, 0); 91 - if (!res) 92 inc_nlink(dir); 93 return res; 94 } 95 96 static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode) 97 { 98 mode = (mode & S_IALLUGO) | S_IFREG; 99 - return debugfs_mknod(dir, dentry, mode, 0); 100 } 101 102 static inline int debugfs_positive(struct dentry *dentry)
··· 24 #include <linux/kobject.h> 25 #include <linux/namei.h> 26 #include <linux/debugfs.h> 27 + #include <linux/fsnotify.h> 28 29 #define DEBUGFS_MAGIC 0x64626720 30 ··· 87 88 mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; 89 res = debugfs_mknod(dir, dentry, mode, 0); 90 + if (!res) { 91 inc_nlink(dir); 92 + fsnotify_mkdir(dir, dentry); 93 + } 94 return res; 95 } 96 97 static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode) 98 { 99 + int res; 100 + 101 mode = (mode & S_IALLUGO) | S_IFREG; 102 + res = debugfs_mknod(dir, dentry, mode, 0); 103 + if (!res) 104 + fsnotify_create(dir, dentry); 105 + return res; 106 } 107 108 static inline int debugfs_positive(struct dentry *dentry)