/* Turn the dentry into a negative dentry if possible, otherwise remove it from the hash queues so it can be deleted later  */
void d_delete(struct dentry *dentry)
/* Turn the dentry into a negative dentry if possible, otherwise remove it from the hash queues so it can be deleted later  */
void d_delete(struct dentry *dentry)
{
	int isdir = 0;
	spin_lock(&dcache_lock);
	spin_lock(&dentry->d_lock);
	isdir = S_ISDIR(dentry->d_inode->i_mode);
	if (atomic_read(&dentry->d_count) == 1) {
		dentry_iput(dentry);
		fsnotify_nameremove(dentry, isdir);
		return;
	}
	if (!d_unhashed(dentry))
		__d_drop(dentry);
	spin_unlock(&dentry->d_lock);
	spin_unlock(&dcache_lock);
	fsnotify_nameremove(dentry, isdir);
}