Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src rearrange sys/mount.h so that all of the kernel-only parts a...



details:   https://anonhg.NetBSD.org/src/rev/a900e5a7c569
branches:  trunk
changeset: 824566:a900e5a7c569
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Jun 09 00:13:29 2017 +0000

description:
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.

diffstat:

 sys/sys/mount.h           |  58 +++++++++++++++++++++-------------------------
 usr.bin/fstat/ptyfs.c     |   5 ++-
 usr.bin/fstat/tmpfs.c     |   5 ++-
 usr.bin/pmap/pmap.h       |   3 +-
 usr.bin/systat/bufcache.c |   5 ++-
 5 files changed, 38 insertions(+), 38 deletions(-)

diffs (209 lines):

diff -r 6a8e7c288163 -r a900e5a7c569 sys/sys/mount.h
--- a/sys/sys/mount.h   Fri Jun 09 00:13:08 2017 +0000
+++ b/sys/sys/mount.h   Fri Jun 09 00:13:29 2017 +0000
@@ -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 @@
        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 @@
        { "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 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_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
 
diff -r 6a8e7c288163 -r a900e5a7c569 usr.bin/fstat/ptyfs.c
--- a/usr.bin/fstat/ptyfs.c     Fri Jun 09 00:13:08 2017 +0000
+++ b/usr.bin/fstat/ptyfs.c     Fri Jun 09 00:13:29 2017 +0000
@@ -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 @@
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 
 #include <stdbool.h>
diff -r 6a8e7c288163 -r a900e5a7c569 usr.bin/fstat/tmpfs.c
--- a/usr.bin/fstat/tmpfs.c     Fri Jun 09 00:13:08 2017 +0000
+++ b/usr.bin/fstat/tmpfs.c     Fri Jun 09 00:13:29 2017 +0000
@@ -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 @@
 #include <sys/proc.h>
 #include <sys/stat.h>
 #include <sys/vnode.h>
+#define __EXPOSE_MOUNT
 #include <sys/mount.h>
 
 #include <fs/tmpfs/tmpfs.h>
diff -r 6a8e7c288163 -r a900e5a7c569 usr.bin/pmap/pmap.h
--- a/usr.bin/pmap/pmap.h       Fri Jun 09 00:13:08 2017 +0000
+++ b/usr.bin/pmap/pmap.h       Fri Jun 09 00:13:29 2017 +0000
@@ -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>
diff -r 6a8e7c288163 -r a900e5a7c569 usr.bin/systat/bufcache.c
--- a/usr.bin/systat/bufcache.c Fri Jun 09 00:13:08 2017 +0000
+++ b/usr.bin/systat/bufcache.c Fri Jun 09 00:13:29 2017 +0000
@@ -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>



Home | Main Index | Thread Index | Old Index