diff options
-rw-r--r-- | fs/namei.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/namei.c b/fs/namei.c index 89e380583ab..6ce27d6db68 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -767,8 +767,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, | |||
767 | struct path *path) | 767 | struct path *path) |
768 | { | 768 | { |
769 | struct vfsmount *mnt = nd->path.mnt; | 769 | struct vfsmount *mnt = nd->path.mnt; |
770 | struct dentry *dentry = __d_lookup(nd->path.dentry, name); | 770 | struct dentry *dentry; |
771 | /* | ||
772 | * See if the low-level filesystem might want | ||
773 | * to use its own hash.. | ||
774 | */ | ||
775 | if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) { | ||
776 | int err = nd->path.dentry->d_op->d_hash(nd->path.dentry, name); | ||
777 | if (err < 0) | ||
778 | return err; | ||
779 | } | ||
771 | 780 | ||
781 | dentry = __d_lookup(nd->path.dentry, name); | ||
772 | if (!dentry) | 782 | if (!dentry) |
773 | goto need_lookup; | 783 | goto need_lookup; |
774 | if (dentry->d_op && dentry->d_op->d_revalidate) | 784 | 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 | case 1: | 878 | case 1: |
869 | continue; | 879 | continue; |
870 | } | 880 | } |
871 | /* | ||
872 | * See if the low-level filesystem might want | ||
873 | * to use its own hash.. | ||
874 | */ | ||
875 | if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) { | ||
876 | err = nd->path.dentry->d_op->d_hash(nd->path.dentry, | ||
877 | &this); | ||
878 | if (err < 0) | ||
879 | break; | ||
880 | } | ||
881 | /* This does the actual lookups.. */ | 881 | /* This does the actual lookups.. */ |
882 | err = do_lookup(nd, &this, &next); | 882 | err = do_lookup(nd, &this, &next); |
883 | if (err) | 883 | if (err) |
@@ -923,12 +923,6 @@ last_component: | |||
923 | case 1: | 923 | case 1: |
924 | goto return_reval; | 924 | goto return_reval; |
925 | } | 925 | } |
926 | if (nd->path.dentry->d_op && nd->path.dentry->d_op->d_hash) { | ||
927 | err = nd->path.dentry->d_op->d_hash(nd->path.dentry, | ||
928 | &this); | ||
929 | if (err < 0) | ||
930 | break; | ||
931 | } | ||
932 | err = do_lookup(nd, &this, &next); | 926 | err = do_lookup(nd, &this, &next); |
933 | if (err) | 927 | if (err) |
934 | break; | 928 | break; |