int error = 0, cache, len;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1; int v3 = (nfsd->nd_flag & ND_NFSV3);
nfsrv_mkdir(nfsd, mrep, md, dpos, cred, nam, mrq)	struct nfsd *nfsd;	struct mbuf *mrep, *md;	caddr_t dpos;	struct ucred *cred;	struct mbuf *nam, **mrq;{	struct vattr va;	register struct nfsv2_fattr *fp;	struct nameidata nd;	register caddr_t cp;	register u_int32_t *tl;	register int32_t t1;	caddr_t bpos;	int error = 0, cache, len;	char *cp2;	struct mbuf *mb, *mb2, *mreq;	struct vnode *vp;	nfsv2fh_t nfh;	fhandle_t *fhp;	u_quad_t frev;	fhp = &nfh.fh_generic;	nfsm_srvmtofh(fhp);	nfsm_srvstrsiz(len, NFS_MAXNAMLEN);	nd.ni_cnd.cn_cred = cred;	nd.ni_cnd.cn_nameiop = CREATE;	nd.ni_cnd.cn_flags = LOCKPARENT;	error = nfs_namei(&nd, fhp, len, nfsd->nd_slp, nam, &md, &dpos,			  nfsd->nd_procp);	if (error)		nfsm_reply(0);	nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);	VATTR_NULL(&va);	va.va_type = VDIR;	va.va_mode = nfstov_mode(*tl++);	vp = nd.ni_vp;	if (vp != NULL) {		VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);		if (nd.ni_dvp == vp)			vrele(nd.ni_dvp);		else			vput(nd.ni_dvp);		vrele(vp);		error = EEXIST;		nfsm_reply(0);	}	nqsrv_getl(nd.ni_dvp, NQL_WRITE);	if ((error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &va)) != 0)		nfsm_reply(0);	vp = nd.ni_vp;	bzero((caddr_t)fhp, sizeof(nfh));	fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid;	if ((error = VFS_VPTOFH(vp, &fhp->fh_fid)) != 0) {		vput(vp);		nfsm_reply(0);	}	error = VOP_GETATTR(vp, &va, cred, nfsd->nd_procp);	vput(vp);	nfsm_reply(NFSX_FH+NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL));	nfsm_srvfhtom(fhp);	nfsm_build(fp, struct nfsv2_fattr *, NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL));	nfsm_srvfillattr;	return (error);nfsmout:	VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);	if (nd.ni_dvp == nd.ni_vp)		vrele(nd.ni_dvp);	else		vput(nd.ni_dvp);	if (nd.ni_vp)		vrele(nd.ni_vp);	return (error);}