1 /* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)vfs_conf.c 8.8 (Berkeley) 03/31/94 8 */ 9 10 #include <sys/param.h> 11 #include <sys/mount.h> 12 #include <sys/vnode.h> 13 14 #ifdef FFS 15 #include <ufs/ffs/ffs_extern.h> 16 17 /* 18 * This specifies the filesystem used to mount the root. 19 * This specification should be done by /etc/config. 20 */ 21 int (*mountroot)() = ffs_mountroot; 22 #endif 23 24 /* 25 * These define the root filesystem and device. 26 */ 27 struct mount *rootfs; 28 struct vnode *rootvnode; 29 30 /* 31 * Set up the filesystem operations for vnodes. 32 * The types are defined in mount.h. 33 */ 34 #ifdef FFS 35 extern struct vfsops ufs_vfsops; 36 #define UFS_VFSOPS &ufs_vfsops 37 #else 38 #define UFS_VFSOPS NULL 39 #endif 40 41 #ifdef LFS 42 extern struct vfsops lfs_vfsops; 43 #define LFS_VFSOPS &lfs_vfsops 44 #else 45 #define LFS_VFSOPS NULL 46 #endif 47 48 #ifdef MFS 49 extern struct vfsops mfs_vfsops; 50 #define MFS_VFSOPS &mfs_vfsops 51 #else 52 #define MFS_VFSOPS NULL 53 #endif 54 55 #ifdef NFS 56 extern struct vfsops nfs_vfsops; 57 #define NFS_VFSOPS &nfs_vfsops 58 #else 59 #define NFS_VFSOPS NULL 60 #endif 61 62 #ifdef FDESC 63 extern struct vfsops fdesc_vfsops; 64 #define FDESC_VFSOPS &fdesc_vfsops 65 #else 66 #define FDESC_VFSOPS NULL 67 #endif 68 69 #ifdef PORTAL 70 extern struct vfsops portal_vfsops; 71 #define PORTAL_VFSOPS &portal_vfsops 72 #else 73 #define PORTAL_VFSOPS NULL 74 #endif 75 76 #ifdef NULLFS 77 extern struct vfsops null_vfsops; 78 #define NULL_VFSOPS &null_vfsops 79 #else 80 #define NULL_VFSOPS NULL 81 #endif 82 83 #ifdef UMAPFS 84 extern struct vfsops umap_vfsops; 85 #define UMAP_VFSOPS &umap_vfsops 86 #else 87 #define UMAP_VFSOPS NULL 88 #endif 89 90 #ifdef KERNFS 91 extern struct vfsops kernfs_vfsops; 92 #define KERNFS_VFSOPS &kernfs_vfsops 93 #else 94 #define KERNFS_VFSOPS NULL 95 #endif 96 97 #ifdef PROCFS 98 extern struct vfsops procfs_vfsops; 99 #define PROCFS_VFSOPS &procfs_vfsops 100 #else 101 #define PROCFS_VFSOPS NULL 102 #endif 103 104 #ifdef AFS 105 extern struct vfsops afs_vfsops; 106 #define AFS_VFSOPS &afs_vfsops 107 #else 108 #define AFS_VFSOPS NULL 109 #endif 110 111 #ifdef CD9660 112 extern struct vfsops cd9660_vfsops; 113 #define CD9660_VFSOPS &cd9660_vfsops 114 #else 115 #define CD9660_VFSOPS NULL 116 #endif 117 118 #ifdef UNION 119 extern struct vfsops union_vfsops; 120 #define UNION_VFSOPS &union_vfsops 121 #else 122 #define UNION_VFSOPS NULL 123 #endif 124 125 struct vfsops *vfssw[] = { 126 NULL, /* 0 = MOUNT_NONE */ 127 UFS_VFSOPS, /* 1 = MOUNT_UFS */ 128 NFS_VFSOPS, /* 2 = MOUNT_NFS */ 129 MFS_VFSOPS, /* 3 = MOUNT_MFS */ 130 NULL, /* 4 = MOUNT_PC */ 131 LFS_VFSOPS, /* 5 = MOUNT_LFS */ 132 NULL, /* 6 = MOUNT_LOFS */ 133 FDESC_VFSOPS, /* 7 = MOUNT_FDESC */ 134 PORTAL_VFSOPS, /* 8 = MOUNT_PORTAL */ 135 NULL_VFSOPS, /* 9 = MOUNT_NULL */ 136 UMAP_VFSOPS, /* 10 = MOUNT_UMAP */ 137 KERNFS_VFSOPS, /* 11 = MOUNT_KERNFS */ 138 PROCFS_VFSOPS, /* 12 = MOUNT_PROCFS */ 139 AFS_VFSOPS, /* 13 = MOUNT_AFS */ 140 CD9660_VFSOPS, /* 14 = MOUNT_CD9660 */ 141 UNION_VFSOPS, /* 15 = MOUNT_UNION */ 142 0 143 }; 144 145 146 /* 147 * 148 * vfs_opv_descs enumerates the list of vnode classes, each with it's own 149 * vnode operation vector. It is consulted at system boot to build operation 150 * vectors. It is NULL terminated. 151 * 152 */ 153 extern struct vnodeopv_desc ffs_vnodeop_opv_desc; 154 extern struct vnodeopv_desc ffs_specop_opv_desc; 155 extern struct vnodeopv_desc ffs_fifoop_opv_desc; 156 extern struct vnodeopv_desc lfs_vnodeop_opv_desc; 157 extern struct vnodeopv_desc lfs_specop_opv_desc; 158 extern struct vnodeopv_desc lfs_fifoop_opv_desc; 159 extern struct vnodeopv_desc mfs_vnodeop_opv_desc; 160 extern struct vnodeopv_desc dead_vnodeop_opv_desc; 161 extern struct vnodeopv_desc fifo_vnodeop_opv_desc; 162 extern struct vnodeopv_desc spec_vnodeop_opv_desc; 163 extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc; 164 extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc; 165 extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc; 166 extern struct vnodeopv_desc fdesc_vnodeop_opv_desc; 167 extern struct vnodeopv_desc portal_vnodeop_opv_desc; 168 extern struct vnodeopv_desc null_vnodeop_opv_desc; 169 extern struct vnodeopv_desc umap_vnodeop_opv_desc; 170 extern struct vnodeopv_desc kernfs_vnodeop_opv_desc; 171 extern struct vnodeopv_desc procfs_vnodeop_opv_desc; 172 extern struct vnodeopv_desc cd9660_vnodeop_opv_desc; 173 extern struct vnodeopv_desc cd9660_specop_opv_desc; 174 extern struct vnodeopv_desc cd9660_fifoop_opv_desc; 175 extern struct vnodeopv_desc union_vnodeop_opv_desc; 176 177 struct vnodeopv_desc *vfs_opv_descs[] = { 178 &ffs_vnodeop_opv_desc, 179 &ffs_specop_opv_desc, 180 #ifdef FIFO 181 &ffs_fifoop_opv_desc, 182 #endif 183 &dead_vnodeop_opv_desc, 184 #ifdef FIFO 185 &fifo_vnodeop_opv_desc, 186 #endif 187 &spec_vnodeop_opv_desc, 188 #ifdef LFS 189 &lfs_vnodeop_opv_desc, 190 &lfs_specop_opv_desc, 191 #ifdef FIFO 192 &lfs_fifoop_opv_desc, 193 #endif 194 #endif 195 #ifdef MFS 196 &mfs_vnodeop_opv_desc, 197 #endif 198 #ifdef NFS 199 &nfsv2_vnodeop_opv_desc, 200 &spec_nfsv2nodeop_opv_desc, 201 #ifdef FIFO 202 &fifo_nfsv2nodeop_opv_desc, 203 #endif 204 #endif 205 #ifdef FDESC 206 &fdesc_vnodeop_opv_desc, 207 #endif 208 #ifdef PORTAL 209 &portal_vnodeop_opv_desc, 210 #endif 211 #ifdef NULLFS 212 &null_vnodeop_opv_desc, 213 #endif 214 #ifdef UMAPFS 215 &umap_vnodeop_opv_desc, 216 #endif 217 #ifdef KERNFS 218 &kernfs_vnodeop_opv_desc, 219 #endif 220 #ifdef PROCFS 221 &procfs_vnodeop_opv_desc, 222 #endif 223 #ifdef CD9660 224 &cd9660_vnodeop_opv_desc, 225 &cd9660_specop_opv_desc, 226 #ifdef FIFO 227 &cd9660_fifoop_opv_desc, 228 #endif 229 #endif 230 #ifdef UNION 231 &union_vnodeop_opv_desc, 232 #endif 233 NULL 234 }; 235