*ap->a_eofflag = 0;
nfs_readdir(v)	void *v;{	struct vop_readdir_args /* {		struct vnode *a_vp;		struct uio *a_uio;		struct ucred *a_cred;		int *a_eofflag;		u_long *a_cookies;		int a_ncookies;	} */ *ap = v;	register struct vnode *vp = ap->a_vp;	register struct nfsnode *np = VTONFS(vp);	register struct uio *uio = ap->a_uio;	char *base = uio->uio_iov->iov_base;	int tresid, error;	struct vattr vattr;	if (vp->v_type != VDIR)		return (EPERM);	/*	 * First, check for hit on the EOF offset cache	 */	if (uio->uio_offset != 0 && uio->uio_offset == np->n_direofoffset &&	    (np->n_flag & NMODIFIED) == 0) {		if (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NQNFS) {			if (NQNFS_CKCACHABLE(vp, NQL_READ)) {				nfsstats.direofcache_hits++;				return (0);			}		} else if (VOP_GETATTR(vp, &vattr, ap->a_cred, uio->uio_procp) == 0 &&			np->n_mtime == vattr.va_mtime.tv_sec) {			nfsstats.direofcache_hits++;			return (0);		}	}	/*	 * Call nfs_bioread() to do the real work.	 */	tresid = uio->uio_resid;	error = nfs_bioread(vp, uio, 0, ap->a_cred);	if (!error && uio->uio_resid == tresid)		nfsstats.direofcache_misses++;	if (!error && ap->a_cookies) {		struct dirent *dp;		u_long *cptr, *cookies = ap->a_cookies;		int ncookies = ap->a_ncookies;		/*		 * Only the NFS server and emulations use cookies, and they		 * load the directory block into system space, so we can		 * just look at it directly.		 */		if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)			panic("ufs_readdir: lost in space");		while (ncookies-- && base < uio->uio_iov->iov_base) {			dp = (struct dirent *) base;			if (dp->d_reclen == 0)				break;			cptr = (u_long *)((caddr_t)dp + dp->d_reclen -					  sizeof(u_long));			*(cookies++) = *cptr;			base += dp->d_reclen;		}		uio->uio_resid += (uio->uio_iov->iov_base - base);		uio->uio_iov->iov_len += (uio->uio_iov->iov_base - base);		uio->uio_iov->iov_base = base;	}	return (error);}