BSD 4_4 release
[unix-history] / usr / src / sys / kern / vfs_conf.c
index 12153f7..6f785fb 100644 (file)
@@ -1,10 +1,36 @@
 /*
 /*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 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.
  *
  *
- *     @(#)vfs_conf.c  7.13 (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.
+ *
+ *     @(#)vfs_conf.c  8.1 (Berkeley) 6/10/93
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -80,6 +106,28 @@ extern      struct vfsops portal_vfsops;
 #define        PORTAL_VFSOPS   NULL
 #endif
 
 #define        PORTAL_VFSOPS   NULL
 #endif
 
+#ifdef NULLFS
+extern struct vfsops null_vfsops;
+#define NULL_VFSOPS    &null_vfsops
+#else
+#define NULL_VFSOPS    NULL
+#endif
+
+#ifdef UMAPFS
+extern struct vfsops umap_vfsops;
+#define UMAP_VFSOPS    &umap_vfsops
+#else
+#define UMAP_VFSOPS    NULL
+#endif
+
+#ifdef KERNFS
+extern struct vfsops kernfs_vfsops;
+#define KERNFS_VFSOPS  &kernfs_vfsops
+#else
+#define KERNFS_VFSOPS  NULL
+#endif
+
+
 struct vfsops *vfssw[] = {
        NULL,                   /* 0 = MOUNT_NONE */
        UFS_VFSOPS,             /* 1 = MOUNT_UFS */
 struct vfsops *vfssw[] = {
        NULL,                   /* 0 = MOUNT_NONE */
        UFS_VFSOPS,             /* 1 = MOUNT_UFS */
@@ -90,117 +138,20 @@ struct vfsops *vfssw[] = {
        LOFS_VFSOPS,            /* 6 = MOUNT_LOFS */
        FDESC_VFSOPS,           /* 7 = MOUNT_FDESC */
        PORTAL_VFSOPS,          /* 8 = MOUNT_PORTAL */
        LOFS_VFSOPS,            /* 6 = MOUNT_LOFS */
        FDESC_VFSOPS,           /* 7 = MOUNT_FDESC */
        PORTAL_VFSOPS,          /* 8 = MOUNT_PORTAL */
+       NULL_VFSOPS,            /* 9 = MOUNT_NULL */
+       UMAP_VFSOPS,            /* 10 = MOUNT_UMAP */
+       KERNFS_VFSOPS,          /* 11 = MOUNT_KERNFS */
+       0
 };
 
 
 };
 
 
