diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 03b7a0a934ae..0fdb61dd4d7f 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -576,7 +576,7 @@ void nfsvno_unlockvfs(mount_t); int nfsvno_lockvfs(mount_t); int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *); -int nfsrv_hashfh(fhandle_t *); +uint32_t nfsrv_hashfh(fhandle_t *); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index b49442fd89ca..380aa7210367 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -3090,15 +3091,12 @@ nfsvno_testexp(struct nfsrv_descript *nd, struct nfsexstuff *exp) /* * Calculate a hash value for the fid in a file handle. */ -int +uint32_t nfsrv_hashfh(fhandle_t *fhp) { - int hashval = 0, i; - uint8_t *cp; + uint32_t hashval; - cp = (uint8_t *)&fhp->fh_fid; - for (i = 0; i < sizeof(struct fid); i++) - hashval += *cp++; + hashval = hash32_buf(&fhp->fh_fid, sizeof(struct fid), 0); return (hashval); }