u_quad_t frev, tsize = 0;
int error = 0; u_quad_t tsize = 0;
nfs_setattr(v)	void *v;{	struct vop_setattr_args /* {		struct vnodeop_desc *a_desc;		struct vnode *a_vp;		struct vattr *a_vap;		struct ucred *a_cred;		struct proc *a_p;	} */ *ap = v;	register struct nfsv2_sattr *sp;	register caddr_t cp;	register int32_t t1;	caddr_t bpos, dpos, cp2;	u_int32_t *tl;	int error = 0, isnq;	struct mbuf *mreq, *mrep, *md, *mb, *mb2;	register struct vnode *vp = ap->a_vp;	register struct nfsnode *np = VTONFS(vp);	register struct vattr *vap = ap->a_vap;	u_quad_t frev, tsize = 0;	if (vap->va_size != VNOVAL) {		switch (vp->v_type) {		case VDIR:			return (EISDIR);		case VCHR:		case VBLK:			if (vap->va_mtime.tv_sec == VNOVAL &&			    vap->va_atime.tv_sec == VNOVAL &&			    vap->va_mode == (u_short)VNOVAL &&			    vap->va_uid == VNOVAL &&			    vap->va_gid == VNOVAL)				return (0);			vap->va_size = VNOVAL;			break;		default:			if (np->n_flag & NMODIFIED) {				if (vap->va_size == 0)					error = nfs_vinvalbuf(vp, 0,						ap->a_cred, ap->a_p, 1);				else					error = nfs_vinvalbuf(vp, V_SAVE,						ap->a_cred, ap->a_p, 1);				if (error)					return (error);			}			tsize = np->n_size;			np->n_size = np->n_vattr.va_size = vap->va_size;			vnode_pager_setsize(vp, (u_long)np->n_size);		}	} else if ((vap->va_mtime.tv_sec != VNOVAL ||	    vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED)) {		error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_p, 1);		if (error == EINTR)			return (error);	}	nfsstats.rpccnt[NFSPROC_SETATTR]++;	isnq = (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NQNFS);	nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH+NFSX_SATTR(isnq));	nfsm_fhtom(vp);	nfsm_build(sp, struct nfsv2_sattr *, NFSX_SATTR(isnq));	if (vap->va_mode == (u_short)VNOVAL)		sp->sa_mode = nfs_xdrneg1;	else		sp->sa_mode = vtonfs_mode(vp->v_type, vap->va_mode);	if (vap->va_uid == VNOVAL)		sp->sa_uid = nfs_xdrneg1;	else		sp->sa_uid = txdr_unsigned(vap->va_uid);	if (vap->va_gid == VNOVAL)		sp->sa_gid = nfs_xdrneg1;	else		sp->sa_gid = txdr_unsigned(vap->va_gid);	if (isnq) {		txdr_hyper(&vap->va_size, &sp->sa_nqsize);		txdr_nqtime(&vap->va_atime, &sp->sa_nqatime);		txdr_nqtime(&vap->va_mtime, &sp->sa_nqmtime);		sp->sa_nqflags = txdr_unsigned(vap->va_flags);		sp->sa_nqrdev = nfs_xdrneg1;	} else {		sp->sa_nfssize = txdr_unsigned(vap->va_size);		txdr_nfstime(&vap->va_atime, &sp->sa_nfsatime);		txdr_nfstime(&vap->va_mtime, &sp->sa_nfsmtime);	}	nfsm_request(vp, NFSPROC_SETATTR, ap->a_p, ap->a_cred);	nfsm_loadattr(vp, (struct vattr *)0);	if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NQNFS) &&	    NQNFS_CKCACHABLE(vp, NQL_WRITE)) {		nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);		fxdr_hyper(tl, &frev);		if (frev > np->n_brev)			np->n_brev = frev;	}	nfsm_reqdone;	if (error) {		np->n_size = np->n_vattr.va_size = tsize;		vnode_pager_setsize(vp, (u_long)np->n_size);	}	return (error);}