@@ -2834,13 +2834,12 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
2834
2834
}
2835
2835
EXPORT_SYMBOL (vfs_path_lookup );
2836
2836
2837
- static int lookup_noperm_common (const char * name , struct dentry * base ,
2838
- int len ,
2839
- struct qstr * this )
2837
+ static int lookup_noperm_common (struct qstr * qname , struct dentry * base )
2840
2838
{
2841
- this -> name = name ;
2842
- this -> len = len ;
2843
- this -> hash = full_name_hash (base , name , len );
2839
+ const char * name = qname -> name ;
2840
+ u32 len = qname -> len ;
2841
+
2842
+ qname -> hash = full_name_hash (base , name , len );
2844
2843
if (!len )
2845
2844
return - EACCES ;
2846
2845
@@ -2857,18 +2856,18 @@ static int lookup_noperm_common(const char *name, struct dentry *base,
2857
2856
* to use its own hash..
2858
2857
*/
2859
2858
if (base -> d_flags & DCACHE_OP_HASH ) {
2860
- int err = base -> d_op -> d_hash (base , this );
2859
+ int err = base -> d_op -> d_hash (base , qname );
2861
2860
if (err < 0 )
2862
2861
return err ;
2863
2862
}
2864
2863
return 0 ;
2865
2864
}
2866
2865
2867
2866
static int lookup_one_common (struct mnt_idmap * idmap ,
2868
- const char * name , struct dentry * base , int len ,
2869
- struct qstr * this ) {
2867
+ struct qstr * qname , struct dentry * base )
2868
+ {
2870
2869
int err ;
2871
- err = lookup_noperm_common (name , base , len , this );
2870
+ err = lookup_noperm_common (qname , base );
2872
2871
if (err < 0 )
2873
2872
return err ;
2874
2873
return inode_permission (idmap , base -> d_inode , MAY_EXEC );
@@ -2890,14 +2889,12 @@ static int lookup_one_common(struct mnt_idmap *idmap,
2890
2889
*/
2891
2890
struct dentry * try_lookup_noperm (struct qstr * name , struct dentry * base )
2892
2891
{
2893
- struct qstr this ;
2894
2892
int err ;
2895
2893
2896
- err = lookup_noperm_common (name -> name , base , name -> len , & this );
2894
+ err = lookup_noperm_common (name , base );
2897
2895
if (err )
2898
2896
return ERR_PTR (err );
2899
2897
2900
- name -> hash = this .hash ;
2901
2898
return lookup_dcache (name , base , 0 );
2902
2899
}
2903
2900
EXPORT_SYMBOL (try_lookup_noperm );
@@ -2915,17 +2912,16 @@ EXPORT_SYMBOL(try_lookup_noperm);
2915
2912
struct dentry * lookup_noperm (struct qstr * name , struct dentry * base )
2916
2913
{
2917
2914
struct dentry * dentry ;
2918
- struct qstr this ;
2919
2915
int err ;
2920
2916
2921
2917
WARN_ON_ONCE (!inode_is_locked (base -> d_inode ));
2922
2918
2923
- err = lookup_noperm_common (name -> name , base , name -> len , & this );
2919
+ err = lookup_noperm_common (name , base );
2924
2920
if (err )
2925
2921
return ERR_PTR (err );
2926
2922
2927
- dentry = lookup_dcache (& this , base , 0 );
2928
- return dentry ? dentry : __lookup_slow (& this , base , 0 );
2923
+ dentry = lookup_dcache (name , base , 0 );
2924
+ return dentry ? dentry : __lookup_slow (name , base , 0 );
2929
2925
}
2930
2926
EXPORT_SYMBOL (lookup_noperm );
2931
2927
@@ -2943,17 +2939,16 @@ struct dentry *lookup_one(struct mnt_idmap *idmap, struct qstr *name,
2943
2939
struct dentry * base )
2944
2940
{
2945
2941
struct dentry * dentry ;
2946
- struct qstr this ;
2947
2942
int err ;
2948
2943
2949
2944
WARN_ON_ONCE (!inode_is_locked (base -> d_inode ));
2950
2945
2951
- err = lookup_one_common (idmap , name -> name , base , name -> len , & this );
2946
+ err = lookup_one_common (idmap , name , base );
2952
2947
if (err )
2953
2948
return ERR_PTR (err );
2954
2949
2955
- dentry = lookup_dcache (& this , base , 0 );
2956
- return dentry ? dentry : __lookup_slow (& this , base , 0 );
2950
+ dentry = lookup_dcache (name , base , 0 );
2951
+ return dentry ? dentry : __lookup_slow (name , base , 0 );
2957
2952
}
2958
2953
EXPORT_SYMBOL (lookup_one );
2959
2954
@@ -2968,20 +2963,19 @@ EXPORT_SYMBOL(lookup_one);
2968
2963
* Unlike lookup_one, it should be called without the parent
2969
2964
* i_rwsem held, and will take the i_rwsem itself if necessary.
2970
2965
*/
2971
- struct dentry * lookup_one_unlocked (struct mnt_idmap * idmap ,
2972
- struct qstr * name , struct dentry * base )
2966
+ struct dentry * lookup_one_unlocked (struct mnt_idmap * idmap , struct qstr * name ,
2967
+ struct dentry * base )
2973
2968
{
2974
- struct qstr this ;
2975
2969
int err ;
2976
2970
struct dentry * ret ;
2977
2971
2978
- err = lookup_one_common (idmap , name -> name , base , name -> len , & this );
2972
+ err = lookup_one_common (idmap , name , base );
2979
2973
if (err )
2980
2974
return ERR_PTR (err );
2981
2975
2982
- ret = lookup_dcache (& this , base , 0 );
2976
+ ret = lookup_dcache (name , base , 0 );
2983
2977
if (!ret )
2984
- ret = lookup_slow (& this , base , 0 );
2978
+ ret = lookup_slow (name , base , 0 );
2985
2979
return ret ;
2986
2980
}
2987
2981
EXPORT_SYMBOL (lookup_one_unlocked );
0 commit comments