Skip to content

Commit

Permalink
fold debugfs_mkdir() into caller
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jan 25, 2015
1 parent 160f759 commit 02538a7
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions fs/debugfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,6 @@ static int debugfs_mknod(struct dentry *dentry,
return 0;
}

static int debugfs_mkdir(struct dentry *dentry, umode_t mode)
{
struct inode *dir = dentry->d_parent->d_inode;
int res;

mode = (mode & (S_IRWXUGO | S_ISVTX)) | S_IFDIR;
res = debugfs_mknod(dentry, mode, NULL, NULL);
if (!res) {
inc_nlink(dir);
fsnotify_mkdir(dir, dentry);
}
return res;
}

static int debugfs_create(struct dentry *dentry, umode_t mode,
void *data, const struct file_operations *fops)
{
Expand Down Expand Up @@ -407,7 +393,12 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
if (IS_ERR(dentry))
return NULL;

error = debugfs_mkdir(dentry, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO);
error = debugfs_mknod(dentry, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
NULL, NULL);
if (!error) {
inc_nlink(dentry->d_parent->d_inode);
fsnotify_mkdir(dentry->d_parent->d_inode, dentry);
}
return end_creating(dentry, error);
}
EXPORT_SYMBOL_GPL(debugfs_create_dir);
Expand Down

0 comments on commit 02538a7

Please sign in to comment.