Commit | Line | Data |
---|---|---|
3c4390e8 | 1 | /* |
ec54f0cc KB |
2 | * Copyright (c) 1989, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
3c4390e8 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
3c4390e8 | 6 | * |
ec54f0cc | 7 | * @(#)vfs_conf.c 8.1 (Berkeley) %G% |
3c4390e8 KM |
8 | */ |
9 | ||
12a5f5d3 KB |
10 | #include <sys/param.h> |
11 | #include <sys/mount.h> | |
be0db369 | 12 | #include <sys/vnode.h> |
068edbde KB |
13 | |
14 | #ifdef FFS | |
12a5f5d3 | 15 | #include <ufs/ffs/ffs_extern.h> |
3c4390e8 KM |
16 | |
17 | /* | |
18 | * This specifies the filesystem used to mount the root. | |
19 | * This specification should be done by /etc/config. | |
20 | */ | |
12a5f5d3 | 21 | int (*mountroot)() = ffs_mountroot; |
068edbde | 22 | #endif |
3c4390e8 KM |
23 | |
24 | /* | |
25 | * These define the root filesystem and device. | |
26 | */ | |
27 | struct mount *rootfs; | |
28 | struct vnode *rootdir; | |
29 | ||
30 | /* | |
31 | * Set up the filesystem operations for vnodes. | |
32 | * The types are defined in mount.h. | |
33 | */ | |
068edbde | 34 | #ifdef FFS |
3c4390e8 | 35 | extern struct vfsops ufs_vfsops; |
c4719c6a CT |
36 | #define UFS_VFSOPS &ufs_vfsops |
37 | #else | |
38 | #define UFS_VFSOPS NULL | |
068edbde | 39 | #endif |
3c4390e8 | 40 | |
12a5f5d3 KB |
41 | #ifdef LFS |
42 | extern struct vfsops lfs_vfsops; | |
c4719c6a CT |
43 | #define LFS_VFSOPS &lfs_vfsops |
44 | #else | |
45 | #define LFS_VFSOPS NULL | |
3c4390e8 KM |
46 | #endif |
47 | ||
9caf22f9 KM |
48 | #ifdef MFS |
49 | extern struct vfsops mfs_vfsops; | |
c4719c6a CT |
50 | #define MFS_VFSOPS &mfs_vfsops |
51 | #else | |
52 | #define MFS_VFSOPS NULL | |
9caf22f9 KM |
53 | #endif |
54 | ||
12a5f5d3 KB |
55 | #ifdef NFS |
56 | extern struct vfsops nfs_vfsops; | |
c4719c6a CT |
57 | #define NFS_VFSOPS &nfs_vfsops |
58 | #else | |
59 | #define NFS_VFSOPS NULL | |
12a5f5d3 KB |
60 | #endif |
61 | ||
551e1390 JSP |
62 | #ifdef LOFS |
63 | extern struct vfsops lofs_vfsops; | |
64 | #define LOFS_VFSOPS &lofs_vfsops | |
65 | #else | |
66 | #define LOFS_VFSOPS NULL | |
67 | #endif | |
68 | ||
69 | #ifdef FDESC | |
70 | extern struct vfsops fdesc_vfsops; | |
71 | #define FDESC_VFSOPS &fdesc_vfsops | |
72 | #else | |
73 | #define FDESC_VFSOPS NULL | |
74 | #endif | |
75 | ||
76 | #ifdef PORTAL | |
77 | extern struct vfsops portal_vfsops; | |
78 | #define PORTAL_VFSOPS &portal_vfsops | |
79 | #else | |
80 | #define PORTAL_VFSOPS NULL | |
81 | #endif | |
82 | ||
0b09a51b JH |
83 | #ifdef NULLFS |
84 | extern struct vfsops null_vfsops; | |
85 | #define NULL_VFSOPS &null_vfsops | |
86 | #else | |
87 | #define NULL_VFSOPS NULL | |
88 | #endif | |
89 | ||
90 | #ifdef UMAPFS | |
91 | extern struct vfsops umap_vfsops; | |
92 | #define UMAP_VFSOPS &umap_vfsops | |
93 | #else | |
94 | #define UMAP_VFSOPS NULL | |
95 | #endif | |
96 | ||
4f0a96ab JSP |
97 | #ifdef KERNFS |
98 | extern struct vfsops kernfs_vfsops; | |
99 | #define KERNFS_VFSOPS &kernfs_vfsops | |
100 | #else | |
101 | #define KERNFS_VFSOPS NULL | |
102 | #endif | |
103 | ||
0b09a51b | 104 | |
3c4390e8 | 105 | struct vfsops *vfssw[] = { |
12a5f5d3 | 106 | NULL, /* 0 = MOUNT_NONE */ |
c4719c6a CT |
107 | UFS_VFSOPS, /* 1 = MOUNT_UFS */ |
108 | NFS_VFSOPS, /* 2 = MOUNT_NFS */ | |
109 | MFS_VFSOPS, /* 3 = MOUNT_MFS */ | |
12a5f5d3 | 110 | NULL, /* 4 = MOUNT_PC */ |
c4719c6a | 111 | LFS_VFSOPS, /* 5 = MOUNT_LFS */ |
551e1390 JSP |
112 | LOFS_VFSOPS, /* 6 = MOUNT_LOFS */ |
113 | FDESC_VFSOPS, /* 7 = MOUNT_FDESC */ | |
114 | PORTAL_VFSOPS, /* 8 = MOUNT_PORTAL */ | |
0b09a51b JH |
115 | NULL_VFSOPS, /* 9 = MOUNT_NULL */ |
116 | UMAP_VFSOPS, /* 10 = MOUNT_UMAP */ | |
4f0a96ab | 117 | KERNFS_VFSOPS, /* 11 = MOUNT_KERNFS */ |
0b09a51b | 118 | 0 |
3c4390e8 | 119 | }; |
40314b4d JH |
120 | |
121 | ||
40314b4d JH |
122 | /* |
123 | * | |
35d488e2 KB |
124 | * vfs_opv_descs enumerates the list of vnode classes, each with it's own |
125 | * vnode operation vector. It is consulted at system boot to build operation | |
126 | * vectors. It is NULL terminated. | |
40314b4d | 127 | * |
40314b4d | 128 | */ |
40314b4d JH |
129 | extern struct vnodeopv_desc ffs_vnodeop_opv_desc; |
130 | extern struct vnodeopv_desc ffs_specop_opv_desc; | |
131 | extern struct vnodeopv_desc ffs_fifoop_opv_desc; | |
132 | extern struct vnodeopv_desc lfs_vnodeop_opv_desc; | |
133 | extern struct vnodeopv_desc lfs_specop_opv_desc; | |
134 | extern struct vnodeopv_desc lfs_fifoop_opv_desc; | |
135 | extern struct vnodeopv_desc mfs_vnodeop_opv_desc; | |
136 | extern struct vnodeopv_desc dead_vnodeop_opv_desc; | |
137 | extern struct vnodeopv_desc fifo_vnodeop_opv_desc; | |
138 | extern struct vnodeopv_desc spec_vnodeop_opv_desc; | |
139 | extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc; | |
140 | extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc; | |
141 | extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc; | |
e953eac9 JSP |
142 | extern struct vnodeopv_desc lofs_vnodeop_opv_desc; |
143 | extern struct vnodeopv_desc fdesc_vnodeop_opv_desc; | |
144 | extern struct vnodeopv_desc portal_vnodeop_opv_desc; | |
0b09a51b JH |
145 | extern struct vnodeopv_desc null_vnodeop_opv_desc; |
146 | extern struct vnodeopv_desc umap_vnodeop_opv_desc; | |
4f0a96ab | 147 | extern struct vnodeopv_desc kernfs_vnodeop_opv_desc; |
40314b4d | 148 | |
40314b4d JH |
149 | struct vnodeopv_desc *vfs_opv_descs[] = { |
150 | &ffs_vnodeop_opv_desc, | |
151 | &ffs_specop_opv_desc, | |
c4d5f64d | 152 | #ifdef FIFO |
40314b4d | 153 | &ffs_fifoop_opv_desc, |
c4d5f64d | 154 | #endif |
fb71220b | 155 | &dead_vnodeop_opv_desc, |
c4d5f64d | 156 | #ifdef FIFO |
fb71220b | 157 | &fifo_vnodeop_opv_desc, |
c4d5f64d | 158 | #endif |
fb71220b KM |
159 | &spec_vnodeop_opv_desc, |
160 | #ifdef LFS | |
40314b4d JH |
161 | &lfs_vnodeop_opv_desc, |
162 | &lfs_specop_opv_desc, | |
c4d5f64d | 163 | #ifdef FIFO |
40314b4d | 164 | &lfs_fifoop_opv_desc, |
fb71220b | 165 | #endif |
c4d5f64d | 166 | #endif |
fb71220b | 167 | #ifdef MFS |
40314b4d | 168 | &mfs_vnodeop_opv_desc, |
fb71220b KM |
169 | #endif |
170 | #ifdef NFS | |
40314b4d JH |
171 | &nfsv2_vnodeop_opv_desc, |
172 | &spec_nfsv2nodeop_opv_desc, | |
c4d5f64d | 173 | #ifdef FIFO |
40314b4d | 174 | &fifo_nfsv2nodeop_opv_desc, |
e953eac9 | 175 | #endif |
c4d5f64d | 176 | #endif |
e953eac9 JSP |
177 | #ifdef LOFS |
178 | &lofs_vnodeop_opv_desc, | |
179 | #endif | |
180 | #ifdef FDESC | |
181 | &fdesc_vnodeop_opv_desc, | |
182 | #endif | |
183 | #ifdef PORTAL | |
184 | &portal_vnodeop_opv_desc, | |
0b09a51b JH |
185 | #endif |
186 | #ifdef NULLFS | |
187 | &null_vnodeop_opv_desc, | |
188 | #endif | |
189 | #ifdef UMAPFS | |
190 | &umap_vnodeop_opv_desc, | |
4f0a96ab JSP |
191 | #endif |
192 | #ifdef KERNFS | |
193 | &kernfs_vnodeop_opv_desc, | |
fb71220b | 194 | #endif |
40314b4d JH |
195 | NULL |
196 | }; |