1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #include <sys/param.h>
36 #include <sys/mount.h>
37 #include <sys/vnode.h>
38
39 #ifdef FFS
40 #include <ufs/ufs/quota.h>
41 #include <ufs/ufs/inode.h>
42 #include <ufs/ffs/ffs_extern.h>
43 #endif
44
45 #ifdef EXT2FS
46 #include <ufs/ext2fs/ext2fs_extern.h>
47 #endif
48
49 #ifdef CD9660
50 #include <isofs/cd9660/iso.h>
51 #include <isofs/cd9660/cd9660_extern.h>
52 #endif
53
54 #ifdef MFS
55 #include <ufs/mfs/mfs_extern.h>
56 #endif
57
58 #ifdef NFSCLIENT
59 #include <sys/rwlock.h>
60 #include <nfs/rpcv2.h>
61 #include <nfs/nfsproto.h>
62 #include <nfs/nfsnode.h>
63 #include <nfs/nfs.h>
64 #include <nfs/nfsmount.h>
65 #endif
66
67
68
69
70 struct vnode *rootvnode;
71
72
73
74
75
76
77
78 #ifdef FFS
79 extern const struct vfsops ffs_vfsops;
80 #endif
81
82 #ifdef MFS
83 extern const struct vfsops mfs_vfsops;
84 #endif
85
86 #ifdef MSDOSFS
87 extern const struct vfsops msdosfs_vfsops;
88 #endif
89
90 #ifdef NFSCLIENT
91 extern const struct vfsops nfs_vfsops;
92 #endif
93
94 #ifdef PORTAL
95 extern const struct vfsops portal_vfsops;
96 #endif
97
98 #ifdef PROCFS
99 extern const struct vfsops procfs_vfsops;
100 #endif
101
102 #ifdef CD9660
103 extern const struct vfsops cd9660_vfsops;
104 #endif
105
106 #ifdef EXT2FS
107 extern const struct vfsops ext2fs_vfsops;
108 #endif
109
110 #ifdef XFS
111 extern const struct vfsops xfs_vfsops;
112 #endif
113
114 #ifdef NTFS
115 extern const struct vfsops ntfs_vfsops;
116 #endif
117
118 #ifdef UDF
119 extern const struct vfsops udf_vfsops;
120 #endif
121
122
123
124
125 static struct vfsconf vfsconflist[] = {
126
127
128 #ifdef FFS
129 { &ffs_vfsops, MOUNT_FFS, 1, 0, MNT_LOCAL, ffs_mountroot, NULL },
130 #endif
131
132
133 #ifdef MFS
134 { &mfs_vfsops, MOUNT_MFS, 3, 0, MNT_LOCAL, mfs_mountroot, NULL },
135 #endif
136
137 #ifdef EXT2FS
138 { &ext2fs_vfsops, MOUNT_EXT2FS, 17, 0, MNT_LOCAL, ext2fs_mountroot, NULL },
139 #endif
140
141 #ifdef CD9660
142 { &cd9660_vfsops, MOUNT_CD9660, 14, 0, MNT_LOCAL, cd9660_mountroot, NULL },
143 #endif
144
145
146 #ifdef MSDOSFS
147 { &msdosfs_vfsops, MOUNT_MSDOS, 4, 0, MNT_LOCAL, NULL, NULL },
148 #endif
149
150
151 #ifdef NFSCLIENT
152 { &nfs_vfsops, MOUNT_NFS, 2, 0, 0, nfs_mountroot, NULL },
153 #endif
154
155
156 #ifdef XFS
157 { &xfs_vfsops, MOUNT_XFS, 21, 0, 0, NULL, NULL },
158 #endif
159
160
161 #ifdef PROCFS
162 { &procfs_vfsops, MOUNT_PROCFS, 12, 0, 0, NULL, NULL },
163 #endif
164
165
166 #ifdef PORTAL
167 { &portal_vfsops, MOUNT_PORTAL, 8, 0, 0, NULL, NULL },
168 #endif
169
170
171 #ifdef NTFS
172 { &ntfs_vfsops, MOUNT_NTFS, 6, 0, MNT_LOCAL, NULL, NULL },
173 #endif
174
175
176 #ifdef UDF
177 { &udf_vfsops, MOUNT_UDF, 13, 0, MNT_LOCAL, NULL, NULL },
178 #endif
179
180 };
181
182
183
184
185
186
187 int maxvfsconf = sizeof(vfsconflist) / sizeof(struct vfsconf);
188 struct vfsconf *vfsconf = vfsconflist;
189
190
191
192
193
194
195
196 extern struct vnodeopv_desc sync_vnodeop_opv_desc;
197 extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
198 extern struct vnodeopv_desc ffs_specop_opv_desc;
199 extern struct vnodeopv_desc ffs_fifoop_opv_desc;
200 extern struct vnodeopv_desc mfs_vnodeop_opv_desc;
201 extern struct vnodeopv_desc dead_vnodeop_opv_desc;
202 extern struct vnodeopv_desc fifo_vnodeop_opv_desc;
203 extern struct vnodeopv_desc spec_vnodeop_opv_desc;
204 extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
205 extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc;
206 extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
207 extern struct vnodeopv_desc portal_vnodeop_opv_desc;
208 extern struct vnodeopv_desc procfs_vnodeop_opv_desc;
209 extern struct vnodeopv_desc cd9660_vnodeop_opv_desc;
210 extern struct vnodeopv_desc cd9660_specop_opv_desc;
211 extern struct vnodeopv_desc cd9660_fifoop_opv_desc;
212 extern struct vnodeopv_desc msdosfs_vnodeop_opv_desc;
213 extern struct vnodeopv_desc ext2fs_vnodeop_opv_desc;
214 extern struct vnodeopv_desc ext2fs_specop_opv_desc;
215 extern struct vnodeopv_desc ext2fs_fifoop_opv_desc;
216 extern struct vnodeopv_desc xfs_vnodeop_opv_desc;
217 extern struct vnodeopv_desc ntfs_vnodeop_opv_desc;
218 extern struct vnodeopv_desc udf_vnodeop_opv_desc;
219
220 struct vnodeopv_desc *vfs_opv_descs[] = {
221 &sync_vnodeop_opv_desc,
222 #ifdef FFS
223 &ffs_vnodeop_opv_desc,
224 &ffs_specop_opv_desc,
225 #ifdef FIFO
226 &ffs_fifoop_opv_desc,
227 #endif
228 #endif
229 &dead_vnodeop_opv_desc,
230 #ifdef FIFO
231 &fifo_vnodeop_opv_desc,
232 #endif
233 &spec_vnodeop_opv_desc,
234 #ifdef MFS
235 &mfs_vnodeop_opv_desc,
236 #endif
237 #ifdef NFSCLIENT
238 &nfsv2_vnodeop_opv_desc,
239 &spec_nfsv2nodeop_opv_desc,
240 #ifdef FIFO
241 &fifo_nfsv2nodeop_opv_desc,
242 #endif
243 #endif
244 #ifdef PORTAL
245 &portal_vnodeop_opv_desc,
246 #endif
247 #ifdef PROCFS
248 &procfs_vnodeop_opv_desc,
249 #endif
250 #ifdef CD9660
251 &cd9660_vnodeop_opv_desc,
252 &cd9660_specop_opv_desc,
253 #ifdef FIFO
254 &cd9660_fifoop_opv_desc,
255 #endif
256 #endif
257 #ifdef MSDOSFS
258 &msdosfs_vnodeop_opv_desc,
259 #endif
260 #ifdef EXT2FS
261 &ext2fs_vnodeop_opv_desc,
262 &ext2fs_specop_opv_desc,
263 #ifdef FIFO
264 &ext2fs_fifoop_opv_desc,
265 #endif
266 #endif
267 #ifdef XFS
268 &xfs_vnodeop_opv_desc,
269 #endif
270 #ifdef NTFS
271 &ntfs_vnodeop_opv_desc,
272 #endif
273 #ifdef UDF
274 &udf_vnodeop_opv_desc,
275 #endif
276
277 NULL
278 };