summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
committerjulian <julian@FreeBSD.org>1998-07-04 22:30:26 +0000
commit0262543b5f83779b740399f4b8e107618d149997 (patch)
tree089ad4ebaec66b188dddc6918932d35b7dc8cb70 /sys/geom
parent29cbc265b1c33cbb4deb6416d04fc45ac6d03869 (diff)
downloadFreeBSD-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/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 29db7a3..28f9127 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;
OpenPOWER on IntegriCloud