-#ifdef KERNEL
-/*
- * Getfs maps a device number into a pointer to the incore super block.
- *
- * The algorithm is a linear search through the mount table. A
- * consistency check of the super block magic number is performed.
- * Filesystems still working on a mount are skipped.
- *
- * panic: no fs -- the device is not mounted.
- * this "cannot happen"
- */
-struct fs *
-getfs(dev)
- dev_t dev;
-{
- register struct ufsmount *mp;
- register struct fs *fs;
-
- for (mp = &mounttab[0]; mp < &mounttab[NMOUNT]; mp++) {
- if (mp->um_fs == NULL || mp->um_dev != dev ||
- mp->um_fs == (struct fs *)1) /* XXX */
- continue;
- fs = mp->um_fs;
- if (fs->fs_magic != FS_MAGIC) {
- printf("dev = 0x%x, fs = %s\n", dev, fs->fs_fsmnt);
- panic("getfs: bad magic");
- }
- return (fs);
- }
- printf("dev = 0x%x\n", dev);
- panic("getfs: no fs");
- return (NULL);
-}
-
-/*
- * Getfsx returns the index in the file system
- * table of the specified device. The swap device
- * is also assigned a pseudo-index. The index may
- * be used as a compressed indication of the location
- * of a block, recording
- * <getfsx(dev),blkno>
- * rather than
- * <dev, blkno>
- * provided the information need remain valid only
- * as long as the file system is mounted.
- */
-getfsx(dev)
- dev_t dev;
-{
- register struct ufsmount *mp;
-
- if (dev == swapdev)
- return (MSWAPX);
- for(mp = &mounttab[0]; mp < &mounttab[NMOUNT]; mp++)
- if (mp->um_dev == dev)
- return (mp - &mounttab[0]);
- return (-1);
-}
-#endif
-
-#if (!defined(vax) && !defined(tahoe)) || defined(VAX630) || defined(VAX650)