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 (slovic...@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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to