File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -398,14 +398,6 @@ static unsigned int file_hashval(struct knfsd_fh *fh)
398398 return nfsd_fh_hashval (fh ) & (FILE_HASH_SIZE - 1 );
399399}
400400
401- static bool nfsd_fh_match (struct knfsd_fh * fh1 , struct knfsd_fh * fh2 )
402- {
403- return fh1 -> fh_size == fh2 -> fh_size &&
404- !memcmp (fh1 -> fh_base .fh_pad ,
405- fh2 -> fh_base .fh_pad ,
406- fh1 -> fh_size );
407- }
408-
409401static struct hlist_head file_hashtbl [FILE_HASH_SIZE ];
410402
411403static void
@@ -3295,7 +3287,7 @@ find_file_locked(struct knfsd_fh *fh, unsigned int hashval)
32953287 struct nfs4_file * fp ;
32963288
32973289 hlist_for_each_entry_rcu (fp , & file_hashtbl [hashval ], fi_hash ) {
3298- if (nfsd_fh_match (& fp -> fi_fhandle , fh )) {
3290+ if (fh_match (& fp -> fi_fhandle , fh )) {
32993291 if (atomic_inc_not_zero (& fp -> fi_ref ))
33003292 return fp ;
33013293 }
@@ -4290,7 +4282,7 @@ laundromat_main(struct work_struct *laundry)
42904282
42914283static inline __be32 nfs4_check_fh (struct svc_fh * fhp , struct nfs4_ol_stateid * stp )
42924284{
4293- if (!nfsd_fh_match (& fhp -> fh_handle , & stp -> st_stid .sc_file -> fi_fhandle ))
4285+ if (!fh_match (& fhp -> fh_handle , & stp -> st_stid .sc_file -> fi_fhandle ))
42944286 return nfserr_bad_stateid ;
42954287 return nfs_ok ;
42964288}
Original file line number Diff line number Diff line change @@ -187,6 +187,15 @@ fh_init(struct svc_fh *fhp, int maxsize)
187187 return fhp ;
188188}
189189
190+ static inline bool fh_match (struct knfsd_fh * fh1 , struct knfsd_fh * fh2 )
191+ {
192+ if (fh1 -> fh_size != fh2 -> fh_size )
193+ return false;
194+ if (memcmp (fh1 -> fh_base .fh_pad , fh2 -> fh_base .fh_pad , fh1 -> fh_size ) != 0 )
195+ return false;
196+ return true;
197+ }
198+
190199#ifdef CONFIG_NFSD_V3
191200/*
192201 * The wcc data stored in current_fh should be cleared
You can’t perform that action at this time.
0 commit comments