summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_swap.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-06-25 11:28:07 +0000
committerphk <phk@FreeBSD.org>1998-06-25 11:28:07 +0000
commit267ffb24287e8a52277d710113748f6254f545c2 (patch)
tree5bf97c48eb0e17dddefe1678991c52e4219247a2 /sys/vm/vm_swap.c
parent110135302ea0559972139f374c917d6b8255a46b (diff)
downloadFreeBSD-src-267ffb24287e8a52277d710113748f6254f545c2.zip
FreeBSD-src-267ffb24287e8a52277d710113748f6254f545c2.tar.gz
Remove bdevsw_add(), change the only two users to use bdevsw_add_generic().
Extend cdevsw to be superset of bdevsw. Remove non-functional bdev lkm support. Teach wcd what the open() args mean.
Diffstat (limited to 'sys/vm/vm_swap.c')
-rw-r--r--sys/vm/vm_swap.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 48e6aa6..7189797 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.52 1998/02/19 12:15:06 msmith Exp $
+ * $Id: vm_swap.c,v 1.53 1998/02/23 08:22:44 dyson Exp $
*/
#include "opt_devfs.h"
@@ -72,18 +72,12 @@ static void swstrategy __P((struct buf *));
#define CDEV_MAJOR 4
#define BDEV_MAJOR 26
-extern struct cdevsw sw_cdevsw ;
+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, rawread, rawwrite, /*4*/
- noioc, nostop, noreset, nodevtotty,/* swap */
- seltrue, nommap, swstrategy, "sw",
- &sw_bdevsw, -1 };
-
static dev_t swapdev = makedev(BDEV_MAJOR, 0);
/*
@@ -312,13 +306,15 @@ static void *drum_devfs_token;
static void sw_drvinit(void *unused)
{
- dev_t dev;
if( ! sw_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&sw_cdevsw,NULL);
- dev = makedev(BDEV_MAJOR,0);
- bdevsw_add(&dev,&sw_bdevsw,NULL);
+ bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &sw_bdevsw);
+ /*
+ * XXX: This is pretty gross, but it will disappear with
+ * the blockdevices RSN.
+ */
+ sw_cdevsw.d_open = nullopen;
+ sw_cdevsw.d_close = nullclose;
sw_devsw_installed = 1;
#ifdef DEVFS
drum_devfs_token = devfs_add_devswf(&sw_cdevsw, 0, DV_CHR,
OpenPOWER on IntegriCloud