summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-08-13 18:27:43 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-16 12:16:44 -0500
commit3cac260ad88f4e37637d6e4b33e6a6a849d273c7 (patch)
tree2cde342e32fccadfcc900c10b4a8e49398fb24cf /fs/namei.c
parente9496ff46a20a8592fdc7bdaaf41b45eb808d310 (diff)
downloadop-kernel-dev-3cac260ad88f4e37637d6e4b33e6a6a849d273c7.zip
op-kernel-dev-3cac260ad88f4e37637d6e4b33e6a6a849d273c7.tar.gz
Take hash recalculation into do_lookup()
Both callers of do_lookup() do the same thing before it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 89e3805..6ce27d6 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -767,8 +767,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
struct path *path)
{
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)
goto need_lookup;
if (dentry->d_op && dentry->d_op->d_revalidate)
@@ -868,16 +878,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
case 1:
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.. */
err = do_lookup(nd, &this, &next);
if (err)
@@ -923,12 +923,6 @@ last_component:
case 1:
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);
if (err)
break;
OpenPOWER on IntegriCloud