aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
commitf7ea2f55d11712e31e448896b4d1bda81be24e35 (patch)
tree5b1d39937f11bc9995acb310c60d52bc73d652f8 /sys/geom
parent2c5174cba2eb6fd3fd2a06bc9dcff33c44649ed6 (diff)
downloadsrc-f7ea2f55d11712e31e448896b4d1bda81be24e35.tar.gz
src-f7ea2f55d11712e31e448896b4d1bda81be24e35.zip
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.
Notes
Notes: svn path=/head/; revision=37389
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_ccd.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index 29db7a3b63b4..28f912747c1f 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -1,4 +1,4 @@
-/* $Id: ccd.c,v 1.33 1998/06/07 17:09:41 dfr Exp $ */
+/* $Id: ccd.c,v 1.34 1998/07/04 20:45:29 julian Exp $ */
/* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */
@@ -165,6 +165,8 @@ struct ccdbuf {
(makedev(major((dev)), dkmakeminor(ccdunit((dev)), 0, RAW_PART)))
static d_open_t ccdopen;
+static d_read_t ccdread;
+static d_write_t ccdwrite;
static d_close_t ccdclose;
static d_strategy_t ccdstrategy;
static d_ioctl_t ccdioctl;
@@ -174,12 +176,12 @@ static d_psize_t ccdsize;
#define CDEV_MAJOR 74
#define BDEV_MAJOR 21
-static struct cdevsw ccd_cdevsw;
-static struct bdevsw ccd_bdevsw = {
- ccdopen, ccdclose, ccdstrategy, ccdioctl,
- ccddump, ccdsize, 0,
- "ccd", &ccd_cdevsw, -1
-};
+static struct cdevsw ccd_cdevsw = {
+ ccdopen, ccdclose, ccdread, ccdwrite,
+ ccdioctl, nostop, nullreset, nodevtotty,
+ seltrue, nommap, ccdstrategy, "ccd",
+ NULL, -1, ccddump, ccdsize,
+ D_DISK, 0, -1 };
/* Called by main() during pseudo-device attachment */
static void ccdattach __P((void *));
@@ -258,7 +260,7 @@ ccdattach(dummy)
ccddevs[i].ccd_dk = -1;
if( ! ccd_devsw_installed ) {
- bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &ccd_bdevsw);
+ cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &ccd_cdevsw);
ccd_devsw_installed = 1;
}
else {
@@ -697,6 +699,18 @@ ccdclose(dev, flags, fmt, p)
return (0);
}
+static int
+ccdread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(ccdstrategy, NULL, dev, 1, minphys, uio));
+}
+
+static int
+ccdwrite(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(ccdstrategy, NULL, dev, 0, minphys, uio));
+}
+
static void
ccdstrategy(bp)
register struct buf *bp;