svn commit: r250996 - stable/9/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Sun May 26 12:36:57 UTC 2013


Author: rmacklem
Date: Sun May 26 12:36:56 2013
New Revision: 250996
URL: http://svnweb.freebsd.org/changeset/base/250996

Log:
  MFC: r250580
  Add support for the eofflag to nfs_readdir() in the new NFS
  client so that it works under a unionfs mount.

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Sun May 26 09:25:14 2013	(r250995)
+++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Sun May 26 12:36:56 2013	(r250996)
@@ -2207,6 +2207,8 @@ nfs_readdir(struct vop_readdir_args *ap)
 	int error = 0;
 	struct vattr vattr;
 	
+	if (ap->a_eofflag != NULL)
+		*ap->a_eofflag = 0;
 	if (vp->v_type != VDIR) 
 		return(EPERM);
 
@@ -2221,6 +2223,8 @@ nfs_readdir(struct vop_readdir_args *ap)
 			    !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) {
 				mtx_unlock(&np->n_mtx);
 				NFSINCRGLOBAL(newnfsstats.direofcache_hits);
+				if (ap->a_eofflag != NULL)
+					*ap->a_eofflag = 1;
 				return (0);
 			} else
 				mtx_unlock(&np->n_mtx);
@@ -2233,8 +2237,11 @@ nfs_readdir(struct vop_readdir_args *ap)
 	tresid = uio->uio_resid;
 	error = ncl_bioread(vp, uio, 0, ap->a_cred);
 
-	if (!error && uio->uio_resid == tresid)
+	if (!error && uio->uio_resid == tresid) {
 		NFSINCRGLOBAL(newnfsstats.direofcache_misses);
+		if (ap->a_eofflag != NULL)
+			*ap->a_eofflag = 1;
+	}
 	return (error);
 }
 


More information about the svn-src-stable-9 mailing list