/* configfs_detach_group() and configfs_detach_item() behave similarly on the way out. They assume that the proper semaphores are held, they clean up the configfs items, and they expect their callers will handle the dcache bits.  */
static int configfs_attach_item(struct config_item *parent_item, struct config_item *item, struct dentry *dentry)
/* configfs_detach_group() and configfs_detach_item() behave similarly on the way out. They assume that the proper semaphores are held, they clean up the configfs items, and they expect their callers will handle the dcache bits.  */
static int configfs_attach_item(struct config_item *parent_item, struct config_item *item, struct dentry *dentry)
{
	int ret;
	ret = configfs_create_dir(item, dentry);
	if (!ret) {
		ret = populate_attrs(item);
		if (ret) {
			mutex_lock(&dentry->d_inode->i_mutex);
			configfs_remove_dir(item);
			dentry->d_inode->i_flags |= S_DEAD;
			mutex_unlock(&dentry->d_inode->i_mutex);
			d_delete(dentry);
		}
	}
	return ret;
}