Commit 3cac260a authored by Al Viro's avatar Al Viro

Take hash recalculation into do_lookup()

Both callers of do_lookup() do the same thing before it
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e9496ff4
...@@ -767,8 +767,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, ...@@ -767,8 +767,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
struct path *path) struct path *path)
{ {
struct vfsmount *mnt = nd->path.mnt; struct vfsmount *mnt = nd->path.mnt;
struct dentry *dentry = __d_lookup(nd->path.dentry, name); struct dentry *dentry;
/*
* See if the low-level filesystem might want
* to use its own hash..
*/
if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) {
int err = nd->path.dentry->d_op->d_hash(nd->path.dentry, name);
if (err < 0)
return err;
}
dentry = __d_lookup(nd->path.dentry, name);
if (!dentry) if (!dentry)
goto need_lookup; goto need_lookup;
if (dentry->d_op && dentry->d_op->d_revalidate) if (dentry->d_op && dentry->d_op->d_revalidate)
...@@ -868,16 +878,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) ...@@ -868,16 +878,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
case 1: case 1:
continue; continue;
} }
/*
* See if the low-level filesystem might want
* to use its own hash..
*/
if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) {
err = nd->path.dentry->d_op->d_hash(nd->path.dentry,
&this);
if (err < 0)
break;
}
/* This does the actual lookups.. */ /* This does the actual lookups.. */
err = do_lookup(nd, &this, &next); err = do_lookup(nd, &this, &next);
if (err) if (err)
...@@ -923,12 +923,6 @@ last_component: ...@@ -923,12 +923,6 @@ last_component:
case 1: case 1:
goto return_reval; goto return_reval;
} }
if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) {
err = nd->path.dentry->d_op->d_hash(nd->path.dentry,
&this);
if (err < 0)
break;
}
err = do_lookup(nd, &this, &next); err = do_lookup(nd, &this, &next);
if (err) if (err)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment