summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
committerphk <phk@FreeBSD.org>1999-08-23 20:59:21 +0000
commit663cbe4fc26065f7af7d10faaee492a626156145 (patch)
tree32e619fadb473bfb85ff8e06044176f2ff323cce /sys/vm
parent2a5ff1f726f814a9e4717afe3f14250f8030cace (diff)
downloadFreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.zip
FreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.tar.gz
Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_swap.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 387cfeb..4f7592c 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -31,19 +31,15 @@
* SUCH DAMAGE.
*
* @(#)vm_swap.c 8.5 (Berkeley) 2/17/94
- * $Id: vm_swap.c,v 1.80 1999/08/08 18:43:05 phk Exp $
+ * $Id: vm_swap.c,v 1.81 1999/08/13 10:29:38 phk Exp $
*/
-#include "opt_devfs.h"
#include "opt_swap.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
#include <sys/buf.h>
-#ifdef DEVFS
-#include <sys/devfsext.h>
-#endif
#include <sys/proc.h>
#include <sys/namei.h>
#include <sys/dmap.h> /* XXX */
@@ -206,7 +202,12 @@ swapon(p, uap)
dev_t dev;
struct nameidata nd;
int error;
+ static int once;
+ if (!once) {
+ make_dev(&sw_cdevsw, 0, UID_ROOT, GID_KMEM, 0640, "drum");
+ once++;
+ }
error = suser(p);
if (error)
return (error);
@@ -356,31 +357,3 @@ swaponvp(p, vp, dev, nblks)
}
return (0);
}
-
-static int sw_devsw_installed;
-#ifdef DEVFS
-static void *drum_devfs_token;
-#endif
-
-static void sw_drvinit(void *unused)
-{
-
- if( ! sw_devsw_installed ) {
- cdevsw_add(&sw_cdevsw);
- /*
- * 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,
- UID_ROOT, GID_KMEM, 0640,
- "drum");
-#endif
- }
-}
-
-SYSINIT(swdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,sw_drvinit,NULL)
-
OpenPOWER on IntegriCloud