BSD 4_4 release
[unix-history] / usr / src / sys / sys / mount.h
index d71a005..bb8c32a 100644 (file)
@@ -1,10 +1,36 @@
 /*
 /*
- * Copyright (c) 1989, 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)mount.h     7.37 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)mount.h     8.1 (Berkeley) 6/2/93
  */
 
 #ifndef KERNEL
  */
 
 #ifndef KERNEL
@@ -61,7 +87,8 @@ struct statfs {
 #define        MOUNT_PORTAL    8
 #define MOUNT_NULL     9
 #define MOUNT_UMAP     10
 #define        MOUNT_PORTAL    8
 #define MOUNT_NULL     9
 #define MOUNT_UMAP     10
-#define        MOUNT_MAXTYPE   10
+#define MOUNT_KERNFS   11
+#define        MOUNT_MAXTYPE   11
 
 #define INITMOUNTNAMES { \
        "none",         /*  0 MOUNT_NONE */ \
 
 #define INITMOUNTNAMES { \
        "none",         /*  0 MOUNT_NONE */ \
@@ -75,7 +102,8 @@ struct statfs {
        "portal",       /*  8 MOUNT_PORTAL */ \
        "null",         /*  9 MOUNT_NULL */ \
        "umap",         /* 10 MOUNT_UMAP */ \
        "portal",       /*  8 MOUNT_PORTAL */ \
        "null",         /*  9 MOUNT_NULL */ \
        "umap",         /* 10 MOUNT_UMAP */ \
-       0,              /* 11 MOUNT_SPARE */ \
+       "kernfs",       /* 11 MOUNT_KERNFS */ \
+       0,              /* 12 MOUNT_SPARE */ \
 }
 
 /*
 }
 
 /*
@@ -97,12 +125,15 @@ struct mount {
 
 /*
  * Mount flags.
 
 /*
  * Mount flags.
+ *
+ * Unmount uses MNT_FORCE flag.
  */
 #define        MNT_RDONLY      0x00000001      /* read only filesystem */
 #define        MNT_SYNCHRONOUS 0x00000002      /* file system written synchronously */
 #define        MNT_NOEXEC      0x00000004      /* can't exec from filesystem */
 #define        MNT_NOSUID      0x00000008      /* don't honor setuid bits on fs */
 #define        MNT_NODEV       0x00000010      /* don't interpret special files */
  */
 #define        MNT_RDONLY      0x00000001      /* read only filesystem */
 #define        MNT_SYNCHRONOUS 0x00000002      /* file system written synchronously */
 #define        MNT_NOEXEC      0x00000004      /* can't exec from filesystem */
 #define        MNT_NOSUID      0x00000008      /* don't honor setuid bits on fs */
 #define        MNT_NODEV       0x00000010      /* don't interpret special files */
+#define        MNT_UNION       0x00000020      /* union with underlying filesystem */
 
 /*
  * exported mount flags.
 
 /*
  * exported mount flags.
@@ -133,11 +164,14 @@ struct mount {
  */
 #define        MNT_UPDATE      0x00010000      /* not a real mount, just an update */
 #define        MNT_DELEXPORT   0x00020000      /* delete export host lists */
  */
 #define        MNT_UPDATE      0x00010000      /* not a real mount, just an update */
 #define        MNT_DELEXPORT   0x00020000      /* delete export host lists */
+#define        MNT_RELOAD      0x00040000      /* reload filesystem data */
+#define        MNT_FORCE       0x00080000      /* force unmount or readonly change */
 #define        MNT_MLOCK       0x00100000      /* lock so that subtree is stable */
 #define        MNT_MWAIT       0x00200000      /* someone is waiting for lock */
 #define MNT_MPBUSY     0x00400000      /* scan of mount point in progress */
 #define MNT_MPWANT     0x00800000      /* waiting for mount point */
 #define MNT_UNMOUNT    0x01000000      /* unmount in progress */
 #define        MNT_MLOCK       0x00100000      /* lock so that subtree is stable */
 #define        MNT_MWAIT       0x00200000      /* someone is waiting for lock */
 #define MNT_MPBUSY     0x00400000      /* scan of mount point in progress */
 #define MNT_MPWANT     0x00800000      /* waiting for mount point */
 #define MNT_UNMOUNT    0x01000000      /* unmount in progress */
+#define MNT_WANTRDWR   0x02000000      /* want upgrade to read/write */
 
 /*
  * Operations supported on mounted file system.
 
 /*
  * Operations supported on mounted file system.
@@ -188,11 +222,8 @@ struct vfsops {
 /*
  * Flags for various system call interfaces.
  *
 /*
  * Flags for various system call interfaces.
  *
- * forcibly flags for vfs_umount().
  * waitfor flags to vfs_sync() and getfsstat()
  */
  * waitfor flags to vfs_sync() and getfsstat()
  */
-#define MNT_FORCE      1
-#define MNT_NOFORCE    2
 #define MNT_WAIT       1
 #define MNT_NOWAIT     2
 
 #define MNT_WAIT       1
 #define MNT_NOWAIT     2
 
@@ -205,35 +236,18 @@ struct fhandle {
 };
 typedef struct fhandle fhandle_t;
 
 };
 typedef struct fhandle fhandle_t;
 
-/*
- * Network address hash list element
- */
-union nethostaddr {
-       u_long had_inetaddr;
-       struct mbuf *had_nam;
-};
-
-struct netaddrhash {
-       struct netaddrhash *neth_next;
-       struct ucred    neth_anon;
-       u_short         neth_family;
-       union nethostaddr neth_haddr;
-       union nethostaddr neth_hmask;
-       int             neth_exflags;
-};
-#define        neth_inetaddr   neth_haddr.had_inetaddr
-#define        neth_inetmask   neth_hmask.had_inetaddr
-#define        neth_nam        neth_haddr.had_nam
-#define        neth_msk        neth_hmask.had_nam
+#ifdef KERNEL
+#include <net/radix.h>
 
 /*
 
 /*
- * Network address hashing defs.
+ * Network address lookup element
  */
  */
-#define        NETHASHSZ       8       /* Must be a power of 2 <= 256 */
-#define        NETMASK_HASH    NETHASHSZ /* Last hash table element is for networks */
-#define        NETADDRHASH(a)  \
-       (((a)->sa_family == AF_INET) ? ((a)->sa_data[5] & (NETHASHSZ - 1)) : \
-        (((a)->sa_family == AF_ISO) ? iso_addrhash(a) : 0))
+struct netcred {
+       struct  radix_node netc_rnodes[2];
+       int     netc_exflags;
+       struct  ucred netc_anon;
+};
+#endif /* KERNEL */
 
 /*
  * Arguments to mount UFS-based filesystems
 
 /*
  * Arguments to mount UFS-based filesystems