lfs_vfsops.c revision 1.16 1 /* $NetBSD: lfs_vfsops.c,v 1.16 1998/03/01 02:23:25 fvdl Exp $ */
2
3 /*
4 * Copyright (c) 1989, 1991, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * @(#)lfs_vfsops.c 8.20 (Berkeley) 6/10/95
36 */
37
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/namei.h>
41 #include <sys/proc.h>
42 #include <sys/kernel.h>
43 #include <sys/vnode.h>
44 #include <sys/mount.h>
45 #include <sys/buf.h>
46 #include <sys/mbuf.h>
47 #include <sys/file.h>
48 #include <sys/disklabel.h>
49 #include <sys/ioctl.h>
50 #include <sys/errno.h>
51 #include <sys/malloc.h>
52 #include <sys/socket.h>
53
54 #include <miscfs/specfs/specdev.h>
55
56 #include <ufs/ufs/quota.h>
57 #include <ufs/ufs/inode.h>
58 #include <ufs/ufs/ufsmount.h>
59 #include <ufs/ufs/ufs_extern.h>
60
61 #include <ufs/lfs/lfs.h>
62 #include <ufs/lfs/lfs_extern.h>
63
64 int lfs_mountfs __P((struct vnode *, struct mount *, struct proc *));
65
66 extern struct vnodeopv_desc lfs_vnodeop_opv_desc;
67 extern struct vnodeopv_desc lfs_specop_opv_desc;
68 #ifdef FIFO
69 extern struct vnodeopv_desc lfs_fifoop_opv_desc;
70 #endif
71
72 struct vnodeopv_desc *lfs_vnodeopv_descs[] = {
73 &lfs_vnodeop_opv_desc,
74 &lfs_specop_opv_desc,
75 #ifdef FIFO
76 &lfs_fifoop_opv_desc,
77 #endif
78 NULL,
79 };
80
81 struct vfsops lfs_vfsops = {
82 MOUNT_LFS,
83 lfs_mount,
84 ufs_start,
85 lfs_unmount,
86 ufs_root,
87 ufs_quotactl,
88 lfs_statfs,
89 lfs_sync,
90 lfs_vget,
91 lfs_fhtovp,
92 lfs_vptofh,
93 lfs_init,
94 lfs_sysctl,
95 lfs_mountroot,
96 lfs_vnodeopv_descs,
97 };
98
99 /*
100 * Initialize the filesystem, most work done by ufs_init.
101 */
102 void
103 lfs_init()
104 {
105 ufs_init();
106 }
107
108 /*
109 * Called by main() when ufs is going to be mounted as root.
110 */
111 int
112 lfs_mountroot()
113 {
114 extern struct vnode *rootvp;
115 struct mount *mp;
116 struct proc *p = curproc; /* XXX */
117 int error;
118
119 /*
120 * Get vnodes for swapdev and rootdev.
121 */
122 if ((error = bdevvp(rootdev, &rootvp))) {
123 printf("lfs_mountroot: can't setup bdevvp's");
124 return (error);
125 }
126 if ((error = vfs_rootmountalloc(MOUNT_LFS, "root_device", &mp)))
127 return (error);
128 if ((error = lfs_mountfs(rootvp, mp, p))) {
129 mp->mnt_op->vfs_refcount--;
130 vfs_unbusy(mp);
131 free(mp, M_MOUNT);
132 return (error);
133 }
134 simple_lock(&mountlist_slock);
135 CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
136 simple_unlock(&mountlist_slock);
137 (void)lfs_statfs(mp, &mp->mnt_stat, p);
138 vfs_unbusy(mp);
139 return (0);
140 }
141
142 /*
143 * VFS Operations.
144 *
145 * mount system call
146 */
147 int
148 lfs_mount(mp, path, data, ndp, p)
149 register struct mount *mp;
150 const char *path;
151 void *data;
152 struct nameidata *ndp;
153 struct proc *p;
154 {
155 struct vnode *devvp;
156 struct ufs_args args;
157 struct ufsmount *ump = NULL;
158 register struct lfs *fs = NULL; /* LFS */
159 size_t size;
160 int error;
161 mode_t accessmode;
162
163 error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args));
164 if (error)
165 return (error);
166
167 /* Until LFS can do NFS right. XXX */
168 if (args.export.ex_flags & MNT_EXPORTED)
169 return (EINVAL);
170
171 /*
172 * If updating, check whether changing from read-only to
173 * read/write; if there is no device name, that's all we do.
174 */
175 if (mp->mnt_flag & MNT_UPDATE) {
176 ump = VFSTOUFS(mp);
177 if (fs->lfs_ronly && (mp->mnt_flag & MNT_WANTRDWR)) {
178 /*
179 * If upgrade to read-write by non-root, then verify
180 * that user has necessary permissions on the device.
181 */
182 if (p->p_ucred->cr_uid != 0) {
183 vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY);
184 error = VOP_ACCESS(ump->um_devvp, VREAD|VWRITE,
185 p->p_ucred, p);
186 VOP_UNLOCK(ump->um_devvp, 0);
187 if (error)
188 return (error);
189 }
190 fs->lfs_ronly = 0;
191 }
192 if (args.fspec == 0) {
193 /*
194 * Process export requests.
195 */
196 return (vfs_export(mp, &ump->um_export, &args.export));
197 }
198 }
199 /*
200 * Not an update, or updating the name: look up the name
201 * and verify that it refers to a sensible block device.
202 */
203 NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p);
204 if ((error = namei(ndp)) != 0)
205 return (error);
206 devvp = ndp->ni_vp;
207 if (devvp->v_type != VBLK) {
208 vrele(devvp);
209 return (ENOTBLK);
210 }
211 if (major(devvp->v_rdev) >= nblkdev) {
212 vrele(devvp);
213 return (ENXIO);
214 }
215 /*
216 * If mount by non-root, then verify that user has necessary
217 * permissions on the device.
218 */
219 if (p->p_ucred->cr_uid != 0) {
220 accessmode = VREAD;
221 if ((mp->mnt_flag & MNT_RDONLY) == 0)
222 accessmode |= VWRITE;
223 vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
224 error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p);
225 if (error) {
226 vput(devvp);
227 return (error);
228 }
229 VOP_UNLOCK(devvp, 0);
230 }
231 if ((mp->mnt_flag & MNT_UPDATE) == 0)
232 error = lfs_mountfs(devvp, mp, p); /* LFS */
233 else {
234 if (devvp != ump->um_devvp)
235 error = EINVAL; /* needs translation */
236 else
237 vrele(devvp);
238 }
239 if (error) {
240 vrele(devvp);
241 return (error);
242 }
243 ump = VFSTOUFS(mp);
244 fs = ump->um_lfs; /* LFS */
245 #ifdef NOTLFS /* LFS */
246 (void) copyinstr(path, fs->fs_fsmnt, sizeof(fs->fs_fsmnt) - 1, &size);
247 bzero(fs->fs_fsmnt + size, sizeof(fs->fs_fsmnt) - size);
248 bcopy(fs->fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
249 #else
250 (void)copyinstr(path, fs->lfs_fsmnt, sizeof(fs->lfs_fsmnt) - 1, &size);
251 bzero(fs->lfs_fsmnt + size, sizeof(fs->lfs_fsmnt) - size);
252 bcopy(fs->lfs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
253 #endif
254 (void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
255 &size);
256 bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
257 return (0);
258 }
259
260 /*
261 * Common code for mount and mountroot
262 * LFS specific
263 */
264 int
265 lfs_mountfs(devvp, mp, p)
266 register struct vnode *devvp;
267 struct mount *mp;
268 struct proc *p;
269 {
270 extern struct vnode *rootvp;
271 register struct lfs *fs;
272 register struct ufsmount *ump;
273 struct vnode *vp;
274 struct buf *bp;
275 struct partinfo dpart;
276 dev_t dev;
277 int error, i, ronly, size;
278 struct ucred *cred;
279
280 cred = p ? p->p_ucred : NOCRED;
281 /*
282 * Disallow multiple mounts of the same device.
283 * Disallow mounting of a device that is currently in use
284 * (except for root, which might share swap device for miniroot).
285 * Flush out any old buffers remaining from a previous use.
286 */
287 if ((error = vfs_mountedon(devvp)) != 0)
288 return (error);
289 if (vcount(devvp) > 1 && devvp != rootvp)
290 return (EBUSY);
291 if ((error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0)) != 0)
292 return (error);
293
294 ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
295 error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
296 if (error)
297 return (error);
298
299 if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, p) != 0)
300 size = DEV_BSIZE;
301 else {
302 size = dpart.disklab->d_secsize;
303 #ifdef NEVER_USED
304 dpart.part->p_fstype = FS_LFS;
305 dpart.part->p_fsize = fs->lfs_fsize; /* frag size */
306 dpart.part->p_frag = fs->lfs_frag; /* frags per block */
307 dpart.part->p_cpg = fs->lfs_segshift; /* segment shift */
308 #endif
309 }
310
311 /* Don't free random space on error. */
312 bp = NULL;
313 ump = NULL;
314
315 /* Read in the superblock. */
316 error = bread(devvp, LFS_LABELPAD / size, LFS_SBPAD, cred, &bp);
317 if (error)
318 goto out;
319 fs = (struct lfs *)bp->b_data;
320
321 /* Check the basics. */
322 if (fs->lfs_magic != LFS_MAGIC || fs->lfs_bsize > MAXBSIZE ||
323 fs->lfs_bsize < sizeof(struct lfs)) {
324 error = EINVAL; /* XXX needs translation */
325 goto out;
326 }
327
328 /* Allocate the mount structure, copy the superblock into it. */
329 ump = (struct ufsmount *)malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
330 fs = ump->um_lfs = malloc(sizeof(struct lfs), M_UFSMNT, M_WAITOK);
331 bcopy(bp->b_data, fs, sizeof(struct lfs));
332 if (sizeof(struct lfs) < LFS_SBPAD) /* XXX why? */
333 bp->b_flags |= B_INVAL;
334 brelse(bp);
335 bp = NULL;
336
337 /* Set up the I/O information */
338 fs->lfs_iocount = 0;
339
340 /* Set up the ifile and lock aflags */
341 fs->lfs_doifile = 0;
342 fs->lfs_writer = 0;
343 fs->lfs_dirops = 0;
344 fs->lfs_seglock = 0;
345
346 /* Set the file system readonly/modify bits. */
347 fs->lfs_ronly = ronly;
348 if (ronly == 0)
349 fs->lfs_fmod = 1;
350
351 /* Initialize the mount structure. */
352 dev = devvp->v_rdev;
353 mp->mnt_data = (qaddr_t)ump;
354 mp->mnt_stat.f_fsid.val[0] = (long)dev;
355 mp->mnt_stat.f_fsid.val[1] = makefstype(MOUNT_LFS);
356 mp->mnt_maxsymlinklen = fs->lfs_maxsymlinklen;
357 mp->mnt_flag |= MNT_LOCAL;
358 ump->um_mountp = mp;
359 ump->um_dev = dev;
360 ump->um_devvp = devvp;
361 ump->um_bptrtodb = 0;
362 ump->um_seqinc = 1 << fs->lfs_fsbtodb;
363 ump->um_nindir = fs->lfs_nindir;
364 for (i = 0; i < MAXQUOTAS; i++)
365 ump->um_quotas[i] = NULLVP;
366 devvp->v_specflags |= SI_MOUNTEDON;
367
368 /*
369 * We use the ifile vnode for almost every operation. Instead of
370 * retrieving it from the hash table each time we retrieve it here,
371 * artificially increment the reference count and keep a pointer
372 * to it in the incore copy of the superblock.
373 */
374 if ((error = VFS_VGET(mp, LFS_IFILE_INUM, &vp)) != 0)
375 goto out;
376 fs->lfs_ivnode = vp;
377 VREF(vp);
378 vput(vp);
379
380 return (0);
381 out:
382 if (bp)
383 brelse(bp);
384 (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p);
385 if (ump) {
386 free(ump->um_lfs, M_UFSMNT);
387 free(ump, M_UFSMNT);
388 mp->mnt_data = (qaddr_t)0;
389 }
390 return (error);
391 }
392
393 /*
394 * unmount system call
395 */
396 int
397 lfs_unmount(mp, mntflags, p)
398 struct mount *mp;
399 int mntflags;
400 struct proc *p;
401 {
402 register struct ufsmount *ump;
403 register struct lfs *fs;
404 int error, flags, ronly;
405
406 flags = 0;
407 if (mntflags & MNT_FORCE)
408 flags |= FORCECLOSE;
409
410 ump = VFSTOUFS(mp);
411 fs = ump->um_lfs;
412 #ifdef QUOTA
413 if (mp->mnt_flag & MNT_QUOTA) {
414 int i;
415 error = vflush(mp, fs->lfs_ivnode, SKIPSYSTEM|flags);
416 if (error)
417 return (error);
418 for (i = 0; i < MAXQUOTAS; i++) {
419 if (ump->um_quotas[i] == NULLVP)
420 continue;
421 quotaoff(p, mp, i);
422 }
423 /*
424 * Here we fall through to vflush again to ensure
425 * that we have gotten rid of all the system vnodes.
426 */
427 }
428 #endif
429 if ((error = vflush(mp, fs->lfs_ivnode, flags)) != 0)
430 return (error);
431 fs->lfs_clean = 1;
432 if ((error = VFS_SYNC(mp, 1, p->p_ucred, p)) != 0)
433 return (error);
434 if (fs->lfs_ivnode->v_dirtyblkhd.lh_first)
435 panic("lfs_unmount: still dirty blocks on ifile vnode\n");
436 vrele(fs->lfs_ivnode);
437 vgone(fs->lfs_ivnode);
438
439 ronly = !fs->lfs_ronly;
440 ump->um_devvp->v_specflags &= ~SI_MOUNTEDON;
441 error = VOP_CLOSE(ump->um_devvp,
442 ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
443 vrele(ump->um_devvp);
444 free(fs, M_UFSMNT);
445 free(ump, M_UFSMNT);
446 mp->mnt_data = (qaddr_t)0;
447 mp->mnt_flag &= ~MNT_LOCAL;
448 return (error);
449 }
450
451 /*
452 * Get file system statistics.
453 */
454 int
455 lfs_statfs(mp, sbp, p)
456 struct mount *mp;
457 register struct statfs *sbp;
458 struct proc *p;
459 {
460 register struct lfs *fs;
461 register struct ufsmount *ump;
462
463 ump = VFSTOUFS(mp);
464 fs = ump->um_lfs;
465 if (fs->lfs_magic != LFS_MAGIC)
466 panic("lfs_statfs: magic");
467 sbp->f_type = 0;
468 sbp->f_bsize = fs->lfs_bsize;
469 sbp->f_iosize = fs->lfs_bsize;
470 sbp->f_blocks = dbtofrags(fs, fs->lfs_dsize);
471 sbp->f_bfree = dbtofrags(fs, fs->lfs_bfree);
472 /*
473 * To compute the available space. Subtract the minimum free
474 * from the total number of blocks in the file system. Set avail
475 * to the smaller of this number and fs->lfs_bfree.
476 */
477 sbp->f_bavail = (long) ((u_int64_t) fs->lfs_dsize * (u_int64_t)
478 (100 - fs->lfs_minfree) / (u_int64_t) 100);
479 sbp->f_bavail =
480 sbp->f_bavail > fs->lfs_bfree ? fs->lfs_bfree : sbp->f_bavail;
481 sbp->f_bavail = dbtofrags(fs, sbp->f_bavail);
482 sbp->f_files = fs->lfs_nfiles;
483 sbp->f_ffree = sbp->f_bfree * INOPB(fs);
484 if (sbp != &mp->mnt_stat) {
485 bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
486 bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
487 }
488 strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN);
489 return (0);
490 }
491
492 /*
493 * Go through the disk queues to initiate sandbagged IO;
494 * go through the inodes to write those that have been modified;
495 * initiate the writing of the super block if it has been modified.
496 *
497 * Note: we are always called with the filesystem marked `MPBUSY'.
498 */
499 int
500 lfs_sync(mp, waitfor, cred, p)
501 struct mount *mp;
502 int waitfor;
503 struct ucred *cred;
504 struct proc *p;
505 {
506 int error;
507
508 /* All syncs must be checkpoints until roll-forward is implemented. */
509 error = lfs_segwrite(mp, SEGM_CKP | (waitfor ? SEGM_SYNC : 0));
510 #ifdef QUOTA
511 qsync(mp);
512 #endif
513 return (error);
514 }
515
516 /*
517 * Look up an LFS dinode number to find its incore vnode. If not already
518 * in core, read it in from the specified device. Return the inode locked.
519 * Detection and handling of mount points must be done by the calling routine.
520 */
521 int
522 lfs_vget(mp, ino, vpp)
523 struct mount *mp;
524 ino_t ino;
525 struct vnode **vpp;
526 {
527 register struct lfs *fs;
528 register struct inode *ip;
529 struct buf *bp;
530 struct ifile *ifp;
531 struct vnode *vp;
532 struct ufsmount *ump;
533 ufs_daddr_t daddr;
534 dev_t dev;
535 int error;
536
537 ump = VFSTOUFS(mp);
538 dev = ump->um_dev;
539 if ((*vpp = ufs_ihashget(dev, ino)) != NULL)
540 return (0);
541
542 /* Translate the inode number to a disk address. */
543 fs = ump->um_lfs;
544 if (ino == LFS_IFILE_INUM)
545 daddr = fs->lfs_idaddr;
546 else {
547 LFS_IENTRY(ifp, fs, ino, bp);
548 daddr = ifp->if_daddr;
549 brelse(bp);
550 if (daddr == LFS_UNUSED_DADDR)
551 return (ENOENT);
552 }
553
554 /* Allocate new vnode/inode. */
555 if ((error = lfs_vcreate(mp, ino, &vp)) != 0) {
556 *vpp = NULL;
557 return (error);
558 }
559
560 /*
561 * Put it onto its hash chain and lock it so that other requests for
562 * this inode will block if they arrive while we are sleeping waiting
563 * for old data structures to be purged or for the contents of the
564 * disk portion of this inode to be read.
565 */
566 ip = VTOI(vp);
567 ufs_ihashins(ip);
568
569 /*
570 * XXX
571 * This may not need to be here, logically it should go down with
572 * the i_devvp initialization.
573 * Ask Kirk.
574 */
575 ip->i_lfs = ump->um_lfs;
576
577 /* Read in the disk contents for the inode, copy into the inode. */
578 error = bread(ump->um_devvp, daddr, (int)fs->lfs_bsize, NOCRED, &bp);
579 if (error) {
580 /*
581 * The inode does not contain anything useful, so it would
582 * be misleading to leave it on its hash chain. With mode
583 * still zero, it will be unlinked and returned to the free
584 * list by vput().
585 */
586 vput(vp);
587 brelse(bp);
588 *vpp = NULL;
589 return (error);
590 }
591 ip->i_din.ffs_din = *lfs_ifind(fs, ino, (struct dinode *)bp->b_data);
592 brelse(bp);
593
594 /*
595 * Initialize the vnode from the inode, check for aliases. In all
596 * cases re-init ip, the underlying vnode/inode may have changed.
597 */
598 error = ufs_vinit(mp, lfs_specop_p, LFS_FIFOOPS, &vp);
599 if (error) {
600 vput(vp);
601 *vpp = NULL;
602 return (error);
603 }
604 /*
605 * Finish inode initialization now that aliasing has been resolved.
606 */
607 ip->i_devvp = ump->um_devvp;
608 VREF(ip->i_devvp);
609 *vpp = vp;
610 return (0);
611 }
612
613 /*
614 * File handle to vnode
615 *
616 * Have to be really careful about stale file handles:
617 * - check that the inode number is valid
618 * - call lfs_vget() to get the locked inode
619 * - check for an unallocated inode (i_mode == 0)
620 * - check that the given client host has export rights and return
621 * those rights via. exflagsp and credanonp
622 *
623 * XXX
624 * use ifile to see if inode is allocated instead of reading off disk
625 * what is the relationship between my generational number and the NFS
626 * generational number.
627 */
628 int
629 lfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
630 register struct mount *mp;
631 struct fid *fhp;
632 struct mbuf *nam;
633 struct vnode **vpp;
634 int *exflagsp;
635 struct ucred **credanonp;
636 {
637 register struct ufid *ufhp;
638
639 ufhp = (struct ufid *)fhp;
640 if (ufhp->ufid_ino < ROOTINO)
641 return (ESTALE);
642 return (ufs_check_export(mp, ufhp, nam, vpp, exflagsp, credanonp));
643 }
644
645 /*
646 * Vnode pointer to File handle
647 */
648 /* ARGSUSED */
649 int
650 lfs_vptofh(vp, fhp)
651 struct vnode *vp;
652 struct fid *fhp;
653 {
654 register struct inode *ip;
655 register struct ufid *ufhp;
656
657 ip = VTOI(vp);
658 ufhp = (struct ufid *)fhp;
659 ufhp->ufid_len = sizeof(struct ufid);
660 ufhp->ufid_ino = ip->i_number;
661 ufhp->ufid_gen = ip->i_ffs_gen;
662 return (0);
663 }
664
665 int
666 lfs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
667 int *name;
668 u_int namelen;
669 void *oldp;
670 size_t *oldlenp;
671 void *newp;
672 size_t newlen;
673 struct proc *p;
674 {
675 return (EOPNOTSUPP);
676 }
677