diff options
author | phk <phk@FreeBSD.org> | 2000-10-31 10:58:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-10-31 10:58:14 +0000 |
commit | fe76c75f16dddf8649fba8352e3ee3d68b8ae8d5 (patch) | |
tree | cf0dee9cd04095e0282623a76f28de0d85550119 /sys/kern/kern_conf.c | |
parent | 6730f602437dc350ef0cfade45ee7957bfe8ac9e (diff) | |
download | FreeBSD-src-fe76c75f16dddf8649fba8352e3ee3d68b8ae8d5.zip FreeBSD-src-fe76c75f16dddf8649fba8352e3ee3d68b8ae8d5.tar.gz |
Deprecate devsw->d_bmaj entirely.
This removes support for booting current kernels with very old bootblocks.
Device driver writers: Please remove initializations for the d_bmaj
field in your cdevsw{}.
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r-- | sys/kern/kern_conf.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index dfbca44..c715735 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -49,8 +49,6 @@ struct cdevsw *cdevsw[NUMCDEVSW]; -static int bmaj2cmaj[NUMCDEVSW]; - MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage"); /* @@ -94,28 +92,11 @@ cdevsw_add(struct cdevsw *newentry) int i; static int setup; - if (!setup) { - for (i = 0; i < NUMCDEVSW; i++) - if (!bmaj2cmaj[i]) - bmaj2cmaj[i] = 254; - setup++; - } - 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 (newentry->d_bmaj >= NUMCDEVSW) { - printf("%s: ERROR: driver has bogus cdevsw->d_bmaj = %d\n", - newentry->d_name, newentry->d_bmaj); - return (EINVAL); - } - if (newentry->d_bmaj >= 0 && (newentry->d_flags & D_DISK) == 0) { - printf("ERROR: \"%s\" bmaj but is not a disk\n", - newentry->d_name); - return (EINVAL); - } if (cdevsw[newentry->d_maj]) { printf("WARNING: \"%s\" is usurping \"%s\"'s cdevsw[]\n", @@ -124,15 +105,6 @@ cdevsw_add(struct cdevsw *newentry) cdevsw[newentry->d_maj] = newentry; - if (newentry->d_bmaj < 0) - return (0); - - if (bmaj2cmaj[newentry->d_bmaj] != 254) { - printf("WARNING: \"%s\" is usurping \"%s\"'s bmaj\n", - newentry->d_name, - cdevsw[bmaj2cmaj[newentry->d_bmaj]]->d_name); - } - bmaj2cmaj[newentry->d_bmaj] = newentry->d_maj; return (0); } @@ -151,9 +123,6 @@ cdevsw_remove(struct cdevsw *oldentry) cdevsw[oldentry->d_maj] = NULL; - if (oldentry->d_bmaj >= 0 && oldentry->d_bmaj < NUMCDEVSW) - bmaj2cmaj[oldentry->d_bmaj] = 254; - return 0; } @@ -195,15 +164,6 @@ unit2minor(int unit) return ((unit & 0xff) | ((unit << 8) & ~0xffff)); } -dev_t -makebdev(int x, int y) -{ - - if (x == umajor(NOUDEV) && y == uminor(NOUDEV)) - Debugger("makebdev of NOUDEV"); - return (makedev(bmaj2cmaj[x], y)); -} - static dev_t allocdev(void) { @@ -289,7 +249,7 @@ udev2dev(udev_t x, int b) case 0: return makedev(umajor(x), uminor(x)); case 1: - return makebdev(umajor(x), uminor(x)); + return (NODEV); default: Debugger("udev2dev(...,X)"); return NODEV; |