Author: rmacklem
Date: Sun May  1 22:19:52 2011
New Revision: 221306
URL: http://svn.freebsd.org/changeset/base/221306

Log:
  Add the kernel support needed to zero out the nfsstats
  structure for the new NFS subsystem. This will be used
  by nfsstats.c to implement the "-z" option.
  
  MFC after:    2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/nfs/nfssvc.h

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c    Sun May  1 20:46:37 2011        
(r221305)
+++ head/sys/fs/nfs/nfs_commonport.c    Sun May  1 22:19:52 2011        
(r221306)
@@ -404,6 +404,8 @@ nfssvc_call(struct thread *p, struct nfs
        } else if (uap->flag & NFSSVC_GETSTATS) {
                error = copyout(&newnfsstats,
                    CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats));
+               if ((uap->flag & NFSSVC_ZEROSTATS) != 0 && error == 0)
+                       bzero(&newnfsstats, sizeof(newnfsstats));
                return (error);
        } else if (uap->flag & NFSSVC_NFSUSERDPORT) {
                u_short sockport;

Modified: head/sys/nfs/nfssvc.h
==============================================================================
--- head/sys/nfs/nfssvc.h       Sun May  1 20:46:37 2011        (r221305)
+++ head/sys/nfs/nfssvc.h       Sun May  1 22:19:52 2011        (r221306)
@@ -64,5 +64,6 @@
 #define        NFSSVC_CBADDSOCK        0x00200000
 #define        NFSSVC_GETSTATS         0x00400000
 #define        NFSSVC_BACKUPSTABLE     0x00800000
+#define        NFSSVC_ZEROSTATS        0x01000000      /* modifier for 
GETSTATS */
 
 #endif /* _NFS_NFSSVC_H */
_______________________________________________
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