len = sp->s_namlen; nfsm_reqhead(vp, NFSPROC_LOOKUP, NFSX_FH+NFSX_UNSIGNED+nfsm_rndup(len)); if (isnq) { nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); *tl = 0; } nfsm_fhtom(vp); nfsm_strtom(sp->s_name, len, NFS_MAXNAMLEN); nfsm_request(vp, NFSPROC_LOOKUP, procp, sp->s_cred); if (fhp != NULL) { if (isnq) nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); nfsm_dissect(cp, caddr_t, NFSX_FH); bcopy(cp, (caddr_t)fhp, NFSX_FH);
nfsm_reqhead(dvp, NFSPROC_LOOKUP, NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len)); nfsm_fhtom(dvp, v3); nfsm_strtom(name, len, NFS_MAXNAMLEN); nfsm_request(dvp, NFSPROC_LOOKUP, procp, cred); if (npp && !error) { nfsm_getfh(nfhp, fhlen, v3); if (*npp) { np = *npp; if (np->n_fhsize > NFS_SMALLFH && fhlen <= NFS_SMALLFH) { free((caddr_t)np->n_fhp, M_NFSBIGFH); np->n_fhp = &np->n_fh; } else if (np->n_fhsize <= NFS_SMALLFH && fhlen>NFS_SMALLFH) np->n_fhp =(nfsfh_t *)malloc(fhlen,M_NFSBIGFH,M_WAITOK); bcopy((caddr_t)nfhp, (caddr_t)np->n_fhp, fhlen); np->n_fhsize = fhlen; newvp = NFSTOV(np); } else if (NFS_CMPFH(dnp, nfhp, fhlen)) { VREF(dvp); newvp = dvp; } else { error = nfs_nget(dvp->v_mount, nfhp, fhlen, &np); if (error) { m_freem(mrep); return (error); } newvp = NFSTOV(np); } if (v3) { nfsm_postop_attr(newvp, attrflag); if (!attrflag && *npp == NULL) { m_freem(mrep); vrele(newvp); return (ENOENT); } } else nfsm_loadattr(newvp, (struct vattr *)0);
nfs_lookitup(sp, fhp, procp)	register struct sillyrename *sp;	nfsv2fh_t *fhp;	struct proc *procp;{	register struct vnode *vp = sp->s_dvp;	register u_int32_t *tl;	register caddr_t cp;	register int32_t t1, t2;	caddr_t bpos, dpos, cp2;	int error = 0, isnq;	struct mbuf *mreq, *mrep, *md, *mb, *mb2;	long len;	isnq = (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NQNFS);	nfsstats.rpccnt[NFSPROC_LOOKUP]++;	len = sp->s_namlen;	nfsm_reqhead(vp, NFSPROC_LOOKUP, NFSX_FH+NFSX_UNSIGNED+nfsm_rndup(len));	if (isnq) {		nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);		*tl = 0;	}	nfsm_fhtom(vp);	nfsm_strtom(sp->s_name, len, NFS_MAXNAMLEN);	nfsm_request(vp, NFSPROC_LOOKUP, procp, sp->s_cred);	if (fhp != NULL) {		if (isnq)			nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);		nfsm_dissect(cp, caddr_t, NFSX_FH);		bcopy(cp, (caddr_t)fhp, NFSX_FH);	}	nfsm_reqdone;	return (error);}