diff options
author | phk <phk@FreeBSD.org> | 1999-07-20 09:47:55 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-07-20 09:47:55 +0000 |
commit | cacc73aa1890c8a258a383716e0c90da798acd4e (patch) | |
tree | 895deb1c3a5fdc3b63cee3173606b1811c3149f5 /sys/miscfs/specfs | |
parent | cf4a7fab742bfd88596615a4e608783600af67b5 (diff) | |
download | FreeBSD-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/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 3 | ||||
-rw-r--r-- | sys/miscfs/specfs/specdev.h | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 9a467fd..9dff63d 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.88 1999/06/01 20:29:58 dt Exp $ + * $Id: spec_vnops.c,v 1.89 1999/06/26 02:46:21 mckusick Exp $ */ #include <sys/param.h> @@ -75,7 +75,6 @@ static int spec_read __P((struct vop_read_args *)); static int spec_strategy __P((struct vop_strategy_args *)); static int spec_write __P((struct vop_write_args *)); -struct vnode *speclisth[SPECHSZ]; vop_t **spec_vnodeop_p; static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index d0cfd77..3150b49 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)specdev.h 8.6 (Berkeley) 5/21/95 - * $Id: specdev.h,v 1.16 1999/02/25 05:22:30 dillon Exp $ + * $Id: specdev.h,v 1.17 1999/05/11 19:54:39 phk Exp $ */ /* @@ -40,20 +40,19 @@ * in vgone. */ struct specinfo { - struct vnode **si_hashchain; - struct vnode *si_specnext; struct mount *si_mountpoint; - dev_t si_rdev; int si_bsize_phys; /* minimum physical block size */ int si_bsize_best; /* optimal block size / VBLK */ int si_bsize_max; /* maximum block size */ + + udev_t si_udev; + SLIST_ENTRY(specinfo) si_hash; + struct vnode *si_hlist; }; /* * Exported shorthand */ -#define v_rdev v_specinfo->si_rdev -#define v_hashchain v_specinfo->si_hashchain -#define v_specnext v_specinfo->si_specnext +#define v_hashchain v_specinfo->si_hlist #define v_specmountpoint v_specinfo->si_mountpoint /* @@ -62,7 +61,6 @@ struct specinfo { #define SPECHSZ 64 #define SPECHASH(rdev) (((unsigned)(minor(rdev)))%SPECHSZ) -extern struct vnode *speclisth[SPECHSZ]; /* * Prototypes for special file operations on vnodes. |