np->n_direofoffset = 0;
if (vp->v_type == VDIR) np->n_direofoffset = 0;
nfs_open(v)	void *v;{	struct vop_open_args /* {		struct vnode *a_vp;		int  a_mode;		struct ucred *a_cred;		struct proc *a_p;	} */ *ap = v;	register struct vnode *vp = ap->a_vp;	struct nfsnode *np = VTONFS(vp);	struct nfsmount *nmp = VFSTONFS(vp->v_mount);	struct vattr vattr;	int error;	if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK)		return (EACCES);	if (vp->v_flag & VTEXT) {	    /*	     * Get a valid lease. If cached data is stale, flush it.	     */	    if (nmp->nm_flag & NFSMNT_NQNFS) {		if (NQNFS_CKINVALID(vp, np, NQL_READ)) {		    do {			error = nqnfs_getlease(vp, NQL_READ, ap->a_cred, ap->a_p);		    } while (error == NQNFS_EXPIRED);		    if (error)			return (error);		    if (np->n_lrev != np->n_brev ||			(np->n_flag & NQNFSNONCACHE)) {			if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,				ap->a_p, 1)) == EINTR)				return (error);			(void) vnode_pager_uncache(vp);			np->n_brev = np->n_lrev;		    }		}	    } else {		if (np->n_flag & NMODIFIED) {			if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,				ap->a_p, 1)) == EINTR)				return (error);			(void) vnode_pager_uncache(vp);			np->n_attrstamp = 0;			np->n_direofoffset = 0;			error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);			if (error)				return (error);			np->n_mtime = vattr.va_mtime.tv_sec;		} else {			error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);			if (error)				return (error);			if (np->n_mtime != vattr.va_mtime.tv_sec) {				np->n_direofoffset = 0;				if ((error = nfs_vinvalbuf(vp, V_SAVE,					ap->a_cred, ap->a_p, 1)) == EINTR)					return (error);				(void) vnode_pager_uncache(vp);				np->n_mtime = vattr.va_mtime.tv_sec;			}		}	    }	} else if ((nmp->nm_flag & NFSMNT_NQNFS) == 0)		np->n_attrstamp = 0; /* For Open/Close consistency */	return (0);}