Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0cb8f6a authored by Al Viro's avatar Al Viro Committed by Amit Pundir
Browse files

UPSTREAM: fold debugfs_mkdir() into caller



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>

Bug: 31856701
(cherry picked from commit 02538a75ba176d286a421d1e41a66061f407c3b3)
Change-Id: I553848041af4da264900d3c751f14210207786f8
Signed-off-by: default avatarPaul Lawrence <paullawrence@google.com>
parent f3401978
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -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)
{
@@ -416,7 +402,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);