FreeBSD/sys/fs/nfsserver/nfs_nfsdport.c
/*
 * Get a vnode for a file handle and export stuff.
 */
Get a vnode for a file handle and export stuff.
Get a vnode for a file handle and export stuff .
int
nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam,
    int lktype, struct vnode **vpp, struct nfsexstuff *exp,
    struct ucred **credp)
{
	int i, error, *secflavors;
	*credp = NULL;
	exp->nes_numsecflavor = 0;
	error = VFS_FHTOVP(mp, &fhp->fh_fid, lktype, vpp);
	if (error != 0)
		error = ESTALE;
	if (nam && !error) {
		error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp,
		    &exp->nes_numsecflavor, &secflavors);
		if (error) {
			if (nfs_rootfhset) {
				exp->nes_exflag = 0;
				exp->nes_numsecflavor = 0;
				error = 0;
			} else {
				vput(*vpp);
			}
		} else {
			for (i = 0; i < exp->nes_numsecflavor; i++)
				exp->nes_secflavors[i] = secflavors[i];
		}
	}
	NFSEXITCODE(error);
	return (error);
}
int nfsvno_fhtovp ( struct mount * mp , fhandle_t * fhp , struct sockaddr * nam , int lktype , struct vnode * * vpp , struct nfsexstuff * exp , struct ucred * * credp ) { int i , error , * secflavors ; * credp = NULL ; exp -> nes_numsecflavor = 0 ; error = VFS_FHTOVP ( mp , & fhp -> fh_fid , lktype , vpp ) ; if ( error != 0 ) error = ESTALE ; if ( nam && ! error ) { error = VFS_CHECKEXP ( mp , nam , & exp -> nes_exflag , credp , & exp -> nes_numsecflavor , & secflavors ) ; if ( error ) { if ( nfs_rootfhset ) { exp -> nes_exflag = 0 ; exp -> nes_numsecflavor = 0 ; error = 0 ; } else { vput ( * vpp ) ; } } else { for ( i = 0 ; i < exp -> nes_numsecflavor ; i ++ ) exp -> nes_secflavors [ i ] = secflavors [ i ] ; } } NFSEXITCODE ( error ) ; return ( error ) ; }
Get a vnode for a file handle and export stuff.
Get a vnode for a file handle and export stuff .
/* Make sure the server replies ESTALE to the client. */ /* Copy the security flavors. */