Module Name:    src
Committed By:   chs
Date:           Fri Jun  9 00:13:29 UTC 2017

Modified Files:
        src/sys/sys: mount.h
        src/usr.bin/fstat: ptyfs.c tmpfs.c
        src/usr.bin/pmap: pmap.h
        src/usr.bin/systat: bufcache.c

Log Message:
rearrange sys/mount.h so that all of the kernel-only parts are together
and not exposed to userland, except do expose struct mount if __EXPOSE_MOUNT
is defined.  define __EXPOSE_MOUNT in the kmem grovellers that want
the definition.  needed for ZFS.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/sys/mount.h
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/fstat/ptyfs.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/fstat/tmpfs.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/pmap/pmap.h
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/systat/bufcache.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/mount.h
diff -u src/sys/sys/mount.h:1.228 src/sys/sys/mount.h:1.229
--- src/sys/sys/mount.h:1.228	Wed May 24 09:53:55 2017
+++ src/sys/sys/mount.h	Fri Jun  9 00:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.228 2017/05/24 09:53:55 hannken Exp $	*/
+/*	$NetBSD: mount.h,v 1.229 2017/06/09 00:13:29 chs Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -44,14 +44,16 @@
 #ifndef _STANDALONE
 #include <sys/param.h> /* precautionary upon removal from ucred.h */
 #include <sys/time.h>
-#include <sys/uio.h>
 #include <sys/ucred.h>
 #include <sys/fstypes.h>
+#include <sys/statvfs.h>
+#if defined(_KERNEL) || defined(__EXPOSE_MOUNT)
+#include <sys/uio.h>
 #include <sys/queue.h>
 #include <sys/rwlock.h>
-#include <sys/statvfs.h>
 #include <sys/specificdata.h>
 #include <sys/condvar.h>
+#endif	/* defined(_KERNEL) || defined(__EXPOSE_MOUNT) */
 #endif	/* !_STANDALONE */
 
 /*
@@ -97,8 +99,27 @@
 #define MOUNT_RUMPFS	"rumpfs"	/* rump virtual file system */
 #define	MOUNT_V7FS	"v7fs"		/* 7th Edition of Unix Filesystem */
 
+/*
+ * Sysctl CTL_VFS definitions.
+ *
+ * Second level identifier specifies which filesystem. Second level
+ * identifier VFS_GENERIC returns information about all filesystems.
+ *
+ * Note the slightly non-flat nature of these sysctl numbers.  Oh for
+ * a better sysctl interface.
+ */
+#define VFS_GENERIC	0		/* generic filesystem information */
+#define VFS_MAXTYPENUM	1		/* int: highest defined fs type */
+#define VFS_CONF	2		/* struct: vfsconf for filesystem given
+					   as next argument */
+#define VFS_USERMOUNT	3		/* enable/disable fs mnt by non-root */
+#define	VFS_MAGICLINKS  4		/* expand 'magic' symlinks */
+#define	VFSGEN_MAXID	5		/* number of valid vfs.generic ids */
+
 #ifndef _STANDALONE
 
+#if defined(_KERNEL) || defined(__EXPOSE_MOUNT)
+
 struct vnode;
 struct vnode_impl;
 struct vattr;
@@ -133,22 +154,9 @@ struct mount {
 	uint64_t	mnt_gen;
 };
 
-/*
- * Sysctl CTL_VFS definitions.
- *
- * Second level identifier specifies which filesystem. Second level
- * identifier VFS_GENERIC returns information about all filesystems.
- *
- * Note the slightly non-flat nature of these sysctl numbers.  Oh for
- * a better sysctl interface.
- */
-#define VFS_GENERIC	0		/* generic filesystem information */
-#define VFS_MAXTYPENUM	1		/* int: highest defined fs type */
-#define VFS_CONF	2		/* struct: vfsconf for filesystem given
-					   as next argument */
-#define VFS_USERMOUNT	3		/* enable/disable fs mnt by non-root */
-#define	VFS_MAGICLINKS  4		/* expand 'magic' symlinks */
-#define	VFSGEN_MAXID	5		/* number of valid vfs.generic ids */
+#endif /* defined(_KERNEL) || defined(__EXPOSE_MOUNT) */
+
+#ifdef _KERNEL
 
 /*
  * USE THE SAME NAMES AS MOUNT_*!
@@ -189,8 +197,6 @@ struct mount {
 	{ "magiclinks", CTLTYPE_INT }, \
 }
 
-#if defined(_KERNEL)
-
 struct quotactl_args;		/* in sys/quotactl.h */
 struct quotastat;		/* in sys/quotactl.h */
 struct quotaidtypestat;		/* in sys/quotactl.h */
