summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-29 21:54:03 +0000
committerphk <phk@FreeBSD.org>2003-01-29 21:54:03 +0000
commitc356612ab438b63965614d2bae7785140f0e8fa6 (patch)
tree5b70922e89ea088a07b913a2d60fbcc1258bc194 /sys/kern/kern_conf.c
parentc2913f770803fdf44256bed5a6a4ce324b1b2e38 (diff)
downloadFreeBSD-src-c356612ab438b63965614d2bae7785140f0e8fa6.zip
FreeBSD-src-c356612ab438b63965614d2bae7785140f0e8fa6.tar.gz
NODEVFS cleanup: Remove cdevsw[].
This implicitly removes the need for major numbers, but a number of drivers still know things they shouldn't need to, and we need to consider if there are applications which cache major(+minor) gleaned from stat(2) and rely on it being constant over reboots before we start assigning random majors.
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 3f453b8..dae75e7 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -40,10 +40,6 @@
#include <sys/ctype.h>
#include <machine/stdarg.h>
-#ifdef NODEVFS
-static struct cdevsw *cdevsw[NUMCDEVSW];
-
-#endif
static MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage");
/*
@@ -86,11 +82,7 @@ devsw(dev_t dev)
#endif
if (dev->si_devsw)
return (dev->si_devsw);
-#ifndef NODEVFS
return (NULL);
-#else
- return(cdevsw[major(dev)]);
-#endif
}
/*
@@ -100,20 +92,6 @@ devsw(dev_t dev)
int
cdevsw_add(struct cdevsw *newentry)
{
-#ifdef NODEVFS
- if (newentry->d_maj < 0 || newentry->d_maj >= NUMCDEVSW) {
- printf("%s: ERROR: driver has bogus cdevsw->d_maj = %d\n",
- newentry->d_name, newentry->d_maj);
- return (EINVAL);
- }
-
- if (cdevsw[newentry->d_maj]) {
- printf("WARNING: \"%s\" is usurping \"%s\"'s cdevsw[]\n",
- newentry->d_name, cdevsw[newentry->d_maj]->d_name);
- }
-
- cdevsw[newentry->d_maj] = newentry;
-#endif
return (0);
}
@@ -125,15 +103,6 @@ cdevsw_add(struct cdevsw *newentry)
int
cdevsw_remove(struct cdevsw *oldentry)
{
-#ifdef NODEVFS
- if (oldentry->d_maj < 0 || oldentry->d_maj >= NUMCDEVSW) {
- printf("%s: ERROR: driver has bogus cdevsw->d_maj = %d\n",
- oldentry->d_name, oldentry->d_maj);
- return EINVAL;
- }
-
- cdevsw[oldentry->d_maj] = NULL;
-#endif
return 0;
}
OpenPOWER on IntegriCloud