/* cgroup_create_dir - create a directory for an object. @cgrp: the cgroup we create the directory for. It must have a valid ->parent field. And we are going to fill its ->dentry field. @dentry: dentry of the new cgroup @mode: mode to set on new directory.  */
static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, mode_t mode)
/* cgroup_create_dir - create a directory for an object. @cgrp: the cgroup we create the directory for. It must have a valid ->parent field. And we are going to fill its ->dentry field. @dentry: dentry of the new cgroup @mode: mode to set on new directory.  */
static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, mode_t mode)
{
	struct dentry *parent;
	int error = 0;
	parent = cgrp->parent->dentry;
	error = cgroup_create_file(dentry, S_IFDIR | mode, cgrp->root->sb);
	if (!error) {
		dentry->d_fsdata = cgrp;
		inc_nlink(parent->d_inode);
		rcu_assign_pointer(cgrp->dentry, dentry);
		dget(dentry);
	}
	dput(dentry);
	return error;
}