@@ -199,10 +205,6 @@ struct quotakcursor;		/* in sys/quotactl
 struct quotakey;		/* in sys/quota.h */
 struct quotaval;		/* in sys/quota.h */
 
-#if __STDC__
-struct nameidata;
-#endif
-
 /*
  * Operations supported on mounted file system.
  */
@@ -268,14 +270,8 @@ int	VFS_SNAPSHOT(struct mount *, struct 
 int	VFS_EXTATTRCTL(struct mount *, int, struct vnode *, int, const char *);
 int	VFS_SUSPENDCTL(struct mount *, int);
 
-#endif /* _KERNEL */
-
-#ifdef _KERNEL
-#if __STDC__
-struct mbuf;
 struct vnodeopv_desc;
 struct kauth_cred;
-#endif
 
 #define	VFS_MAX_MOUNT_DATA	8192
 

Index: src/usr.bin/fstat/ptyfs.c
diff -u src/usr.bin/fstat/ptyfs.c:1.6 src/usr.bin/fstat/ptyfs.c:1.7
--- src/usr.bin/fstat/ptyfs.c:1.6	Sun Apr 12 06:36:12 2009
+++ src/usr.bin/fstat/ptyfs.c	Fri Jun  9 00:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptyfs.c,v 1.6 2009/04/12 06:36:12 lukem Exp $	*/
+/*	$NetBSD: ptyfs.c,v 1.7 2017/06/09 00:13:29 chs Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: ptyfs.c,v 1.6 2009/04/12 06:36:12 lukem Exp $");
+__RCSID("$NetBSD: ptyfs.c,v 1.7 2017/06/09 00:13:29 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -38,6 +38,7 @@ __RCSID("$NetBSD: ptyfs.c,v 1.6 2009/04/
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 
 #include <stdbool.h>

Index: src/usr.bin/fstat/tmpfs.c
diff -u src/usr.bin/fstat/tmpfs.c:1.10 src/usr.bin/fstat/tmpfs.c:1.11
--- src/usr.bin/fstat/tmpfs.c:1.10	Sat Jan 23 16:12:03 2016
+++ src/usr.bin/fstat/tmpfs.c	Fri Jun  9 00:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs.c,v 1.10 2016/01/23 16:12:03 christos Exp $	*/
+/*	$NetBSD: tmpfs.c,v 1.11 2017/06/09 00:13:29 chs Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tmpfs.c,v 1.10 2016/01/23 16:12:03 christos Exp $");
+__RCSID("$NetBSD: tmpfs.c,v 1.11 2017/06/09 00:13:29 chs Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -35,6 +35,7 @@ __RCSID("$NetBSD: tmpfs.c,v 1.10 2016/01
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 
 #include <fs/tmpfs/tmpfs.h>

Index: src/usr.bin/pmap/pmap.h
diff -u src/usr.bin/pmap/pmap.h:1.9 src/usr.bin/pmap/pmap.h:1.10
--- src/usr.bin/pmap/pmap.h:1.9	Thu Dec 22 22:41:02 2016
+++ src/usr.bin/pmap/pmap.h	Fri Jun  9 00:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.9 2016/12/22 22:41:02 mrg Exp $ */
+/*	$NetBSD: pmap.h,v 1.10 2017/06/09 00:13:29 chs Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/vnode.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 #include <sys/uio.h>
 #include <sys/namei.h>

Index: src/usr.bin/systat/bufcache.c
diff -u src/usr.bin/systat/bufcache.c:1.27 src/usr.bin/systat/bufcache.c:1.28
--- src/usr.bin/systat/bufcache.c:1.27	Mon Oct 24 00:40:17 2016
+++ src/usr.bin/systat/bufcache.c	Fri Jun  9 00:13:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bufcache.c,v 1.27 2016/10/24 00:40:17 christos Exp $	*/
+/*	$NetBSD: bufcache.c,v 1.28 2017/06/09 00:13:29 chs Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,11 +31,12 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: bufcache.c,v 1.27 2016/10/24 00:40:17 christos Exp $");
+__RCSID("$NetBSD: bufcache.c,v 1.28 2017/06/09 00:13:29 chs Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/buf.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 #include <sys/sysctl.h>
 #include <sys/vnode.h>

Reply via email to