if (disconnected)
add_flags |= DCACHE_DISCONNECTED;
- spin_lock(&tmp->d_lock);
- __d_set_inode_and_type(tmp, inode, add_flags);
- hlist_add_head(&tmp->d_u.d_alias, &inode->i_dentry);
+ spin_lock(&dentry->d_lock);
+ __d_set_inode_and_type(dentry, inode, add_flags);
+ hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry);
- hlist_bl_lock(&dentry->d_sb->s_anon);
- hlist_bl_add_head(&dentry->d_hash, &dentry->d_sb->s_anon);
- hlist_bl_unlock(&dentry->d_sb->s_anon);
+ if (!disconnected) {
- hlist_bl_lock(&tmp->d_sb->s_roots);
- hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_roots);
- hlist_bl_unlock(&tmp->d_sb->s_roots);
++ hlist_bl_lock(&dentry->d_sb->s_roots);
++ hlist_bl_add_head(&dentry->d_hash, &dentry->d_sb->s_roots);
++ hlist_bl_unlock(&dentry->d_sb->s_roots);
+ }
- spin_unlock(&tmp->d_lock);
+ spin_unlock(&dentry->d_lock);
spin_unlock(&inode->i_lock);
- return tmp;
+ return dentry;
out_iput:
iput(inode);