-/*
- * Vnode_op_descs lists all vnode operations supported.
- * At boot time vfs_op_init examines this list
- * to configure vnode operations vectors.
- */
-
-extern struct vnodeop_desc
-       vop_lookup_desc,
-       vop_create_desc,
-       vop_mknod_desc,
-       vop_open_desc,
-       vop_close_desc,
-       vop_access_desc,
-       vop_getattr_desc,
-       vop_setattr_desc,
-       vop_read_desc,
-       vop_write_desc,
-       vop_ioctl_desc,
-       vop_select_desc,
-       vop_mmap_desc,
-       vop_fsync_desc,
-       vop_seek_desc,
-       vop_remove_desc,
-       vop_link_desc,
-       vop_rename_desc,
-       vop_mkdir_desc,
-       vop_rmdir_desc,
-       vop_symlink_desc,
-       vop_readdir_desc,
-       vop_readlink_desc,
-       vop_abortop_desc,
-       vop_inactive_desc,
-       vop_reclaim_desc,
-       vop_lock_desc,
-       vop_unlock_desc,
-       vop_bmap_desc,
-       vop_strategy_desc,
-       vop_print_desc,
-       vop_islocked_desc,
-       vop_advlock_desc,
-       vop_blkatoff_desc,
-       vop_valloc_desc,
-       vop_vfree_desc,
-       vop_truncate_desc,
-       vop_update_desc,
-       vop_bwrite_desc,
-/* and the default */
-       vop_default_desc;
-
-struct vnodeop_desc *vfs_op_descs[] = {
-       &vop_default_desc,   /* must be first */
-       &vop_lookup_desc,
-       &vop_create_desc,
-       &vop_mknod_desc,
-       &vop_open_desc,
-       &vop_close_desc,
-       &vop_access_desc,
-       &vop_getattr_desc,
-       &vop_setattr_desc,
-       &vop_read_desc,
-       &vop_write_desc,
-       &vop_ioctl_desc,
-       &vop_select_desc,
-       &vop_mmap_desc,
-       &vop_fsync_desc,
-       &vop_seek_desc,
-       &vop_remove_desc,
-       &vop_link_desc,
-       &vop_rename_desc,
-       &vop_mkdir_desc,
-       &vop_rmdir_desc,
-       &vop_symlink_desc,
-       &vop_readdir_desc,
-       &vop_readlink_desc,
-       &vop_abortop_desc,
-       &vop_inactive_desc,
-       &vop_reclaim_desc,
-       &vop_lock_desc,
-       &vop_unlock_desc,
-       &vop_bmap_desc,
-       &vop_strategy_desc,
-       &vop_print_desc,
-       &vop_islocked_desc,
-       &vop_advlock_desc,
-       &vop_blkatoff_desc,
-       &vop_valloc_desc,
-       &vop_vfree_desc,
-       &vop_truncate_desc,
-       &vop_update_desc,
-       &vop_bwrite_desc,
-       NULL
-};
-
-
-
-
 /*
  *
 /*
  *
- * vfs_opv_descs enumerates the list of vnode classes,
- * each with it's own vnode operation vector.
- * It is consulted at system
- * boot to build operation vectors.
- * It's also null terminated.
+ * vfs_opv_descs enumerates the list of vnode classes, each with it's own
+ * vnode operation vector.  It is consulted at system boot to build operation
+ * vectors.  It is NULL terminated.
  *
  *
- * Out-of-kernel, someone else (more knowlegable about what file
- * systems live in this address space) must specify this table.
  */
  */
-
 extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
 extern struct vnodeopv_desc ffs_specop_opv_desc;
 extern struct vnodeopv_desc ffs_fifoop_opv_desc;
 extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
 extern struct vnodeopv_desc ffs_specop_opv_desc;
 extern struct vnodeopv_desc ffs_fifoop_opv_desc;
@@ -217,6 +168,9 @@ extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
 extern struct vnodeopv_desc lofs_vnodeop_opv_desc;
 extern struct vnodeopv_desc fdesc_vnodeop_opv_desc;
 extern struct vnodeopv_desc portal_vnodeop_opv_desc;
 extern struct vnodeopv_desc lofs_vnodeop_opv_desc;
 extern struct vnodeopv_desc fdesc_vnodeop_opv_desc;
 extern struct vnodeopv_desc portal_vnodeop_opv_desc;
+extern struct vnodeopv_desc null_vnodeop_opv_desc;
+extern struct vnodeopv_desc umap_vnodeop_opv_desc;
+extern struct vnodeopv_desc kernfs_vnodeop_opv_desc;
 
 struct vnodeopv_desc *vfs_opv_descs[] = {
        &ffs_vnodeop_opv_desc,
 
 struct vnodeopv_desc *vfs_opv_descs[] = {
        &ffs_vnodeop_opv_desc,
@@ -254,6 +208,15 @@ struct vnodeopv_desc *vfs_opv_descs[] = {
 #endif
 #ifdef PORTAL
        &portal_vnodeop_opv_desc,
 #endif
 #ifdef PORTAL
        &portal_vnodeop_opv_desc,
+#endif
+#ifdef NULLFS
+       &null_vnodeop_opv_desc,
+#endif
+#ifdef UMAPFS
+       &umap_vnodeop_opv_desc,
+#endif
+#ifdef KERNFS
+       &kernfs_vnodeop_opv_desc,
 #endif
        NULL
 };
 #endif
        NULL
 };