summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-07-20 09:47:55 +0000
committerphk <phk@FreeBSD.org>1999-07-20 09:47:55 +0000
commitcacc73aa1890c8a258a383716e0c90da798acd4e (patch)
tree895deb1c3a5fdc3b63cee3173606b1811c3149f5 /sys/ufs
parentcf4a7fab742bfd88596615a4e608783600af67b5 (diff)
downloadFreeBSD-src-cacc73aa1890c8a258a383716e0c90da798acd4e.zip
FreeBSD-src-cacc73aa1890c8a258a383716e0c90da798acd4e.tar.gz
Now a dev_t is a pointer to struct specinfo which is shared by all specdev
vnodes referencing this device. Details: cdevsw->d_parms has been removed, the specinfo is available now (== dev_t) and the driver should modify it directly when applicable, and the only driver doing so, does so: vn.c. I am not sure the logic in checking for "<" was right before, and it looks even less so now. An intial pool of 50 struct specinfo are depleted during early boot, after that malloc had better work. It is likely that fewer than 50 would do. Hashing is done from udev_t to dev_t with a prime number remainder hash, experiments show no better hash available for decent cost (MD5 is only marginally better) The prime number used should not be close to a power of two, we use 83 for now. Add new checkalias2() to get around the loss of info from dev2udev() in bdevvp(); The aliased vnodes are hung on a list straight of the dev_t, and speclisth[SPECSZ] is unused. The sharing of struct specinfo means that the v_specnext moves into the vnode which grows by 4 bytes. Don't use a VBLK dev_t which doesn't make sense in MFS, now we hang a dummy cdevsw on B/Cmaj 253 so that things look sane. Storage overhead from all of this is O(50k). Bump __FreeBSD_version to 400009 The next step will add the stuff needed so device-drivers can start to hang things from struct specinfo
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index 47e4676..7569f74 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95
- * $Id: mfs_vfsops.c,v 1.64 1999/05/24 00:27:12 jb Exp $
+ * $Id: mfs_vfsops.c,v 1.65 1999/07/17 18:43:49 phk Exp $
*/
@@ -79,6 +79,28 @@ static int mfs_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int mfs_init __P((struct vfsconf *));
+static struct cdevsw mfs_cdevsw = {
+ /* open */ noopen,
+ /* close */ noclose,
+ /* read */ physread,
+ /* write */ physwrite,
+ /* ioctl */ noioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ nopoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "MFS",
+ /* parms */ noparms,
+ /* maj */ 253,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_DISK,
+ /* maxio */ 0,
+ /* bmaj */ 253,
+};
+
/*
* mfs vfs operations.
*/
@@ -308,7 +330,7 @@ mfs_mount(mp, path, data, ndp, p)
goto error_1;
}
devvp->v_type = VBLK;
- if (checkalias(devvp, makeudev(255, mfs_minor++), (struct mount *)0))
+ if (checkalias(devvp, makeudev(253, mfs_minor++), (struct mount *)0))
panic("mfs_mount: dup dev");
devvp->v_data = mfsp;
mfsp->mfs_baseoff = args.base;
@@ -459,12 +481,13 @@ static int
mfs_init(vfsp)
struct vfsconf *vfsp;
{
+ cdevsw_add(&mfs_cdevsw);
#ifdef MFS_ROOT
if (bootverbose)
printf("Considering MFS root f/s.\n");
if (mfs_getimage()) {
mountrootfsname = "mfs";
- rootdev = makedev(255, mfs_minor++);
+ rootdev = makedev(253, mfs_minor++);
} else if (bootverbose)
printf("No MFS image available as root f/s.\n");
#endif
OpenPOWER on IntegriCloud