Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 May 2013 21:48:09 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250580 - head/sys/fs/nfsclient
Message-ID:  <201305122148.r4CLm9e9090928@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun May 12 21:48:08 2013
New Revision: 250580
URL: http://svnweb.freebsd.org/changeset/base/250580

Log:
  Add support for the eofflag to nfs_readdir() in the new NFS
  client so that it works under a unionfs mount.
  
  Submitted by:	Jared Yanovich (slovichon@gmail.com)
  Reviewed by:	kib
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Sun May 12 21:24:18 2013	(r250579)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Sun May 12 21:48:08 2013	(r250580)
@@ -2232,6 +2232,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);
 
@@ -2246,6 +2248,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);
@@ -2258,8 +2262,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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305122148.r4CLm9e9090928>