diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-25 14:15:18 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-25 16:52:51 -0500 |
commit | 02538a75ba176d286a421d1e41a66061f407c3b3 (patch) | |
tree | e19bbbb9acf863127f272f017a4a20c536905497 /fs/debugfs | |
parent | 160f7592f2364b47c615cff96117f0877d58e427 (diff) |
fold debugfs_mkdir() into caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/debugfs')
-rw-r--r-- | fs/debugfs/inode.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index bc02e2096977..8d12935c87f1 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -84,20 +84,6 @@ static int debugfs_mknod(struct dentry *dentry, | |||
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | 86 | ||
87 | static int debugfs_mkdir(struct dentry *dentry, umode_t mode) | ||
88 | { | ||
89 | struct inode *dir = dentry->d_parent->d_inode; | ||
90 | int res; | ||
91 | |||
92 | mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR; | ||
93 | res = debugfs_mknod(dentry, mode, NULL, NULL); | ||
94 | if (!res) { | ||
95 | inc_nlink(dir); | ||
96 | fsnotify_mkdir(dir, dentry); | ||
97 | } | ||
98 | return res; | ||
99 | } | ||
100 | |||
101 | static int debugfs_create(struct dentry *dentry, umode_t mode, | 87 | static int debugfs_create(struct dentry *dentry, umode_t mode, |
102 | void *data, const struct file_operations *fops) | 88 | void *data, const struct file_operations *fops) |
103 | { | 89 | { |
@@ -407,7 +393,12 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent) | |||
407 | if (IS_ERR(dentry)) | 393 | if (IS_ERR(dentry)) |
408 | return NULL; | 394 | return NULL; |
409 | 395 | ||
410 | error = debugfs_mkdir(dentry, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO); | 396 | error = debugfs_mknod(dentry, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, |
397 | NULL, NULL); | ||
398 | if (!error) { | ||
399 | inc_nlink(dentry->d_parent->d_inode); | ||
400 | fsnotify_mkdir(dentry->d_parent->d_inode, dentry); | ||
401 | } | ||
411 | return end_creating(dentry, error); | 402 | return end_creating(dentry, error); |
412 | } | 403 | } |
413 | EXPORT_SYMBOL_GPL(debugfs_create_dir); | 404 | EXPORT_SYMBOL_GPL(debugfs_create_dir); |