diff options
Diffstat (limited to 'sys/kern/vfs_conf.c')
-rw-r--r-- | sys/kern/vfs_conf.c | 172 |
1 files changed, 76 insertions, 96 deletions
diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 527450f20e5..3e3ae79a7d3 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_conf.c,v 1.6 1997/10/06 15:12:37 csapuntz Exp $ */ +/* $OpenBSD: vfs_conf.c,v 1.7 1997/10/06 20:20:09 deraadt Exp $ */ /* $NetBSD: vfs_conf.c,v 1.21.4.1 1995/11/01 00:06:26 jtc Exp $ */ /* @@ -40,28 +40,6 @@ #include <sys/mount.h> #include <sys/vnode.h> -#ifdef FFS -#include <ufs/ufs/quota.h> -#include <ufs/ufs/inode.h> -#include <ufs/ffs/ffs_extern.h> -#endif - -#ifdef CD9660 -#include <isofs/cd9660/iso.h> -#endif - -#ifdef MFS -#include <ufs/mfs/mfs_extern.h> -#endif - -#ifdef NFSCLIENT -#include <nfs/rpcv2.h> -#include <nfs/nfsproto.h> -#include <nfs/nfsnode.h> -#include <nfs/nfs.h> -#include <nfs/nfsmount.h> -#endif - /* * These define the root filesystem and device. */ @@ -72,8 +50,6 @@ struct vnode *rootvnode; * Set up the filesystem operations for vnodes. * The types are defined in mount.h. */ - - #ifdef FFS extern struct vfsops ffs_vfsops; #endif @@ -139,102 +115,107 @@ extern struct vfsops ext2fs_vfsops; #endif /* - * Set up the filesystem operations for vnodes. + * XXX ORDERING MATTERS, for COMPAT_09. when that goes away, + * empty slots can go away. */ -static struct vfsconf vfsconflist[] = { - - /* Fast Filesystem */ +struct vfsops *vfssw[] = { + NULL, /* 0 = MOUNT_NONE */ #ifdef FFS - { &ffs_vfsops, "ffs", 1, 0, MNT_LOCAL, ffs_mountroot, NULL }, + &ffs_vfsops, /* 1 = MOUNT_FFS */ +#else + NULL, #endif - - /* Log-based Filesystem */ -#ifdef LFS - { &lfs_vfsops, "lfs", 5, 0, MNT_LOCAL, lfs_mountroot, NULL }, +#ifdef NFSCLIENT + &nfs_vfsops, /* 2 = MOUNT_NFS */ +#else + NULL, #endif - - /* Memory-based Filesystem */ #ifdef MFS - { &mfs_vfsops, "mfs", 3, 0, MNT_LOCAL, mfs_mountroot, NULL }, + &mfs_vfsops, /* 3 = MOUNT_MFS */ +#else + NULL, #endif - - /* ISO9660 (aka CDROM) Filesystem */ -#ifdef CD9660 - { &cd9660_vfsops, "cd9660", 14, 0, MNT_LOCAL, cd9660_mountroot, NULL }, -#endif - - /* MSDOS Filesystem */ #ifdef MSDOSFS - { &msdosfs_vfsops, "msdos", 4, 0, MNT_LOCAL, NULL, NULL }, + &msdosfs_vfsops, /* 4 = MOUNT_MSDOS */ +#else + NULL, #endif - - /* AmigaDOS Filesystem */ -#ifdef ADOSFS - { &adosfs_vfsops, "adosfs", 16, 0, MNT_LOCAL, NULL, NULL }, +#ifdef LFS + &lfs_vfsops, /* 5 = MOUNT_LFS */ +#else + NULL, #endif - - /* Sun-compatible Network Filesystem */ -#ifdef NFSCLIENT - { &nfs_vfsops, "nfs", 2, 0, 0, nfs_mountroot, NULL }, + NULL, /* 6 = MOUNT_LOFS */ +#ifdef FDESC + &fdesc_vfsops, /* 7 = MOUNT_FDESC */ +#else + NULL, #endif - - /* Andrew Filesystem */ -#ifdef AFS - { &afs_vfsops, "andrewfs", 13, 0, 0, afs_mountroot, NULL }, +#ifdef PORTAL + &portal_vfsops, /* 8 = MOUNT_PORTAL */ +#else + NULL, +#endif +#ifdef NULLFS + &null_vfsops, /* 9 = MOUNT_NULL */ +#else + NULL, +#endif +#ifdef UMAPFS + &umap_vfsops, /* 10 = MOUNT_UMAP */ +#else + NULL, +#endif +#ifdef KERNFS + &kernfs_vfsops, /* 11 = MOUNT_KERNFS */ +#else + NULL, #endif - - /* /proc Filesystem */ #ifdef PROCFS - { &procfs_vfsops, "procfs", 12, 0, 0, NULL, NULL }, + &procfs_vfsops, /* 12 = MOUNT_PROCFS */ +#else + NULL, #endif - - /* Loopback (Minimal) Filesystem Layer */ -#ifdef NULLFS - { &null_vfsops, "loopback", 9, 0, 0, NULL, NULL }, +#ifdef AFS + &afs_vfsops, /* 13 = MOUNT_AFS */ +#else + NULL, #endif - - /* Union (translucent) Filesystem */ -#ifdef UNION - { &union_vfsops, "union", 15, 0, 0, NULL, NULL }, +#ifdef CD9660 + &cd9660_vfsops, /* 14 = MOUNT_ISOFS */ +#else + NULL, #endif - - /* User/Group Identifer Remapping Filesystem */ -#ifdef UMAPFS - { &umap_vfsops, "umap", 10, 0, 0, NULL, NULL }, +#ifdef UNION + &union_vfsops, /* 15 = MOUNT_UNION */ +#else + NULL, #endif - - /* Portal Filesystem */ -#ifdef PORTAL - { &portal_vfsops, "portal", 8, 0, 0, NULL, NULL }, +#ifdef ADOSFS + &adosfs_vfsops, /* 16 = MOUNT_ADOSFS */ +#else + NULL, #endif - - /* File Descriptor Filesystem */ -#ifdef FDESC - { &fdesc_vfsops, "fdesc", 7, 0, 0, NULL, NULL }, +#ifdef EXT2FS + &ext2fs_vfsops, /* 17 = MOUNT_EXT2FS */ +#else + NULL, #endif - - /* Kernel Information Filesystem */ -#ifdef KERNFS - { &kernfs_vfsops, "kernfs", 11, 0, 0, NULL, NULL }, +#ifdef LKM /* for LKM's. add new FS's before these */ + NULL, + NULL, + NULL, + NULL, #endif - + 0 }; - - -/* - * Initially the size of the list, vfs_init will set maxvfsconf - * to the highest defined type number. - */ -int maxvfsconf = sizeof(vfsconflist) / sizeof (struct vfsconf); -struct vfsconf *vfsconf = vfsconflist; - +int nvfssw = sizeof(vfssw) / sizeof(vfssw[0]); /* * 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. */ -extern struct vnodeopv_desc sync_vnodeop_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; @@ -265,7 +246,6 @@ extern struct vnodeopv_desc ext2fs_specop_opv_desc; extern struct vnodeopv_desc ext2fs_fifoop_opv_desc; struct vnodeopv_desc *vfs_opv_descs[] = { - &sync_vnodeop_opv_desc, #ifdef FFS &ffs_vnodeop_opv_desc, &ffs_specop_opv_desc, |