/* Add a directory inode to a dentry, ensuring that no other dentry refers to this inode. Called with fc->inst_mutex.  */
static struct dentry* fuse_d_add_directory(struct dentry *entry, struct inode *inode)
/* Add a directory inode to a dentry, ensuring that no other dentry refers to this inode. Called with fc->inst_mutex.  */
static struct dentry* fuse_d_add_directory(struct dentry *entry, struct inode *inode)
{
	struct dentry *alias = d_find_alias(inode);
	if (alias && !(alias->d_flags & DCACHE_DISCONNECTED)) {
		fuse_invalidate_entry(alias);
		dput(alias);
		if (!list_empty(&inode->i_dentry))
			return ERR_PTR(-EBUSY);
	} else {
		dput(alias);
	}
	return d_splice_alias(inode, entry);
}