summaryrefslogtreecommitdiffstats
path: root/sys/vm
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/vm
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/vm')
-rw-r--r--sys/vm/vm_swap.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 7e9c6e2..10488d9 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.54 1998/06/25 11:28:07 phk Exp $
+ * $Id: vm_swap.c,v 1.55 1998/07/04 20:45:42 julian Exp $
*/
#include "opt_devfs.h"
@@ -68,15 +68,19 @@
* provided as a character (raw) device.
*/
-static void swstrategy __P((struct buf *));
+static d_strategy_t swstrategy;
+static d_read_t swread;
+static d_write_t swwrite;
#define CDEV_MAJOR 4
#define BDEV_MAJOR 26
-static struct cdevsw sw_cdevsw;
-static struct bdevsw sw_bdevsw =
- { noopen, noclose, swstrategy, noioc, /*1*/
- nodump, nopsize, 0, "sw", &sw_cdevsw, -1 };
+static struct cdevsw sw_cdevsw =
+ { nullopen, nullclose, swread, swwrite, /*4*/
+ noioc, nostop, noreset, nodevtotty,/* swap */
+ seltrue, nommap, swstrategy, "sw",
+ NULL, -1, nodump, nopsize,
+ 0, 0, -1};
static dev_t swapdev = makedev(BDEV_MAJOR, 0);
@@ -95,6 +99,18 @@ int nswap; /* first block after the interleaved devs */
static int nswdev = NSWAPDEV;
int vm_swap_size;
+static int
+swread(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(swstrategy, NULL, dev, 1, minphys, uio));
+}
+
+static int
+swwrite(dev_t dev, struct uio *uio, int ioflag)
+{
+ return (physio(swstrategy, NULL, dev, 0, minphys, uio));
+}
+
static void
swstrategy(bp)
register struct buf *bp;
@@ -308,7 +324,7 @@ static void sw_drvinit(void *unused)
{
if( ! sw_devsw_installed ) {
- bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &sw_bdevsw);
+ cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &sw_cdevsw);
/*
* XXX: This is pretty gross, but it will disappear with
* the blockdevices RSN.
OpenPOWER on IntegriCloud