mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-13 17:17:32 +07:00
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>
This commit is contained in:
parent
44c53c4ff0
commit
4f36557fbe
@ -24,6 +24,7 @@
|
|||||||
#include <linux/kobject.h>
|
#include <linux/kobject.h>
|
||||||
#include <linux/namei.h>
|
#include <linux/namei.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
#include <linux/fsnotify.h>
|
||||||
|
|
||||||
#define DEBUGFS_MAGIC 0x64626720
|
#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;
|
mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
|
||||||
res = debugfs_mknod(dir, dentry, mode, 0);
|
res = debugfs_mknod(dir, dentry, mode, 0);
|
||||||
if (!res)
|
if (!res) {
|
||||||
inc_nlink(dir);
|
inc_nlink(dir);
|
||||||
|
fsnotify_mkdir(dir, dentry);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode)
|
static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
mode = (mode & S_IALLUGO) | S_IFREG;
|
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)
|
static inline int debugfs_positive(struct dentry *dentry)
|
||||||
|
Loading…
Reference in New Issue
Block a user