advfsops.c revision 1.6 1 1.6 darrenr /* $NetBSD: advfsops.c,v 1.6 2003/06/29 09:56:32 darrenr Exp $ */
2 1.1 jdolecek
3 1.1 jdolecek /*
4 1.1 jdolecek * Copyright (c) 1994 Christian E. Hopps
5 1.1 jdolecek * Copyright (c) 1996 Matthias Scheler
6 1.1 jdolecek * All rights reserved.
7 1.1 jdolecek *
8 1.1 jdolecek * Redistribution and use in source and binary forms, with or without
9 1.1 jdolecek * modification, are permitted provided that the following conditions
10 1.1 jdolecek * are met:
11 1.1 jdolecek * 1. Redistributions of source code must retain the above copyright
12 1.1 jdolecek * notice, this list of conditions and the following disclaimer.
13 1.1 jdolecek * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 jdolecek * notice, this list of conditions and the following disclaimer in the
15 1.1 jdolecek * documentation and/or other materials provided with the distribution.
16 1.1 jdolecek * 3. All advertising materials mentioning features or use of this software
17 1.1 jdolecek * must display the following acknowledgement:
18 1.1 jdolecek * This product includes software developed by Christian E. Hopps.
19 1.1 jdolecek * 4. The name of the author may not be used to endorse or promote products
20 1.1 jdolecek * derived from this software without specific prior written permission
21 1.1 jdolecek *
22 1.1 jdolecek * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.1 jdolecek * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.1 jdolecek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1 jdolecek * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.1 jdolecek * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.1 jdolecek * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.1 jdolecek * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.1 jdolecek * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.1 jdolecek * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.1 jdolecek * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.1 jdolecek */
33 1.1 jdolecek
34 1.1 jdolecek #include <sys/cdefs.h>
35 1.6 darrenr __KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.6 2003/06/29 09:56:32 darrenr Exp $");
36 1.1 jdolecek
37 1.1 jdolecek #if defined(_KERNEL_OPT)
38 1.1 jdolecek #include "opt_compat_netbsd.h"
39 1.1 jdolecek #endif
40 1.1 jdolecek
41 1.1 jdolecek #include <sys/param.h>
42 1.1 jdolecek #include <sys/systm.h>
43 1.1 jdolecek #include <sys/vnode.h>
44 1.1 jdolecek #include <sys/mount.h>
45 1.1 jdolecek #include <sys/proc.h>
46 1.1 jdolecek #include <sys/time.h>
47 1.1 jdolecek #include <sys/malloc.h>
48 1.1 jdolecek #include <sys/pool.h>
49 1.1 jdolecek #include <sys/disklabel.h>
50 1.1 jdolecek #include <miscfs/specfs/specdev.h> /* XXX */
51 1.1 jdolecek #include <sys/fcntl.h>
52 1.1 jdolecek #include <sys/namei.h>
53 1.1 jdolecek #include <sys/ioctl.h>
54 1.1 jdolecek #include <sys/queue.h>
55 1.1 jdolecek #include <sys/buf.h>
56 1.1 jdolecek #include <sys/conf.h>
57 1.1 jdolecek #include <fs/adosfs/adosfs.h>
58 1.1 jdolecek
59 1.1 jdolecek void adosfs_init __P((void));
60 1.1 jdolecek void adosfs_reinit __P((void));
61 1.1 jdolecek void adosfs_done __P((void));
62 1.1 jdolecek int adosfs_mount __P((struct mount *, const char *, void *, struct nameidata *,
63 1.5 darrenr struct lwp *));
64 1.1 jdolecek int adosfs_start __P((struct mount *, int, struct proc *));
65 1.1 jdolecek int adosfs_unmount __P((struct mount *, int, struct proc *));
66 1.1 jdolecek int adosfs_root __P((struct mount *, struct vnode **));
67 1.5 darrenr int adosfs_quotactl __P((struct mount *, int, uid_t, caddr_t, struct lwp *));
68 1.1 jdolecek int adosfs_statfs __P((struct mount *, struct statfs *, struct proc *));
69 1.1 jdolecek int adosfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
70 1.1 jdolecek int adosfs_vget __P((struct mount *, ino_t, struct vnode **));
71 1.1 jdolecek int adosfs_fhtovp __P((struct mount *, struct fid *, struct vnode **));
72 1.1 jdolecek int adosfs_checkexp __P((struct mount *, struct mbuf *, int *,
73 1.1 jdolecek struct ucred **));
74 1.1 jdolecek int adosfs_vptofh __P((struct vnode *, struct fid *));
75 1.1 jdolecek
76 1.1 jdolecek int adosfs_mountfs __P((struct vnode *, struct mount *, struct proc *));
77 1.1 jdolecek int adosfs_loadbitmap __P((struct adosfsmount *));
78 1.1 jdolecek int adosfs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
79 1.1 jdolecek struct proc *));
80 1.1 jdolecek
81 1.1 jdolecek struct simplelock adosfs_hashlock;
82 1.1 jdolecek
83 1.1 jdolecek struct pool adosfs_node_pool;
84 1.2 thorpej
85 1.2 thorpej MALLOC_DEFINE(M_ADOSFSMNT, "adosfs mount", "adosfs mount structures");
86 1.2 thorpej MALLOC_DEFINE(M_ANODE, "adosfs anode", "adosfs anode structures and tables");
87 1.2 thorpej MALLOC_DEFINE(M_ADOSFSBITMAP, "adosfs bitmap", "adosfs bitmap");
88 1.1 jdolecek
89 1.1 jdolecek struct genfs_ops adosfs_genfsops = {
90 1.1 jdolecek genfs_size,
91 1.1 jdolecek };
92 1.1 jdolecek
93 1.1 jdolecek int (**adosfs_vnodeop_p) __P((void *));
94 1.1 jdolecek
95 1.1 jdolecek int
96 1.5 darrenr adosfs_mount(mp, path, data, ndp, l)
97 1.1 jdolecek struct mount *mp;
98 1.1 jdolecek const char *path;
99 1.1 jdolecek void *data;
100 1.1 jdolecek struct nameidata *ndp;
101 1.5 darrenr struct lwp *l;
102 1.1 jdolecek {
103 1.1 jdolecek struct vnode *devvp;
104 1.1 jdolecek struct adosfs_args args;
105 1.1 jdolecek struct adosfsmount *amp;
106 1.5 darrenr struct proc *p;
107 1.5 darrenr size_t size;
108 1.1 jdolecek int error;
109 1.1 jdolecek mode_t accessmode;
110 1.1 jdolecek
111 1.5 darrenr p = l->l_proc;
112 1.1 jdolecek if (mp->mnt_flag & MNT_GETARGS) {
113 1.1 jdolecek amp = VFSTOADOSFS(mp);
114 1.1 jdolecek if (amp == NULL)
115 1.1 jdolecek return EIO;
116 1.1 jdolecek args.uid = amp->uid;
117 1.1 jdolecek args.gid = amp->gid;
118 1.1 jdolecek args.mask = amp->mask;
119 1.1 jdolecek args.fspec = NULL;
120 1.1 jdolecek vfs_showexport(mp, &args.export, &->export);
121 1.1 jdolecek return copyout(&args, data, sizeof(args));
122 1.1 jdolecek }
123 1.3 dsl error = copyin(data, &args, sizeof(struct adosfs_args));
124 1.1 jdolecek if (error)
125 1.1 jdolecek return(error);
126 1.1 jdolecek
127 1.1 jdolecek if ((mp->mnt_flag & MNT_RDONLY) == 0)
128 1.1 jdolecek return (EROFS);
129 1.1 jdolecek /*
130 1.1 jdolecek * If updating, check whether changing from read-only to
131 1.1 jdolecek * read/write; if there is no device name, that's all we do.
132 1.1 jdolecek */
133 1.1 jdolecek if (mp->mnt_flag & MNT_UPDATE) {
134 1.1 jdolecek amp = VFSTOADOSFS(mp);
135 1.1 jdolecek if (args.fspec == 0)
136 1.1 jdolecek return (vfs_export(mp, &->export, &args.export));
137 1.1 jdolecek }
138 1.1 jdolecek /*
139 1.1 jdolecek * Not an update, or updating the name: look up the name
140 1.1 jdolecek * and verify that it refers to a sensible block device.
141 1.1 jdolecek */
142 1.5 darrenr NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, l);
143 1.1 jdolecek if ((error = namei(ndp)) != 0)
144 1.1 jdolecek return (error);
145 1.1 jdolecek devvp = ndp->ni_vp;
146 1.1 jdolecek
147 1.1 jdolecek if (devvp->v_type != VBLK) {
148 1.1 jdolecek vrele(devvp);
149 1.1 jdolecek return (ENOTBLK);
150 1.1 jdolecek }
151 1.1 jdolecek if (bdevsw_lookup(devvp->v_rdev) == NULL) {
152 1.1 jdolecek vrele(devvp);
153 1.1 jdolecek return (ENXIO);
154 1.1 jdolecek }
155 1.1 jdolecek /*
156 1.1 jdolecek * If mount by non-root, then verify that user has necessary
157 1.1 jdolecek * permissions on the device.
158 1.1 jdolecek */
159 1.1 jdolecek if (p->p_ucred->cr_uid != 0) {
160 1.1 jdolecek accessmode = VREAD;
161 1.1 jdolecek if ((mp->mnt_flag & MNT_RDONLY) == 0)
162 1.1 jdolecek accessmode |= VWRITE;
163 1.1 jdolecek vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
164 1.1 jdolecek error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p);
165 1.1 jdolecek if (error) {
166 1.1 jdolecek vput(devvp);
167 1.1 jdolecek return (error);
168 1.1 jdolecek }
169 1.1 jdolecek VOP_UNLOCK(devvp, 0);
170 1.1 jdolecek }
171 1.1 jdolecek /* MNT_UPDATE? */
172 1.1 jdolecek if ((error = adosfs_mountfs(devvp, mp, p)) != 0) {
173 1.1 jdolecek vrele(devvp);
174 1.1 jdolecek return (error);
175 1.1 jdolecek }
176 1.1 jdolecek amp = VFSTOADOSFS(mp);
177 1.1 jdolecek amp->uid = args.uid;
178 1.1 jdolecek amp->gid = args.gid;
179 1.1 jdolecek amp->mask = args.mask;
180 1.4 christos return set_statfs_info(path, UIO_USERSPACE, args.fspec, UIO_USERSPACE,
181 1.4 christos mp, p);
182 1.1 jdolecek }
183 1.1 jdolecek
184 1.1 jdolecek int
185 1.6 darrenr adosfs_mountfs(devvp, mp, l)
186 1.1 jdolecek struct vnode *devvp;
187 1.1 jdolecek struct mount *mp;
188 1.6 darrenr struct lwp *l;
189 1.1 jdolecek {
190 1.6 darrenr struct proc *p = l->l_proc;
191 1.1 jdolecek struct disklabel dl;
192 1.1 jdolecek struct partition *parp;
193 1.1 jdolecek struct adosfsmount *amp;
194 1.1 jdolecek struct buf *bp;
195 1.1 jdolecek struct vnode *rvp;
196 1.1 jdolecek int error, part, i;
197 1.1 jdolecek
198 1.1 jdolecek part = DISKPART(devvp->v_rdev);
199 1.1 jdolecek amp = NULL;
200 1.1 jdolecek
201 1.1 jdolecek /*
202 1.1 jdolecek * Disallow multiple mounts of the same device.
203 1.1 jdolecek * Disallow mounting of a device that is currently in use
204 1.1 jdolecek * (except for root, which might share swap device for miniroot).
205 1.1 jdolecek * Flush out any old buffers remaining from a previous use.
206 1.1 jdolecek */
207 1.1 jdolecek if ((error = vfs_mountedon(devvp)) != 0)
208 1.1 jdolecek return (error);
209 1.1 jdolecek if (vcount(devvp) > 1 && devvp != rootvp)
210 1.1 jdolecek return (EBUSY);
211 1.6 darrenr if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, l, 0, 0)) != 0)
212 1.1 jdolecek return (error);
213 1.1 jdolecek
214 1.1 jdolecek /*
215 1.1 jdolecek * open blkdev and read root block
216 1.1 jdolecek */
217 1.1 jdolecek if ((error = VOP_OPEN(devvp, FREAD, NOCRED, p)) != 0)
218 1.1 jdolecek return (error);
219 1.6 darrenr error = VOP_IOCTL(devvp, DIOCGDINFO, &dl, FREAD, NOCRED, l);
220 1.1 jdolecek if (error)
221 1.1 jdolecek goto fail;
222 1.1 jdolecek
223 1.1 jdolecek parp = &dl.d_partitions[part];
224 1.1 jdolecek amp = malloc(sizeof(struct adosfsmount), M_ADOSFSMNT, M_WAITOK);
225 1.1 jdolecek memset((char *)amp, 0, (u_long)sizeof(struct adosfsmount));
226 1.1 jdolecek amp->mp = mp;
227 1.1 jdolecek if (dl.d_type == DTYPE_FLOPPY) {
228 1.1 jdolecek amp->bsize = dl.d_secsize;
229 1.1 jdolecek amp->secsperblk = 1;
230 1.1 jdolecek }
231 1.1 jdolecek else {
232 1.1 jdolecek amp->bsize = parp->p_fsize * parp->p_frag;
233 1.1 jdolecek amp->secsperblk = parp->p_frag;
234 1.1 jdolecek }
235 1.1 jdolecek
236 1.1 jdolecek /* invalid fs ? */
237 1.1 jdolecek if (amp->secsperblk == 0) {
238 1.1 jdolecek error = EINVAL;
239 1.1 jdolecek goto fail;
240 1.1 jdolecek }
241 1.1 jdolecek
242 1.1 jdolecek bp = NULL;
243 1.1 jdolecek if ((error = bread(devvp, (daddr_t)BBOFF,
244 1.1 jdolecek amp->bsize, NOCRED, &bp)) != 0) {
245 1.1 jdolecek brelse(bp);
246 1.1 jdolecek goto fail;
247 1.1 jdolecek }
248 1.1 jdolecek amp->dostype = adoswordn(bp, 0);
249 1.1 jdolecek brelse(bp);
250 1.1 jdolecek
251 1.1 jdolecek /* basic sanity checks */
252 1.1 jdolecek if (amp->dostype < 0x444f5300 || amp->dostype > 0x444f5305) {
253 1.1 jdolecek error = EINVAL;
254 1.1 jdolecek goto fail;
255 1.1 jdolecek }
256 1.1 jdolecek
257 1.1 jdolecek amp->rootb = (parp->p_size / amp->secsperblk - 1 + parp->p_cpg) >> 1;
258 1.1 jdolecek amp->numblks = parp->p_size / amp->secsperblk - parp->p_cpg;
259 1.1 jdolecek
260 1.1 jdolecek amp->nwords = amp->bsize >> 2;
261 1.1 jdolecek amp->dbsize = amp->bsize - (IS_FFS(amp) ? 0 : OFS_DATA_OFFSET);
262 1.1 jdolecek amp->devvp = devvp;
263 1.1 jdolecek
264 1.1 jdolecek mp->mnt_data = amp;
265 1.1 jdolecek mp->mnt_stat.f_fsid.val[0] = (long)devvp->v_rdev;
266 1.1 jdolecek mp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_ADOSFS);
267 1.1 jdolecek mp->mnt_fs_bshift = ffs(amp->bsize) - 1;
268 1.1 jdolecek mp->mnt_dev_bshift = DEV_BSHIFT; /* XXX */
269 1.1 jdolecek mp->mnt_flag |= MNT_LOCAL;
270 1.1 jdolecek
271 1.1 jdolecek /*
272 1.1 jdolecek * init anode table.
273 1.1 jdolecek */
274 1.1 jdolecek for (i = 0; i < ANODEHASHSZ; i++)
275 1.1 jdolecek LIST_INIT(&->anodetab[i]);
276 1.1 jdolecek
277 1.1 jdolecek /*
278 1.1 jdolecek * get the root anode, if not a valid fs this will fail.
279 1.1 jdolecek */
280 1.6 darrenr if ((error = VFS_ROOT(mp, &rvp, l)) != 0)
281 1.1 jdolecek goto fail;
282 1.1 jdolecek /* allocate and load bitmap, set free space */
283 1.1 jdolecek amp->bitmap = malloc(((amp->numblks + 31) / 32) * sizeof(*amp->bitmap),
284 1.1 jdolecek M_ADOSFSBITMAP, M_WAITOK);
285 1.1 jdolecek if (amp->bitmap)
286 1.1 jdolecek adosfs_loadbitmap(amp);
287 1.1 jdolecek if (mp->mnt_flag & MNT_RDONLY && amp->bitmap) {
288 1.1 jdolecek /*
289 1.1 jdolecek * Don't need the bitmap any more if it's read-only.
290 1.1 jdolecek */
291 1.1 jdolecek free(amp->bitmap, M_ADOSFSBITMAP);
292 1.1 jdolecek amp->bitmap = NULL;
293 1.1 jdolecek }
294 1.1 jdolecek vput(rvp);
295 1.1 jdolecek
296 1.1 jdolecek return(0);
297 1.1 jdolecek
298 1.1 jdolecek fail:
299 1.1 jdolecek vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
300 1.1 jdolecek (void) VOP_CLOSE(devvp, FREAD, NOCRED, p);
301 1.1 jdolecek VOP_UNLOCK(devvp, 0);
302 1.1 jdolecek if (amp && amp->bitmap)
303 1.1 jdolecek free(amp->bitmap, M_ADOSFSBITMAP);
304 1.1 jdolecek if (amp)
305 1.1 jdolecek free(amp, M_ADOSFSMNT);
306 1.1 jdolecek return (error);
307 1.1 jdolecek }
308 1.1 jdolecek
309 1.1 jdolecek int
310 1.6 darrenr adosfs_start(mp, flags, l)
311 1.1 jdolecek struct mount *mp;
312 1.1 jdolecek int flags;
313 1.6 darrenr struct lwp *l;
314 1.1 jdolecek {
315 1.1 jdolecek
316 1.1 jdolecek return (0);
317 1.1 jdolecek }
318 1.1 jdolecek
319 1.1 jdolecek int
320 1.6 darrenr adosfs_unmount(mp, mntflags, l)
321 1.1 jdolecek struct mount *mp;
322 1.1 jdolecek int mntflags;
323 1.6 darrenr struct lwp *l;
324 1.1 jdolecek {
325 1.1 jdolecek struct adosfsmount *amp;
326 1.1 jdolecek int error, flags;
327 1.1 jdolecek
328 1.1 jdolecek flags = 0;
329 1.1 jdolecek if (mntflags & MNT_FORCE)
330 1.1 jdolecek flags |= FORCECLOSE;
331 1.1 jdolecek if ((error = vflush(mp, NULLVP, flags)) != 0)
332 1.1 jdolecek return (error);
333 1.1 jdolecek amp = VFSTOADOSFS(mp);
334 1.1 jdolecek if (amp->devvp->v_type != VBAD)
335 1.1 jdolecek amp->devvp->v_specmountpoint = NULL;
336 1.1 jdolecek vn_lock(amp->devvp, LK_EXCLUSIVE | LK_RETRY);
337 1.6 darrenr error = VOP_CLOSE(amp->devvp, FREAD, NOCRED, l);
338 1.1 jdolecek vput(amp->devvp);
339 1.1 jdolecek if (amp->bitmap)
340 1.1 jdolecek free(amp->bitmap, M_ADOSFSBITMAP);
341 1.1 jdolecek free(amp, M_ADOSFSMNT);
342 1.1 jdolecek mp->mnt_data = NULL;
343 1.1 jdolecek mp->mnt_flag &= ~MNT_LOCAL;
344 1.1 jdolecek return (error);
345 1.1 jdolecek }
346 1.1 jdolecek
347 1.1 jdolecek int
348 1.1 jdolecek adosfs_root(mp, vpp)
349 1.1 jdolecek struct mount *mp;
350 1.1 jdolecek struct vnode **vpp;
351 1.1 jdolecek {
352 1.1 jdolecek struct vnode *nvp;
353 1.1 jdolecek int error;
354 1.1 jdolecek
355 1.1 jdolecek if ((error = VFS_VGET(mp, (ino_t)VFSTOADOSFS(mp)->rootb, &nvp)) != 0)
356 1.1 jdolecek return (error);
357 1.1 jdolecek /* XXX verify it's a root block? */
358 1.1 jdolecek *vpp = nvp;
359 1.1 jdolecek return (0);
360 1.1 jdolecek }
361 1.1 jdolecek
362 1.1 jdolecek int
363 1.6 darrenr adosfs_statfs(mp, sbp, l)
364 1.1 jdolecek struct mount *mp;
365 1.1 jdolecek struct statfs *sbp;
366 1.6 darrenr struct lwp *l;
367 1.1 jdolecek {
368 1.1 jdolecek struct adosfsmount *amp;
369 1.1 jdolecek
370 1.1 jdolecek amp = VFSTOADOSFS(mp);
371 1.1 jdolecek #ifdef COMPAT_09
372 1.1 jdolecek sbp->f_type = 16;
373 1.1 jdolecek #else
374 1.1 jdolecek sbp->f_type = 0;
375 1.1 jdolecek #endif
376 1.1 jdolecek sbp->f_bsize = amp->bsize;
377 1.1 jdolecek sbp->f_iosize = amp->dbsize;
378 1.1 jdolecek sbp->f_blocks = amp->numblks;
379 1.1 jdolecek sbp->f_bfree = amp->freeblks;
380 1.1 jdolecek sbp->f_bavail = amp->freeblks;
381 1.1 jdolecek sbp->f_files = 0; /* who knows */
382 1.1 jdolecek sbp->f_ffree = 0; /* " " */
383 1.4 christos copy_statfs_info(sbp, mp);
384 1.1 jdolecek return (0);
385 1.1 jdolecek }
386 1.1 jdolecek
387 1.1 jdolecek /*
388 1.1 jdolecek * lookup an anode, check mount's hash table if not found, create
389 1.1 jdolecek * return locked and referenced al la vget(vp, 1);
390 1.1 jdolecek */
391 1.1 jdolecek int
392 1.1 jdolecek adosfs_vget(mp, an, vpp)
393 1.1 jdolecek struct mount *mp;
394 1.1 jdolecek ino_t an;
395 1.1 jdolecek struct vnode **vpp;
396 1.1 jdolecek {
397 1.1 jdolecek struct adosfsmount *amp;
398 1.1 jdolecek struct vnode *vp;
399 1.1 jdolecek struct anode *ap;
400 1.1 jdolecek struct buf *bp;
401 1.1 jdolecek char *nam, *tmp;
402 1.1 jdolecek int namlen, error;
403 1.1 jdolecek
404 1.1 jdolecek error = 0;
405 1.1 jdolecek amp = VFSTOADOSFS(mp);
406 1.1 jdolecek bp = NULL;
407 1.1 jdolecek
408 1.1 jdolecek /*
409 1.1 jdolecek * check hash table. we are done if found
410 1.1 jdolecek */
411 1.1 jdolecek if ((*vpp = adosfs_ahashget(mp, an)) != NULL)
412 1.1 jdolecek return (0);
413 1.1 jdolecek
414 1.1 jdolecek error = getnewvnode(VT_ADOSFS, mp, adosfs_vnodeop_p, &vp);
415 1.1 jdolecek if (error)
416 1.1 jdolecek return (error);
417 1.1 jdolecek
418 1.1 jdolecek /*
419 1.1 jdolecek * setup, insert in hash, and lock before io.
420 1.1 jdolecek */
421 1.1 jdolecek vp->v_data = ap = pool_get(&adosfs_node_pool, PR_WAITOK);
422 1.1 jdolecek memset(ap, 0, sizeof(struct anode));
423 1.1 jdolecek ap->vp = vp;
424 1.1 jdolecek ap->amp = amp;
425 1.1 jdolecek ap->block = an;
426 1.1 jdolecek ap->nwords = amp->nwords;
427 1.1 jdolecek adosfs_ainshash(amp, ap);
428 1.1 jdolecek
429 1.1 jdolecek if ((error = bread(amp->devvp, an * amp->bsize / DEV_BSIZE,
430 1.1 jdolecek amp->bsize, NOCRED, &bp)) != 0) {
431 1.1 jdolecek brelse(bp);
432 1.1 jdolecek vput(vp);
433 1.1 jdolecek return (error);
434 1.1 jdolecek }
435 1.1 jdolecek
436 1.1 jdolecek /*
437 1.1 jdolecek * get type and fill rest in based on that.
438 1.1 jdolecek */
439 1.1 jdolecek switch (ap->type = adosfs_getblktype(amp, bp)) {
440 1.1 jdolecek case AROOT:
441 1.1 jdolecek vp->v_type = VDIR;
442 1.1 jdolecek vp->v_flag |= VROOT;
443 1.1 jdolecek ap->mtimev.days = adoswordn(bp, ap->nwords - 10);
444 1.1 jdolecek ap->mtimev.mins = adoswordn(bp, ap->nwords - 9);
445 1.1 jdolecek ap->mtimev.ticks = adoswordn(bp, ap->nwords - 8);
446 1.1 jdolecek ap->created.days = adoswordn(bp, ap->nwords - 7);
447 1.1 jdolecek ap->created.mins = adoswordn(bp, ap->nwords - 6);
448 1.1 jdolecek ap->created.ticks = adoswordn(bp, ap->nwords - 5);
449 1.1 jdolecek break;
450 1.1 jdolecek case ALDIR:
451 1.1 jdolecek case ADIR:
452 1.1 jdolecek vp->v_type = VDIR;
453 1.1 jdolecek break;
454 1.1 jdolecek case ALFILE:
455 1.1 jdolecek case AFILE:
456 1.1 jdolecek vp->v_type = VREG;
457 1.1 jdolecek ap->fsize = adoswordn(bp, ap->nwords - 47);
458 1.1 jdolecek break;
459 1.1 jdolecek case ASLINK: /* XXX soft link */
460 1.1 jdolecek vp->v_type = VLNK;
461 1.1 jdolecek /*
462 1.1 jdolecek * convert from BCPL string and
463 1.1 jdolecek * from: "part:dir/file" to: "/part/dir/file"
464 1.1 jdolecek */
465 1.1 jdolecek nam = bp->b_data + (6 * sizeof(long));
466 1.1 jdolecek namlen = strlen(nam);
467 1.1 jdolecek tmp = nam;
468 1.1 jdolecek while (*tmp && *tmp != ':')
469 1.1 jdolecek tmp++;
470 1.1 jdolecek if (*tmp == 0) {
471 1.1 jdolecek ap->slinkto = malloc(namlen + 1, M_ANODE, M_WAITOK);
472 1.1 jdolecek memcpy(ap->slinkto, nam, namlen);
473 1.1 jdolecek } else if (*nam == ':') {
474 1.1 jdolecek ap->slinkto = malloc(namlen + 1, M_ANODE, M_WAITOK);
475 1.1 jdolecek memcpy(ap->slinkto, nam, namlen);
476 1.1 jdolecek ap->slinkto[0] = '/';
477 1.1 jdolecek } else {
478 1.1 jdolecek ap->slinkto = malloc(namlen + 2, M_ANODE, M_WAITOK);
479 1.1 jdolecek ap->slinkto[0] = '/';
480 1.1 jdolecek memcpy(&ap->slinkto[1], nam, namlen);
481 1.1 jdolecek ap->slinkto[tmp - nam + 1] = '/';
482 1.1 jdolecek namlen++;
483 1.1 jdolecek }
484 1.1 jdolecek ap->slinkto[namlen] = 0;
485 1.1 jdolecek ap->fsize = namlen;
486 1.1 jdolecek break;
487 1.1 jdolecek default:
488 1.1 jdolecek brelse(bp);
489 1.1 jdolecek vput(vp);
490 1.1 jdolecek return (EINVAL);
491 1.1 jdolecek }
492 1.1 jdolecek
493 1.1 jdolecek /*
494 1.1 jdolecek * Get appropriate data from this block; hard link needs
495 1.1 jdolecek * to get other data from the "real" block.
496 1.1 jdolecek */
497 1.1 jdolecek
498 1.1 jdolecek /*
499 1.1 jdolecek * copy in name (from original block)
500 1.1 jdolecek */
501 1.1 jdolecek nam = bp->b_data + (ap->nwords - 20) * sizeof(u_int32_t);
502 1.1 jdolecek namlen = *(u_char *)nam++;
503 1.1 jdolecek if (namlen > 30) {
504 1.1 jdolecek #ifdef DIAGNOSTIC
505 1.1 jdolecek printf("adosfs: aget: name length too long blk %d\n", an);
506 1.1 jdolecek #endif
507 1.1 jdolecek brelse(bp);
508 1.1 jdolecek vput(vp);
509 1.1 jdolecek return (EINVAL);
510 1.1 jdolecek }
511 1.1 jdolecek memcpy(ap->name, nam, namlen);
512 1.1 jdolecek ap->name[namlen] = 0;
513 1.1 jdolecek
514 1.1 jdolecek /*
515 1.1 jdolecek * if dir alloc hash table and copy it in
516 1.1 jdolecek */
517 1.1 jdolecek if (vp->v_type == VDIR) {
518 1.1 jdolecek int i;
519 1.1 jdolecek
520 1.1 jdolecek ap->tab = malloc(ANODETABSZ(ap) * 2, M_ANODE, M_WAITOK);
521 1.1 jdolecek ap->ntabent = ANODETABENT(ap);
522 1.1 jdolecek ap->tabi = (int *)&ap->tab[ap->ntabent];
523 1.1 jdolecek memset(ap->tabi, 0, ANODETABSZ(ap));
524 1.1 jdolecek for (i = 0; i < ap->ntabent; i++)
525 1.1 jdolecek ap->tab[i] = adoswordn(bp, i + 6);
526 1.1 jdolecek }
527 1.1 jdolecek
528 1.1 jdolecek /*
529 1.1 jdolecek * misc.
530 1.1 jdolecek */
531 1.1 jdolecek ap->pblock = adoswordn(bp, ap->nwords - 3);
532 1.1 jdolecek ap->hashf = adoswordn(bp, ap->nwords - 4);
533 1.1 jdolecek ap->linknext = adoswordn(bp, ap->nwords - 10);
534 1.1 jdolecek ap->linkto = adoswordn(bp, ap->nwords - 11);
535 1.1 jdolecek
536 1.1 jdolecek /*
537 1.1 jdolecek * setup last indirect block cache.
538 1.1 jdolecek */
539 1.1 jdolecek ap->lastlindblk = 0;
540 1.1 jdolecek if (ap->type == AFILE) {
541 1.1 jdolecek ap->lastindblk = ap->block;
542 1.1 jdolecek if (adoswordn(bp, ap->nwords - 10))
543 1.1 jdolecek ap->linkto = ap->block;
544 1.1 jdolecek } else if (ap->type == ALFILE) {
545 1.1 jdolecek ap->lastindblk = ap->linkto;
546 1.1 jdolecek brelse(bp);
547 1.1 jdolecek bp = NULL;
548 1.1 jdolecek error = bread(amp->devvp, ap->linkto * amp->bsize / DEV_BSIZE,
549 1.1 jdolecek amp->bsize, NOCRED, &bp);
550 1.1 jdolecek if (error) {
551 1.1 jdolecek brelse(bp);
552 1.1 jdolecek vput(vp);
553 1.1 jdolecek return (error);
554 1.1 jdolecek }
555 1.1 jdolecek ap->fsize = adoswordn(bp, ap->nwords - 47);
556 1.1 jdolecek /*
557 1.1 jdolecek * Should ap->block be set to the real file header block?
558 1.1 jdolecek */
559 1.1 jdolecek ap->block = ap->linkto;
560 1.1 jdolecek }
561 1.1 jdolecek
562 1.1 jdolecek if (ap->type == AROOT) {
563 1.1 jdolecek ap->adprot = 15;
564 1.1 jdolecek ap->uid = amp->uid;
565 1.1 jdolecek ap->gid = amp->gid;
566 1.1 jdolecek } else {
567 1.1 jdolecek ap->adprot = adoswordn(bp, ap->nwords - 48) ^ 15;
568 1.1 jdolecek /*
569 1.1 jdolecek * ADOS directories do not have a `x' protection bit as
570 1.1 jdolecek * it is known in VFS; this functionality is fulfilled
571 1.1 jdolecek * by the ADOS `r' bit.
572 1.1 jdolecek *
573 1.1 jdolecek * To retain the ADOS behaviour, fake execute permissions
574 1.1 jdolecek * in that case.
575 1.1 jdolecek */
576 1.1 jdolecek if ((ap->type == ADIR || ap->type == ALDIR) &&
577 1.1 jdolecek (ap->adprot & 0x00000008) == 0)
578 1.1 jdolecek ap->adprot &= ~0x00000002;
579 1.1 jdolecek
580 1.1 jdolecek /*
581 1.1 jdolecek * Get uid/gid from extensions in file header
582 1.1 jdolecek * (really need to know if this is a muFS partition)
583 1.1 jdolecek */
584 1.1 jdolecek ap->uid = (adoswordn(bp, ap->nwords - 49) >> 16) & 0xffff;
585 1.1 jdolecek ap->gid = adoswordn(bp, ap->nwords - 49) & 0xffff;
586 1.1 jdolecek if (ap->uid || ap->gid) {
587 1.1 jdolecek if (ap->uid == 0xffff)
588 1.1 jdolecek ap->uid = 0;
589 1.1 jdolecek if (ap->gid == 0xffff)
590 1.1 jdolecek ap->gid = 0;
591 1.1 jdolecek ap->adprot |= 0x40000000; /* Kludge */
592 1.1 jdolecek }
593 1.1 jdolecek else {
594 1.1 jdolecek /*
595 1.1 jdolecek * uid & gid extension don't exist,
596 1.1 jdolecek * so use the mount-point uid/gid
597 1.1 jdolecek */
598 1.1 jdolecek ap->uid = amp->uid;
599 1.1 jdolecek ap->gid = amp->gid;
600 1.1 jdolecek }
601 1.1 jdolecek }
602 1.1 jdolecek ap->mtime.days = adoswordn(bp, ap->nwords - 23);
603 1.1 jdolecek ap->mtime.mins = adoswordn(bp, ap->nwords - 22);
604 1.1 jdolecek ap->mtime.ticks = adoswordn(bp, ap->nwords - 21);
605 1.1 jdolecek
606 1.1 jdolecek genfs_node_init(vp, &adosfs_genfsops);
607 1.1 jdolecek *vpp = vp;
608 1.1 jdolecek brelse(bp);
609 1.1 jdolecek vp->v_size = ap->fsize;
610 1.1 jdolecek return (0);
611 1.1 jdolecek }
612 1.1 jdolecek
613 1.1 jdolecek /*
614 1.1 jdolecek * Load the bitmap into memory, and count the number of available
615 1.1 jdolecek * blocks.
616 1.1 jdolecek * The bitmap will be released if the filesystem is read-only; it's
617 1.1 jdolecek * only needed to find the free space.
618 1.1 jdolecek */
619 1.1 jdolecek int
620 1.1 jdolecek adosfs_loadbitmap(amp)
621 1.1 jdolecek struct adosfsmount *amp;
622 1.1 jdolecek {
623 1.1 jdolecek struct buf *bp, *mapbp;
624 1.1 jdolecek u_long bn;
625 1.1 jdolecek int blkix, endix, mapix;
626 1.1 jdolecek int bmsize;
627 1.1 jdolecek int error;
628 1.1 jdolecek
629 1.1 jdolecek bp = mapbp = NULL;
630 1.1 jdolecek bn = amp->rootb;
631 1.1 jdolecek if ((error = bread(amp->devvp, bn * amp->bsize / DEV_BSIZE, amp->bsize,
632 1.1 jdolecek NOCRED, &bp)) != 0) {
633 1.1 jdolecek brelse(bp);
634 1.1 jdolecek return (error);
635 1.1 jdolecek }
636 1.1 jdolecek blkix = amp->nwords - 49;
637 1.1 jdolecek endix = amp->nwords - 24;
638 1.1 jdolecek mapix = 0;
639 1.1 jdolecek bmsize = (amp->numblks + 31) / 32;
640 1.1 jdolecek while (mapix < bmsize) {
641 1.1 jdolecek int n;
642 1.1 jdolecek u_long bits;
643 1.1 jdolecek
644 1.1 jdolecek if (adoswordn(bp, blkix) == 0)
645 1.1 jdolecek break;
646 1.1 jdolecek if (mapbp != NULL)
647 1.1 jdolecek brelse(mapbp);
648 1.1 jdolecek if ((error = bread(amp->devvp,
649 1.1 jdolecek adoswordn(bp, blkix) * amp->bsize / DEV_BSIZE, amp->bsize,
650 1.1 jdolecek NOCRED, &mapbp)) != 0)
651 1.1 jdolecek break;
652 1.1 jdolecek if (adoscksum(mapbp, amp->nwords)) {
653 1.1 jdolecek #ifdef DIAGNOSTIC
654 1.1 jdolecek printf("adosfs: loadbitmap - cksum of blk %d failed\n",
655 1.1 jdolecek adoswordn(bp, blkix));
656 1.1 jdolecek #endif
657 1.1 jdolecek /* XXX Force read-only? Set free space 0? */
658 1.1 jdolecek break;
659 1.1 jdolecek }
660 1.1 jdolecek n = 1;
661 1.1 jdolecek while (n < amp->nwords && mapix < bmsize) {
662 1.1 jdolecek amp->bitmap[mapix++] = bits = adoswordn(mapbp, n);
663 1.1 jdolecek ++n;
664 1.1 jdolecek if (mapix == bmsize && amp->numblks & 31)
665 1.1 jdolecek bits &= ~(0xffffffff << (amp->numblks & 31));
666 1.1 jdolecek while (bits) {
667 1.1 jdolecek if (bits & 1)
668 1.1 jdolecek ++amp->freeblks;
669 1.1 jdolecek bits >>= 1;
670 1.1 jdolecek }
671 1.1 jdolecek }
672 1.1 jdolecek ++blkix;
673 1.1 jdolecek if (mapix < bmsize && blkix == endix) {
674 1.1 jdolecek bn = adoswordn(bp, blkix);
675 1.1 jdolecek brelse(bp);
676 1.1 jdolecek if ((error = bread(amp->devvp, bn * amp->bsize / DEV_BSIZE,
677 1.1 jdolecek amp->bsize, NOCRED, &bp)) != 0)
678 1.1 jdolecek break;
679 1.1 jdolecek /*
680 1.1 jdolecek * Why is there no checksum on these blocks?
681 1.1 jdolecek */
682 1.1 jdolecek blkix = 0;
683 1.1 jdolecek endix = amp->nwords - 1;
684 1.1 jdolecek }
685 1.1 jdolecek }
686 1.1 jdolecek if (bp)
687 1.1 jdolecek brelse(bp);
688 1.1 jdolecek if (mapbp)
689 1.1 jdolecek brelse(mapbp);
690 1.1 jdolecek return (error);
691 1.1 jdolecek }
692 1.1 jdolecek
693 1.1 jdolecek
694 1.1 jdolecek /*
695 1.1 jdolecek * File handle to vnode
696 1.1 jdolecek *
697 1.1 jdolecek * Have to be really careful about stale file handles:
698 1.1 jdolecek * - check that the inode number is in range
699 1.1 jdolecek * - call iget() to get the locked inode
700 1.1 jdolecek * - check for an unallocated inode (i_mode == 0)
701 1.1 jdolecek * - check that the generation number matches
702 1.1 jdolecek */
703 1.1 jdolecek
704 1.1 jdolecek struct ifid {
705 1.1 jdolecek ushort ifid_len;
706 1.1 jdolecek ushort ifid_pad;
707 1.1 jdolecek int ifid_ino;
708 1.1 jdolecek long ifid_start;
709 1.1 jdolecek };
710 1.1 jdolecek
711 1.1 jdolecek int
712 1.1 jdolecek adosfs_fhtovp(mp, fhp, vpp)
713 1.1 jdolecek struct mount *mp;
714 1.1 jdolecek struct fid *fhp;
715 1.1 jdolecek struct vnode **vpp;
716 1.1 jdolecek {
717 1.1 jdolecek struct ifid *ifhp = (struct ifid *)fhp;
718 1.1 jdolecek #if 0
719 1.1 jdolecek struct anode *ap;
720 1.1 jdolecek #endif
721 1.1 jdolecek struct vnode *nvp;
722 1.1 jdolecek int error;
723 1.1 jdolecek
724 1.1 jdolecek #ifdef ADOSFS_DIAGNOSTIC
725 1.1 jdolecek printf("adfhtovp(%x, %x, %x)\n", mp, fhp, vpp);
726 1.1 jdolecek #endif
727 1.1 jdolecek
728 1.1 jdolecek if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) {
729 1.1 jdolecek *vpp = NULLVP;
730 1.1 jdolecek return (error);
731 1.1 jdolecek }
732 1.1 jdolecek #if 0
733 1.1 jdolecek ap = VTOA(nvp);
734 1.1 jdolecek if (ap->inode.iso_mode == 0) {
735 1.1 jdolecek vput(nvp);
736 1.1 jdolecek *vpp = NULLVP;
737 1.1 jdolecek return (ESTALE);
738 1.1 jdolecek }
739 1.1 jdolecek #endif
740 1.1 jdolecek *vpp = nvp;
741 1.1 jdolecek return(0);
742 1.1 jdolecek }
743 1.1 jdolecek
744 1.1 jdolecek int
745 1.1 jdolecek adosfs_checkexp(mp, nam, exflagsp, credanonp)
746 1.1 jdolecek struct mount *mp;
747 1.1 jdolecek struct mbuf *nam;
748 1.1 jdolecek int *exflagsp;
749 1.1 jdolecek struct ucred **credanonp;
750 1.1 jdolecek {
751 1.1 jdolecek struct adosfsmount *amp = VFSTOADOSFS(mp);
752 1.1 jdolecek #if 0
753 1.1 jdolecek struct anode *ap;
754 1.1 jdolecek #endif
755 1.1 jdolecek struct netcred *np;
756 1.1 jdolecek
757 1.1 jdolecek #ifdef ADOSFS_DIAGNOSTIC
758 1.1 jdolecek printf("adcheckexp(%x, %x, %x)\n", mp, nam, exflagsp);
759 1.1 jdolecek #endif
760 1.1 jdolecek
761 1.1 jdolecek /*
762 1.1 jdolecek * Get the export permission structure for this <mp, client> tuple.
763 1.1 jdolecek */
764 1.1 jdolecek np = vfs_export_lookup(mp, &->export, nam);
765 1.1 jdolecek if (np == NULL)
766 1.1 jdolecek return (EACCES);
767 1.1 jdolecek
768 1.1 jdolecek *exflagsp = np->netc_exflags;
769 1.1 jdolecek *credanonp = &np->netc_anon;
770 1.1 jdolecek return(0);
771 1.1 jdolecek }
772 1.1 jdolecek
773 1.1 jdolecek int
774 1.1 jdolecek adosfs_vptofh(vp, fhp)
775 1.1 jdolecek struct vnode *vp;
776 1.1 jdolecek struct fid *fhp;
777 1.1 jdolecek {
778 1.1 jdolecek struct anode *ap = VTOA(vp);
779 1.1 jdolecek struct ifid *ifhp;
780 1.1 jdolecek
781 1.1 jdolecek ifhp = (struct ifid *)fhp;
782 1.1 jdolecek ifhp->ifid_len = sizeof(struct ifid);
783 1.1 jdolecek
784 1.1 jdolecek ifhp->ifid_ino = ap->block;
785 1.1 jdolecek ifhp->ifid_start = ap->block;
786 1.1 jdolecek
787 1.1 jdolecek #ifdef ADOSFS_DIAGNOSTIC
788 1.1 jdolecek printf("advptofh(%x, %x)\n", vp, fhp);
789 1.1 jdolecek #endif
790 1.1 jdolecek return(0);
791 1.1 jdolecek }
792 1.1 jdolecek
793 1.1 jdolecek int
794 1.5 darrenr adosfs_quotactl(mp, cmds, uid, arg, l)
795 1.1 jdolecek struct mount *mp;
796 1.1 jdolecek int cmds;
797 1.1 jdolecek uid_t uid;
798 1.1 jdolecek caddr_t arg;
799 1.5 darrenr struct lwp *l;
800 1.1 jdolecek {
801 1.1 jdolecek return(EOPNOTSUPP);
802 1.1 jdolecek }
803 1.1 jdolecek
804 1.1 jdolecek int
805 1.1 jdolecek adosfs_sync(mp, waitfor, uc, p)
806 1.1 jdolecek struct mount *mp;
807 1.1 jdolecek int waitfor;
808 1.1 jdolecek struct ucred *uc;
809 1.1 jdolecek struct proc *p;
810 1.1 jdolecek {
811 1.1 jdolecek #ifdef ADOSFS_DIAGNOSTIC
812 1.1 jdolecek printf("ad_sync(%x, %x)\n", mp, waitfor);
813 1.1 jdolecek #endif
814 1.1 jdolecek return(0);
815 1.1 jdolecek }
816 1.1 jdolecek
817 1.1 jdolecek void
818 1.1 jdolecek adosfs_init()
819 1.1 jdolecek {
820 1.1 jdolecek simple_lock_init(&adosfs_hashlock);
821 1.1 jdolecek
822 1.1 jdolecek pool_init(&adosfs_node_pool, sizeof(struct anode), 0, 0, 0,
823 1.1 jdolecek "adosndpl", &pool_allocator_nointr);
824 1.1 jdolecek }
825 1.1 jdolecek
826 1.1 jdolecek void
827 1.1 jdolecek adosfs_done()
828 1.1 jdolecek {
829 1.1 jdolecek pool_destroy(&adosfs_node_pool);
830 1.1 jdolecek }
831 1.1 jdolecek
832 1.1 jdolecek int
833 1.1 jdolecek adosfs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
834 1.1 jdolecek int *name;
835 1.1 jdolecek u_int namelen;
836 1.1 jdolecek void *oldp;
837 1.1 jdolecek size_t *oldlenp;
838 1.1 jdolecek void *newp;
839 1.1 jdolecek size_t newlen;
840 1.1 jdolecek struct proc *p;
841 1.1 jdolecek {
842 1.1 jdolecek return (EOPNOTSUPP);
843 1.1 jdolecek }
844 1.1 jdolecek
845 1.1 jdolecek /*
846 1.1 jdolecek * vfs generic function call table
847 1.1 jdolecek */
848 1.1 jdolecek
849 1.1 jdolecek extern const struct vnodeopv_desc adosfs_vnodeop_opv_desc;
850 1.1 jdolecek
851 1.1 jdolecek const struct vnodeopv_desc *adosfs_vnodeopv_descs[] = {
852 1.1 jdolecek &adosfs_vnodeop_opv_desc,
853 1.1 jdolecek NULL,
854 1.1 jdolecek };
855 1.1 jdolecek
856 1.1 jdolecek struct vfsops adosfs_vfsops = {
857 1.1 jdolecek MOUNT_ADOSFS,
858 1.1 jdolecek adosfs_mount,
859 1.1 jdolecek adosfs_start,
860 1.1 jdolecek adosfs_unmount,
861 1.1 jdolecek adosfs_root,
862 1.1 jdolecek adosfs_quotactl,
863 1.1 jdolecek adosfs_statfs,
864 1.1 jdolecek adosfs_sync,
865 1.1 jdolecek adosfs_vget,
866 1.1 jdolecek adosfs_fhtovp,
867 1.1 jdolecek adosfs_vptofh,
868 1.1 jdolecek adosfs_init,
869 1.1 jdolecek NULL,
870 1.1 jdolecek adosfs_done,
871 1.1 jdolecek adosfs_sysctl,
872 1.1 jdolecek NULL, /* vfs_mountroot */
873 1.1 jdolecek adosfs_checkexp,
874 1.1 jdolecek adosfs_vnodeopv_descs,
875 1.1 jdolecek };
876