diff options
author | julian <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-07-04 22:30:26 +0000 |
commit | 0262543b5f83779b740399f4b8e107618d149997 (patch) | |
tree | 089ad4ebaec66b188dddc6918932d35b7dc8cb70 /sys/dev/vn | |
parent | 29cbc265b1c33cbb4deb6416d04fc45ac6d03869 (diff) | |
download | FreeBSD-src-0262543b5f83779b740399f4b8e107618d149997.zip FreeBSD-src-0262543b5f83779b740399f4b8e107618d149997.tar.gz |
There is no such thing any more as "struct bdevsw".
There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries. The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).
rawread()/rawwrite() went away as part of this though it's not strictly
the same patch, just that it involves all the same lines in the drivers.
cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.
Reviewed by: Eivind Eklund and Mike Smith
Changes suggested by eivind.
Diffstat (limited to 'sys/dev/vn')
-rw-r--r-- | sys/dev/vn/vn.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index b94fa90..5447824 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -38,7 +38,7 @@ * from: Utah Hdr: vn.c 1.13 94/04/02 * * from: @(#)vn.c 8.6 (Berkeley) 4/1/94 - * $Id: vn.c,v 1.62 1998/07/04 00:27:48 julian Exp $ + * $Id: vn.c,v 1.63 1998/07/04 20:45:29 julian Exp $ */ /* @@ -96,6 +96,8 @@ static d_ioctl_t vnioctl; #ifndef SLICE static d_open_t vnopen; +static d_read_t vnread; +static d_write_t vnwrite; static d_close_t vnclose; static d_dump_t vndump; static d_psize_t vnsize; @@ -103,10 +105,14 @@ static d_strategy_t vnstrategy; #define CDEV_MAJOR 43 #define BDEV_MAJOR 15 -static struct cdevsw vn_cdevsw; -static struct bdevsw vn_bdevsw = - { vnopen, vnclose, vnstrategy, vnioctl, /*15*/ - vndump, vnsize, D_DISK | D_NOCLUSTERRW, "vn", &vn_cdevsw, -1 }; + + +static struct cdevsw vn_cdevsw = { + vnopen, vnclose, vnread, vnwrite, + vnioctl, nostop, nullreset, nodevtotty, + seltrue, nommap, vnstrategy, "vn", + NULL, -1, vndump, vnsize, + D_DISK|D_NOCLUSTERRW, 0, -1 }; #else /* SLICE */ @@ -227,7 +233,7 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p) return (dsopen("vn", dev, mode, &vn->sc_slices, &label, vnstrategy, (ds_setgeom_t *)NULL, - &vn_bdevsw, &vn_cdevsw)); + &vn_cdevsw, &vn_cdevsw)); } if (dkslice(dev) != WHOLE_DISK_SLICE || dkpart(dev) != RAW_PART || @@ -237,6 +243,18 @@ vnopen(dev_t dev, int flags, int mode, struct proc *p) return(0); } +static int +vnread(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(vnstrategy, NULL, dev, 1, minphys, uio)); +} + +static int +vnwrite(dev_t dev, struct uio *uio, int ioflag) +{ + return (physio(vnstrategy, NULL, dev, 0, minphys, uio)); +} + /* * this code does I/O calls through the appropriate VOP entry point... * unless a swap_pager I/O request is being done. This strategy (-)) @@ -872,7 +890,7 @@ vn_drvinit(void *unused) printf("vn: could not install shutdown hook\n"); return; } - bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vn_bdevsw); + cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vn_cdevsw); vn_devsw_installed = 1; } #else /* SLICE */ |