/* This also assumes that the inode count has been incremented (or otherwise set) by the caller to indicate that it is now in use by the dcache.  */
static struct dentry* __d_instantiate_unique(struct dentry *entry, struct inode *inode)
/* This also assumes that the inode count has been incremented (or otherwise set) by the caller to indicate that it is now in use by the dcache.  */
static struct dentry* __d_instantiate_unique(struct dentry *entry, struct inode *inode)
{
	struct dentry *alias;
	int len = entry->d_name.len;
	const char *name = entry->d_name.name;
	unsigned int hash = entry->d_name.hash;
	if (!inode) {
		__d_instantiate(entry, NULL);
		return NULL;
	}
	list_for_each_entry(alias, &inode->i_dentry, d_alias) {
		struct qstr *qstr = &alias->d_name;
		if (qstr->hash != hash)
			continue;
		if (alias->d_parent != entry->d_parent)
			continue;
		if (qstr->len != len)
			continue;
		if (memcmp(qstr->name, name, len))
			continue;
		dget_locked(alias);
		return alias;
	}
	__d_instantiate(entry, inode);
	return NULL;
}