diff options
author | phk <phk@FreeBSD.org> | 1999-05-07 10:11:40 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-05-07 10:11:40 +0000 |
commit | 693dd58bb3e5843d252e25a15e2cc8d49323cb82 (patch) | |
tree | a0fbea49edf11184c1bafaed7d5b3cd858742449 /sys/miscfs/specfs | |
parent | cfcd3ae08c30d66088e1ad5ffa68aa05b60e1bfe (diff) | |
download | FreeBSD-src-693dd58bb3e5843d252e25a15e2cc8d49323cb82.zip FreeBSD-src-693dd58bb3e5843d252e25a15e2cc8d49323cb82.tar.gz |
Continue where Julian left off in July 1998:
Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline)
function.
Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
to the order of the cmaj/bmaj arguments!)
Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
(ditto!)
(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index a3ee89f..63f2b36 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.82 1999/04/05 19:38:30 julian Exp $ + * $Id: spec_vnops.c,v 1.83 1999/05/06 20:00:27 phk Exp $ */ #include <sys/param.h> @@ -214,7 +214,7 @@ spec_open(ap) case VBLK: if ((u_int)maj >= nblkdev) return (ENXIO); - if ( (bdevsw[maj] == NULL) || (bdevsw[maj]->d_open == NULL)) + if ( (bdevsw(maj) == NULL) || (bdevsw(maj)->d_open == NULL)) return ENXIO; /* * When running in very secure mode, do not allow @@ -222,7 +222,7 @@ spec_open(ap) */ if (securelevel >= 2 && ap->a_cred != FSCRED && (ap->a_mode & FWRITE) && - (bdevsw[maj]->d_flags & D_TYPEMASK) == D_DISK) + (bdevsw(maj)->d_flags & D_TYPEMASK) == D_DISK) return (EPERM); /* @@ -232,7 +232,7 @@ spec_open(ap) error = vfs_mountedon(vp); if (error) return (error); - return ((*bdevsw[maj]->d_open)(dev, ap->a_mode, S_IFBLK, p)); + return ((*bdevsw(maj)->d_open)(dev, ap->a_mode, S_IFBLK, p)); /* NOT REACHED */ default: break; @@ -295,7 +295,7 @@ spec_read(ap) bsize = vp->v_specinfo->si_bsize_best; - if ((ioctl = bdevsw[major(dev)]->d_ioctl) != NULL && + if ((ioctl = bdevsw(major(dev))->d_ioctl) != NULL && (*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 && dpart.part->p_fstype == FS_BSDFFS && dpart.part->p_frag != 0 && dpart.part->p_fsize != 0) @@ -379,7 +379,7 @@ spec_write(ap) */ bsize = vp->v_specinfo->si_bsize_best; - if ((*bdevsw[major(vp->v_rdev)]->d_ioctl)(vp->v_rdev, DIOCGPART, + if ((*bdevsw(major(vp->v_rdev))->d_ioctl)(vp->v_rdev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0) { if (dpart.part->p_fstype == FS_BSDFFS && dpart.part->p_frag != 0 && dpart.part->p_fsize != 0) @@ -437,7 +437,7 @@ spec_ioctl(ap) return ((*cdevsw[major(dev)]->d_ioctl)(dev, ap->a_command, ap->a_data, ap->a_fflag, ap->a_p)); case VBLK: - return ((*bdevsw[major(dev)]->d_ioctl)(dev, ap->a_command, + return ((*bdevsw(major(dev))->d_ioctl)(dev, ap->a_command, ap->a_data, ap->a_fflag, ap->a_p)); default: panic("spec_ioctl"); @@ -553,7 +553,7 @@ spec_strategy(ap) if (((bp->b_flags & B_READ) == 0) && (LIST_FIRST(&bp->b_dep)) != NULL && bioops.io_start) (*bioops.io_start)(bp); - (*bdevsw[major(bp->b_dev)]->d_strategy)(bp); + (*bdevsw(major(bp->b_dev))->d_strategy)(bp); return (0); } @@ -568,7 +568,7 @@ spec_freeblks(ap) struct cdevsw *bsw; struct buf *bp; - bsw = bdevsw[major(ap->a_vp->v_rdev)]; + bsw = bdevsw(major(ap->a_vp->v_rdev)); if ((bsw->d_flags & D_CANFREE) == 0) return (0); bp = geteblk(ap->a_length); @@ -678,7 +678,7 @@ spec_close(ap) if ((vcount(vp) > 1) && (vp->v_flag & VXLOCK) == 0) return (0); - devclose = bdevsw[major(dev)]->d_close; + devclose = bdevsw(major(dev))->d_close; mode = S_IFBLK; break; @@ -956,7 +956,7 @@ spec_getattr(ap) vap->va_blocksize = MAXBSIZE; } - if ((*bdevsw[major(vp->v_rdev)]->d_ioctl)(vp->v_rdev, DIOCGPART, + if ((*bdevsw(major(vp->v_rdev))->d_ioctl)(vp->v_rdev, DIOCGPART, (caddr_t)&dpart, FREAD, ap->a_p) == 0) { vap->va_bytes = dbtob(dpart.disklab->d_partitions [minor(vp->v_rdev)].p_size); |