return dentry;
 }
 
-struct dentry * lookup_hash(struct qstr *name, struct dentry * base)
+struct dentry * lookup_hash(struct nameidata *nd)
 {
-       return __lookup_hash(name, base, NULL);
+       return __lookup_hash(&nd->last, nd->dentry, nd);
 }
 
 /* SMP-safe */
        }
        this.hash = end_name_hash(hash);
 
-       return lookup_hash(&this, base);
+       return __lookup_hash(&this, base, NULL);
 access:
        return ERR_PTR(-EACCES);
 }
        dir = nd->dentry;
        nd->flags &= ~LOOKUP_PARENT;
        down(&dir->d_inode->i_sem);
-       path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+       path.dentry = lookup_hash(nd);
        path.mnt = nd->mnt;
 
 do_last:
        }
        dir = nd->dentry;
        down(&dir->d_inode->i_sem);
-       path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+       path.dentry = lookup_hash(nd);
        path.mnt = nd->mnt;
        __putname(nd->last.name);
        goto do_last;
        /*
         * Do the final lookup.
         */
-       dentry = lookup_hash(&nd->last, nd->dentry);
+       dentry = lookup_hash(nd);
        if (IS_ERR(dentry))
                goto fail;
 
                        goto exit1;
        }
        down(&nd.dentry->d_inode->i_sem);
-       dentry = lookup_hash(&nd.last, nd.dentry);
+       dentry = lookup_hash(&nd);
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                error = vfs_rmdir(nd.dentry->d_inode, dentry);
        if (nd.last_type != LAST_NORM)
                goto exit1;
        down(&nd.dentry->d_inode->i_sem);
-       dentry = lookup_hash(&nd.last, nd.dentry);
+       dentry = lookup_hash(&nd);
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                /* Why not before? Because we want correct error value */
 
        trap = lock_rename(new_dir, old_dir);
 
-       old_dentry = lookup_hash(&oldnd.last, old_dir);
+       old_dentry = lookup_hash(&oldnd);
        error = PTR_ERR(old_dentry);
        if (IS_ERR(old_dentry))
                goto exit3;
        error = -EINVAL;
        if (old_dentry == trap)
                goto exit4;
-       new_dentry = lookup_hash(&newnd.last, new_dir);
+       new_dentry = lookup_hash(&newnd);
        error = PTR_ERR(new_dentry);
        if (IS_ERR(new_dentry))
                goto exit4;
 
 extern void release_open_intent(struct nameidata *);
 
 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
-extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
+extern struct dentry * lookup_hash(struct nameidata *);
 
 extern int follow_down(struct vfsmount **, struct dentry **);
 extern int follow_up(struct vfsmount **, struct dentry **);
 
                return ERR_PTR(error);
        dir = nd->dentry->d_inode;
        down(&dir->i_sem);
-       dentry = lookup_hash(&nd->last, nd->dentry);
+       dentry = lookup_hash(nd);
        if (IS_ERR(dentry))
                goto out_err;
        if (dentry->d_inode) {
                return error;
        dir = nd.dentry->d_inode;
        down(&dir->i_sem);
-       dentry = lookup_hash(&nd.last, nd.dentry);
+       dentry = lookup_hash(&nd);
        if (IS_ERR(dentry)) {
                error = PTR_ERR(dentry);
                goto out_release;
                return error;
        dir = nd.dentry->d_inode;
        down(&dir->i_sem);
-       dentry = lookup_hash(&nd.last, nd.dentry);
+       dentry = lookup_hash(&nd);
        if (IS_ERR(dentry)) {
                error = PTR_ERR(dentry);
                goto out_release;