/* Unhashes the dentry corresponding to given configfs_dirent Called with parent inode's i_mutex held.  */
void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent)
/* Unhashes the dentry corresponding to given configfs_dirent Called with parent inode's i_mutex held.  */
void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent)
{
	struct dentry * dentry = sd->s_dentry;
	if (dentry) {
		spin_lock(&dcache_lock);
		spin_lock(&dentry->d_lock);
		if (!(d_unhashed(dentry) && dentry->d_inode)) {
			dget_locked(dentry);
			__d_drop(dentry);
			spin_unlock(&dentry->d_lock);
			spin_unlock(&dcache_lock);
			simple_unlink(parent->d_inode, dentry);
		} else {
			spin_unlock(&dentry->d_lock);
			spin_unlock(&dcache_lock);
		}
	}
}