From owner-freebsd-audit Sun Jul 15 4:51:15 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 6699937B401; Sun, 15 Jul 2001 04:49:04 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 9D78C3E2F; Sun, 15 Jul 2001 04:49:03 -0700 (PDT) To: stable@freebsd.org, audit@freebsd.org Subject: Patch to remove most of DEVFS from -stable Date: Sun, 15 Jul 2001 04:49:03 -0700 From: Dima Dorfman Message-Id: <20010715114903.9D78C3E2F@bazooka.unixfreak.org> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG As previously discussed on -stable, I'l planning to remove the old, non-working DEVFS from RELENG_4. This is mostly so that people won't confuse the DEVFS stuff that's going on in -current with what's in -stable; the implementations are totally unrelated. Attached please find a patch that removes most of the devfs-related code from -stable. Actually, it only removes things that use or depend on devfs; the actual devfs implementation will be removed later. I've been running with this stuff for a while, but since it's going directly into -stable I don't plan to apply it for a week, perhaps more. Please test and review. Thanks, Dima Dorfman dima@unixfreak.org Index: etc/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/etc/Makefile,v retrieving revision 1.219.2.16 diff -u -r1.219.2.16 Makefile --- etc/Makefile 2001/06/04 14:58:44 1.219.2.16 +++ etc/Makefile 2001/07/04 23:18:36 @@ -12,7 +12,7 @@ inetd.conf login.access login.conf \ motd modems networks newsyslog.conf \ pam.conf phones printcap profile protocols \ - rc rc.atm rc.devfs rc.diskless1 rc.diskless2 rc.firewall rc.firewall6 \ + rc rc.atm rc.diskless1 rc.diskless2 rc.firewall rc.firewall6 \ rc.isdn rc.network rc.network6 rc.pccard rc.serial rc.shutdown \ rc.syscons rc.sysctl remote rpc security services shells syslog.conf \ usbd.conf \ Index: etc/rc.diskless2 =================================================================== RCS file: /stl/src/FreeBSD/src/etc/rc.diskless2,v retrieving revision 1.5.2.7 diff -u -r1.5.2.7 rc.diskless2 --- etc/rc.diskless2 2001/05/11 17:46:57 1.5.2.7 +++ etc/rc.diskless2 2001/07/04 23:18:36 @@ -76,12 +76,7 @@ mount_md ${tmpsize:=20480} /tmp 2 fi -if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then - # we have DEVFS, no worries... - true -else - # extract a list of device entries, then copy them to a writable fs - (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp - mount_md 4096 /dev 3 512 - (cd /; cpio -i -H newc -d < /tmp/dev.tmp) -fi +# extract a list of device entries, then copy them to a writable fs +(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp +mount_md 4096 /dev 3 512 +(cd /; cpio -i -H newc -d < /tmp/dev.tmp) Index: sbin/init/init.c =================================================================== RCS file: /stl/src/FreeBSD/src/sbin/init/init.c,v retrieving revision 1.38.2.4 diff -u -r1.38.2.4 init.c --- sbin/init/init.c 2001/05/22 22:57:56 1.38.2.4 +++ sbin/init/init.c 2001/07/04 23:19:53 @@ -134,8 +134,6 @@ int Reboot = FALSE; int howto = RB_AUTOBOOT; -int devfs; - void transition __P((state_t)); state_t requested_transition = runcom; @@ -264,11 +262,8 @@ * This code assumes that we always get arguments through flags, * never through bits set in some random machine register. */ - while ((c = getopt(argc, argv, "dsf")) != -1) + while ((c = getopt(argc, argv, "sf")) != -1) switch (c) { - case 'd': - devfs = 1; - break; case 's': requested_transition = single_user; break; @@ -282,10 +277,6 @@ if (optind != argc) warning("ignoring excess arguments"); - - if (devfs) { - mount("devfs", _PATH_DEV, MNT_NOEXEC|MNT_RDONLY, 0); - } /* * We catch or block signals rather than ignore them, Index: sbin/mount/mount.8 =================================================================== RCS file: /stl/src/FreeBSD/src/sbin/mount/mount.8,v retrieving revision 1.31.2.5 diff -u -r1.31.2.5 mount.8 --- sbin/mount/mount.8 2001/03/05 19:33:45 1.31.2.5 +++ sbin/mount/mount.8 2001/07/04 23:19:53 @@ -369,7 +369,6 @@ .Xr fstab 5 , .Xr kldload 8 , .Xr mount_cd9660 8 , -.Xr mount_devfs 8 , .Xr mount_fdesc 8 , .Xr mount_kernfs 8 , .Xr mount_mfs 8 , Index: sbin/mount_std/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sbin/mount_std/Makefile,v retrieving revision 1.4.6.2 diff -u -r1.4.6.2 Makefile --- sbin/mount_std/Makefile 2001/04/25 10:58:39 1.4.6.2 +++ sbin/mount_std/Makefile 2001/07/04 23:19:53 @@ -4,7 +4,7 @@ PROG= mount_std SRCS= mount_std.c getmntopts.c MAN= mount_std.8 -MLINKS= mount_std.8 mount_devfs.8 mount_std.8 mount_fdesc.8 \ +MLINKS= mount_std.8 mount_fdesc.8 \ mount_std.8 mount_kernfs.8 mount_std.8 mount_linprocfs.8 \ mount_std.8 mount_procfs.8 @@ -12,8 +12,7 @@ CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} -LINKS= ${BINDIR}/mount_std ${BINDIR}/mount_devfs \ - ${BINDIR}/mount_std ${BINDIR}/mount_fdesc \ +LINKS= ${BINDIR}/mount_std ${BINDIR}/mount_fdesc \ ${BINDIR}/mount_std ${BINDIR}/mount_kernfs \ ${BINDIR}/mount_std ${BINDIR}/mount_linprocfs \ ${BINDIR}/mount_std ${BINDIR}/mount_procfs Index: sbin/mount_std/mount_std.8 =================================================================== RCS file: /stl/src/FreeBSD/src/sbin/mount_std/mount_std.8,v retrieving revision 1.9.2.3 diff -u -r1.9.2.3 mount_std.8 --- sbin/mount_std/mount_std.8 2000/12/14 12:12:32 1.9.2.3 +++ sbin/mount_std/mount_std.8 2001/07/04 23:19:53 @@ -41,7 +41,6 @@ .Os FreeBSD .Sh NAME .Nm mount_std , -.Nm mount_devfs , .Nm mount_fdesc , .Nm mount_kernfs , .Nm mount_linprocfs , @@ -59,7 +58,6 @@ the filesystem. The .Nm command currently supports the following filesystems: -.Nm devfs , .Nm fdesc , .Nm kernfs , .Nm linprocfs @@ -120,7 +118,6 @@ .Pp Refer to the following manual pages for detailed information on these file system: -.Xr devfs 5 , .Xr fdesc 5 , .Xr kernfs 5 , .Xr linprocfs 5 @@ -144,7 +141,6 @@ .Xr mount 2 , .Xr unmount 2 , .Xr getvfsbyname 3 , -.Xr devfs 5 , .Xr fdesc 5 , .Xr fstab 5 , .Xr kernfs 5 , @@ -167,10 +163,6 @@ .Dq procfs filesystem types first appeared in .Fx 2.0 ; -the -.Dq devfs -filesystem type first appeared in -.Fx 2.2 ; the .Dq linprocfs filesystem type first appeared in Index: share/man/man4/intro.4 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man4/intro.4,v retrieving revision 1.13.2.2 diff -u -r1.13.2.2 intro.4 --- share/man/man4/intro.4 2000/12/14 12:14:29 1.13.2.2 +++ share/man/man4/intro.4 2001/07/04 23:20:16 @@ -72,9 +72,7 @@ in the file system hierarchy .Pq see also Xr hier 7 . .Pp -Until -.Xr devfs 5 -is fully functional, each device node must be created statically and +Each device node must be created statically and independently of the existence of the associated device driver, usually by running .Xr MAKEDEV 8 . @@ -160,7 +158,6 @@ .Xr select 2 , .Xr socket 2 , .Xr write 2 , -.Xr devfs 5 , .Xr hier 7 , .Xr config 8 , .Xr MAKEDEV 8 Index: share/man/man4/psm.4 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man4/psm.4,v retrieving revision 1.24.2.4 diff -u -r1.24.2.4 psm.4 --- share/man/man4/psm.4 2001/03/06 19:08:11 1.24.2.4 +++ share/man/man4/psm.4 2001/07/04 23:20:16 @@ -618,8 +618,7 @@ .It Pa /dev/psm0 `non-blocking' device node .It Pa /dev/bpsm0 -`blocking' device node under -.Em devfs . +`blocking' device node .El .Sh EXAMPLES .Dl "device psm0 at atkbdc? irq 12 flags 0x2000" Index: share/man/man4/man4.i386/mse.4 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man4/man4.i386/mse.4,v retrieving revision 1.10.2.1 diff -u -r1.10.2.1 mse.4 --- share/man/man4/man4.i386/mse.4 2000/12/08 14:59:14 1.10.2.1 +++ share/man/man4/man4.i386/mse.4 2001/07/04 23:20:17 @@ -330,13 +330,9 @@ .Sh FILES .Bl -tag -width /dev/nmse0 -compact .It Pa /dev/mse0 -`non-blocking' device node in the system without -.Em devfs , -`blocking' under -.Em devfs . +`non-blocking' device node .It Pa /dev/nmse0 -`non-blocking' device node under -.Em devfs . +`non-blocking' device node .El .Sh EXAMPLES .Dl "device mse0 at isa? port 0x23c irq 5" Index: share/man/man9/DEVICE_ATTACH.9 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man9/DEVICE_ATTACH.9,v retrieving revision 1.3 diff -u -r1.3 DEVICE_ATTACH.9 --- share/man/man9/DEVICE_ATTACH.9 1999/08/28 00:21:05 1.3 +++ share/man/man9/DEVICE_ATTACH.9 2001/07/04 23:20:17 @@ -44,7 +44,8 @@ Attach a device to the system. The probe method will have been called and will have indicated that the device exists. This routine should initialise the hardware and allocate other system resources (such as -devfs entries). +.Pa /dev +entries). .Sh RETURN VALUES Zero is returned on success, otherwise an appropriate error is returned. .Sh SEE ALSO Index: share/man/man9/make_dev.9 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man9/make_dev.9,v retrieving revision 1.2 diff -u -r1.2 make_dev.9 --- share/man/man9/make_dev.9 1999/12/23 17:16:31 1.2 +++ share/man/man9/make_dev.9 2001/07/04 23:20:17 @@ -30,7 +30,7 @@ .Sh NAME .Nm make_dev , .Nm destroy_dev -.Nd "Create or destroy dev_t and devfs registration for a new device" +.Nd "Create or destroy dev_t for a new device" .Sh SYNOPSIS .Fd #include .Fd #include @@ -43,8 +43,8 @@ .Fn make_dev function creates a .Fa dev_t -structure for a new device. If DEVFS is available, it is also notified of -the presence of the new device. The device will be owned by +structure for a new device. +The device will be owned by .Va uid , with the group ownership as .Va gid , Index: share/man/man9/vnode.9 =================================================================== RCS file: /stl/src/FreeBSD/src/share/man/man9/vnode.9,v retrieving revision 1.10.2.1 diff -u -r1.10.2.1 vnode.9 --- share/man/man9/vnode.9 2000/12/29 10:18:08 1.10.2.1 +++ share/man/man9/vnode.9 2001/07/04 23:20:17 @@ -52,7 +52,7 @@ enum vtagtype { VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_PC, VT_LFS, VT_LOFS, VT_FDESC, VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS, - VT_UNION, VT_MSDOSFS, VT_DEVFS, VT_TFS, VT_VFS, VT_CODA, VT_NTFS + VT_UNION, VT_MSDOSFS, VT_TFS, VT_VFS, VT_CODA, VT_NTFS }; /* Index: sys/conf/files =================================================================== RCS file: /stl/src/FreeBSD/src/sys/conf/files,v retrieving revision 1.340.2.63 diff -u -r1.340.2.63 files --- sys/conf/files 2001/06/20 06:12:51 1.340.2.63 +++ sys/conf/files 2001/07/04 23:20:26 @@ -589,9 +589,6 @@ kern/kern_threads.c standard kern/vfs_aio.c standard miscfs/deadfs/dead_vnops.c standard -miscfs/devfs/devfs_tree.c optional devfs -miscfs/devfs/devfs_vfsops.c optional devfs -miscfs/devfs/devfs_vnops.c optional devfs miscfs/fdesc/fdesc_vfsops.c optional fdesc miscfs/fdesc/fdesc_vnops.c optional fdesc miscfs/fifofs/fifo_vnops.c standard Index: sys/conf/options =================================================================== RCS file: /stl/src/FreeBSD/src/sys/conf/options,v retrieving revision 1.191.2.27 diff -u -r1.191.2.27 options --- sys/conf/options 2001/06/09 16:18:10 1.191.2.27 +++ sys/conf/options 2001/07/04 23:20:26 @@ -63,7 +63,6 @@ DDB DDB_UNATTENDED opt_ddb.h GDB_REMOTE_CHAT opt_ddb.h -DEVFS HW_WDOG KTRACE LIBICONV Index: sys/i4b/driver/i4b_ctl.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/i4b/driver/i4b_ctl.c,v retrieving revision 1.10 diff -u -r1.10 i4b_ctl.c --- sys/i4b/driver/i4b_ctl.c 1999/12/14 20:48:12 1.10 +++ sys/i4b/driver/i4b_ctl.c 2001/07/04 23:20:39 @@ -62,18 +62,6 @@ #include #ifdef __FreeBSD__ - -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - -#endif /* __FreeBSD__ */ - -#ifdef __FreeBSD__ #include #include #elif defined(__bsdi__) @@ -137,12 +125,6 @@ #define PDEVSTATIC static #endif /* __FreeBSD__ */ -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#ifdef DEVFS -static void *devfs_token; -#endif -#endif - #ifndef __FreeBSD__ #define PDEVSTATIC /* */ void i4bctlattach __P((void)); @@ -217,17 +199,7 @@ #endif #if defined(__FreeBSD__) -#if __FreeBSD__ == 3 - -#ifdef DEVFS - devfs_token = devfs_add_devswf(&i4bctl_cdevsw, 0, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4bctl"); -#endif - -#else make_dev(&i4bctl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4bctl"); -#endif #endif } Index: sys/i4b/driver/i4b_rbch.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/i4b/driver/i4b_rbch.c,v retrieving revision 1.10 diff -u -r1.10 i4b_rbch.c --- sys/i4b/driver/i4b_rbch.c 1999/12/14 20:48:13 1.10 +++ sys/i4b/driver/i4b_rbch.c 2001/07/04 23:20:39 @@ -56,18 +56,6 @@ #define termioschars(t) memcpy((t)->c_cc, &ttydefchars, sizeof((t)->c_cc)) #endif -#ifdef __FreeBSD__ - -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - -#endif /* __FreeBSD__ */ - #ifdef __NetBSD__ #include #define bootverbose 0 @@ -136,12 +124,6 @@ struct selinfo selp; /* select / poll */ -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#ifdef DEVFS - void *devfs_token; /* device filesystem */ -#endif -#endif - #if I4BRBCHACCT #if defined(__FreeBSD__) struct callout_handle sc_callout; @@ -296,19 +278,8 @@ for(i=0; i < NI4BRBCH; i++) { #if defined(__FreeBSD__) -#if __FreeBSD__ == 3 - -#ifdef DEVFS - rbch_softc[i].devfs_token = - devfs_add_devswf(&i4brbch_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4brbch%d", i); -#endif - -#else make_dev(&i4brbch_cdevsw, i, UID_ROOT, GID_WHEEL, 0600, "i4brbch%d", i); -#endif #endif #if I4BRBCHACCT Index: sys/i4b/driver/i4b_tel.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/i4b/driver/i4b_tel.c,v retrieving revision 1.10 diff -u -r1.10 i4b_tel.c --- sys/i4b/driver/i4b_tel.c 1999/12/14 20:48:13 1.10 +++ sys/i4b/driver/i4b_tel.c 2001/07/04 23:20:40 @@ -61,18 +61,6 @@ #include #include -#ifdef __FreeBSD__ - -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - -#endif /* __FreeBSD__ */ - #ifdef __bsdi__ #include #endif @@ -136,13 +124,6 @@ #define ST_WRWAITEMPTY 0x08 /* userland write waiting */ struct selinfo selp; /* select / poll */ - -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#ifdef DEVFS - void *devfs_token; /* token for DEVFS */ -#endif -#endif - } tel_sc_t; static tel_sc_t tel_sc[NI4BTEL][NOFUNCS]; @@ -316,17 +297,6 @@ tel_sc[i][j].result = 0; #if defined(__FreeBSD__) -#if __FreeBSD__ == 3 - -#ifdef DEVFS - -/* XXX */ tel_sc[i][j].devfs_token - = devfs_add_devswf(&i4btel_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4btel%d", i); -#endif - -#else switch(j) { case FUNCTEL: /* normal i4btel device */ @@ -341,7 +311,6 @@ 0600, "i4bteld%d", i); break; } -#endif #endif } tel_init_linktab(i); Index: sys/i4b/driver/i4b_trace.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/i4b/driver/i4b_trace.c,v retrieving revision 1.9 diff -u -r1.9 i4b_trace.c --- sys/i4b/driver/i4b_trace.c 1999/12/14 20:48:13 1.9 +++ sys/i4b/driver/i4b_trace.c 2001/07/04 23:20:40 @@ -72,10 +72,6 @@ #ifdef __FreeBSD__ -#ifdef DEVFS -#include -#endif - #include #include @@ -100,12 +96,6 @@ #define ST_ISOPEN 0x01 #define ST_WAITDATA 0x02 -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#ifdef DEVFS -static void *devfs_token[NI4BTRC]; -#endif -#endif - static int analyzemode = 0; static int rxunit = -1; static int txunit = -1; @@ -242,19 +232,8 @@ { #if defined(__FreeBSD__) -#if __FreeBSD__ < 4 - -#ifdef DEVFS - devfs_token[i] - = devfs_add_devswf(&i4btrc_cdevsw, i, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4btrc%d", i); -#endif - -#else make_dev(&i4btrc_cdevsw, i, UID_ROOT, GID_WHEEL, 0600, "i4btrc%d", i); -#endif #endif trace_queue[i].ifq_maxlen = IFQ_MAXLEN; device_state[i] = ST_IDLE; Index: sys/i4b/layer4/i4b_i4bdrv.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/i4b/layer4/i4b_i4bdrv.c,v retrieving revision 1.11 diff -u -r1.11 i4b_i4bdrv.c --- sys/i4b/layer4/i4b_i4bdrv.c 1999/12/14 20:48:34 1.11 +++ sys/i4b/layer4/i4b_i4bdrv.c 2001/07/04 23:20:40 @@ -72,18 +72,6 @@ #include #ifdef __FreeBSD__ - -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#include "opt_devfs.h" -#endif - -#ifdef DEVFS -#include -#endif - -#endif /* __FreeBSD__*/ - -#ifdef __FreeBSD__ #include #include #include @@ -110,12 +98,6 @@ static int selflag = 0; static int readflag = 0; -#if defined(__FreeBSD__) && __FreeBSD__ == 3 -#ifdef DEVFS -static void *devfs_token; -#endif -#endif - #ifndef __FreeBSD__ #define PDEVSTATIC /* - not static - */ @@ -253,17 +235,7 @@ i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN; #if defined(__FreeBSD__) -#if __FreeBSD__ == 3 - -#ifdef DEVFS - devfs_token = devfs_add_devswf(&i4b_cdevsw, 0, DV_CHR, - UID_ROOT, GID_WHEEL, 0600, - "i4b"); -#endif - -#else make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b"); -#endif #endif } Index: sys/kern/Make.tags.inc =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/Make.tags.inc,v retrieving revision 1.6 diff -u -r1.6 Make.tags.inc --- sys/kern/Make.tags.inc 2000/01/27 01:21:58 1.6 +++ sys/kern/Make.tags.inc 2001/07/04 23:20:40 @@ -32,7 +32,6 @@ ${SYS}/isofs/cd9660/*.[ch] \ ${SYS}/kern/*.[ch] \ ${SYS}/miscfs/deadfs/*.[ch] \ - ${SYS}/miscfs/devfs/*.[ch] \ ${SYS}/miscfs/fdesc/*.[ch] \ ${SYS}/miscfs/fifofs/*.[ch] \ ${SYS}/miscfs/kernfs/*.[ch] \ @@ -97,7 +96,6 @@ ${SYS}/dev/vx \ ${SYS}/isofs/cd9660 \ ${SYS}/miscfs/deadfs \ - ${SYS}/miscfs/devfs \ ${SYS}/miscfs/fdesc \ ${SYS}/miscfs/fifofs \ ${SYS}/miscfs/kernfs \ Index: sys/kern/device_if.m =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/device_if.m,v retrieving revision 1.7 diff -u -r1.7 device_if.m --- sys/kern/device_if.m 1999/08/28 00:46:09 1.7 +++ sys/kern/device_if.m 2001/07/04 23:20:40 @@ -86,8 +86,8 @@ # # Attach a device to the system. The probe method will have been # called and will have indicated that the device exists. This routine -# should initialise the hardware and allocate other system resources -# (such as devfs entries). Returns 0 on success. +# should initialise the hardware and allocate other system resources. +# Returns 0 on success. # METHOD int attach { device_t dev; Index: sys/kern/kern_conf.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/kern_conf.c,v retrieving revision 1.73 diff -u -r1.73 kern_conf.c --- sys/kern/kern_conf.c 2000/01/23 15:47:46 1.73 +++ sys/kern/kern_conf.c 2001/07/04 23:20:40 @@ -68,9 +68,6 @@ static LIST_HEAD(, specinfo) dev_free; -devfs_create_t *devfs_create_hook; -devfs_remove_t *devfs_remove_hook; - static int free_devt; SYSCTL_INT(_debug, OID_AUTO, free_devt, CTLFLAG_RW, &free_devt, 0, ""); @@ -305,16 +302,12 @@ va_end(ap); dev->si_devsw = devsw; - if (devfs_create_hook) - devfs_create_hook(dev, uid, gid, perms); return (dev); } void destroy_dev(dev_t dev) { - if (devfs_remove_hook) - devfs_remove_hook(dev); dev->si_drv1 = 0; dev->si_drv2 = 0; dev->si_devsw = 0; Index: sys/kern/subr_diskslice.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/subr_diskslice.c,v retrieving revision 1.82.2.5 diff -u -r1.82.2.5 subr_diskslice.c --- sys/kern/subr_diskslice.c 2001/03/05 13:09:01 1.82.2.5 +++ sys/kern/subr_diskslice.c 2001/07/04 23:20:40 @@ -46,15 +46,10 @@ * $FreeBSD: src/sys/kern/subr_diskslice.c,v 1.82.2.5 2001/03/05 13:09:01 obrien Exp $ */ -#include "opt_devfs.h" - #include #include #include #include -#ifdef DEVFS -#include -#endif #include #include #include @@ -76,17 +71,11 @@ static char *fixlabel __P((char *sname, struct diskslice *sp, struct disklabel *lp, int writeflag)); static void free_ds_label __P((struct diskslices *ssp, int slice)); -#ifdef DEVFS -static void free_ds_labeldevs __P((struct diskslices *ssp, int slice)); -#endif static void partition_info __P((char *sname, int part, struct partition *pp)); static void slice_info __P((char *sname, struct diskslice *sp)); static void set_ds_label __P((struct diskslices *ssp, int slice, struct disklabel *lp)); static void set_ds_labeldevs __P((dev_t dev, struct diskslices *ssp)); -#ifdef DEVFS -static void set_ds_labeldevs_unaliased __P((dev_t dev, struct diskslices *ssp)); -#endif static void set_ds_wlabel __P((struct diskslices *ssp, int slice, int wlabel)); @@ -334,10 +323,6 @@ for (slice = 0, ssp = *sspp; slice < ssp->dss_nslices; slice++) { sp = &ssp->dss_slices[slice]; -#ifdef DEVFS - if (sp->ds_dev != NULL) - devfs_remove_dev(sp->ds_dev); -#endif free_ds_label(ssp, slice); } free(ssp, M_DEVBUF); @@ -517,16 +502,13 @@ S_IFCHR, ssp->dss_oflags, sspp, lp); if (error != 0) { - /* XXX should free devfs toks. */ free(lp, M_DEVBUF); - /* XXX should restore devfs toks. */ *sspp = ssp; return (EBUSY); } } } - /* XXX devfs tokens? */ free(lp, M_DEVBUF); dsgone(&ssp); return (0); @@ -675,9 +657,6 @@ struct disklabel *lp1; char *msg; u_char mask; -#ifdef DEVFS - int mynor; -#endif bool_t need_init; int part; char partname[2]; @@ -752,7 +731,7 @@ /* * Initialize secondary info for all slices. It is needed for more - * than the current slice in the DEVFS case. + * than the current slice in the DEVFS case. XXX DEVFS is no more. */ for (slice = 0; slice < ssp->dss_nslices; slice++) { sp = &ssp->dss_slices[slice]; @@ -764,16 +743,6 @@ continue; dev1 = dkmodslice(dkmodpart(dev, RAW_PART), slice); sname = dsname(dev, unit, slice, RAW_PART, partname); -#ifdef DEVFS - if (slice != COMPATIBILITY_SLICE && sp->ds_dev == NULL - && sp->ds_size != 0) { - mynor = minor(dev1); - sp->ds_dev = - devfs_add_devswf(devsw(dev1), mynor, DV_CHR, - UID_ROOT, GID_OPERATOR, 0640, - "r%s", sname); - } -#endif /* * XXX this should probably only be done for the need_init * case, but there may be a problem with DIOCSYNCSLICEINFO. @@ -879,40 +848,10 @@ lp = sp->ds_label; if (lp == NULL) return; -#ifdef DEVFS - free_ds_labeldevs(ssp, slice); - if (slice == COMPATIBILITY_SLICE) - free_ds_labeldevs(ssp, ssp->dss_first_bsd_slice); - else if (slice == ssp->dss_first_bsd_slice) - free_ds_labeldevs(ssp, COMPATIBILITY_SLICE); -#endif free(lp, M_DEVBUF); set_ds_label(ssp, slice, (struct disklabel *)NULL); } -#ifdef DEVFS -static void -free_ds_labeldevs(ssp, slice) - struct diskslices *ssp; - int slice; -{ - struct disklabel *lp; - int part; - struct diskslice *sp; - - sp = &ssp->dss_slices[slice]; - lp = sp->ds_label; - if (lp == NULL) - return; - for (part = 0; part < lp->d_npartitions; part++) { - if (sp->ds_devs[part] != NULL) { - devfs_remove_dev(sp->ds_devs[part]); - sp->ds_devs[part] = NULL; - } - } -} -#endif - static char * fixlabel(sname, sp, lp, writeflag) char *sname; @@ -1032,66 +971,13 @@ ssp->dss_slices[COMPATIBILITY_SLICE].ds_label = lp; } +/* XXX remove this? */ static void set_ds_labeldevs(dev, ssp) dev_t dev; struct diskslices *ssp; { -#ifdef DEVFS - int slice; - - set_ds_labeldevs_unaliased(dev, ssp); - if (ssp->dss_first_bsd_slice == COMPATIBILITY_SLICE) - return; - slice = dkslice(dev); - if (slice == COMPATIBILITY_SLICE) - set_ds_labeldevs_unaliased( - dkmodslice(dev, ssp->dss_first_bsd_slice), ssp); - else if (slice == ssp->dss_first_bsd_slice) - set_ds_labeldevs_unaliased( - dkmodslice(dev, COMPATIBILITY_SLICE), ssp); -#endif /* DEVFS */ -} - -#ifdef DEVFS -static void -set_ds_labeldevs_unaliased(dev, ssp) - dev_t dev; - struct diskslices *ssp; -{ - struct disklabel *lp; - int mynor; - int part; - char partname[2]; - struct partition *pp; - int slice; - char *sname; - struct diskslice *sp; - - slice = dkslice(dev); - sp = &ssp->dss_slices[slice]; - if (sp->ds_size == 0) - return; - lp = sp->ds_label; - for (part = 0; part < lp->d_npartitions; part++) { - pp = &lp->d_partitions[part]; - if (pp->p_size == 0) - continue; - sname = dsname(dev, dkunit(dev), slice, part, partname); - if (part == RAW_PART && sp->ds_dev != NULL) { - sp->ds_devs[part] = - devfs_makelink(sp->ds_dev, - "r%s%s", sname, partname); - } else { - mynor = minor(dkmodpart(dev, part)); - sp->ds_devs[part] = - devfs_add_devswf(devsw(dev), mynor, DV_CHR, - UID_ROOT, GID_OPERATOR, 0640, - "r%s%s", sname, partname); - } - } } -#endif /* DEVFS */ static void set_ds_wlabel(ssp, slice, wlabel) Index: sys/kern/tty_pty.c =================================================================== RCS file: /stl/src/FreeBSD/src/sys/kern/tty_pty.c,v retrieving revision 1.74.2.2 diff -u -r1.74.2.2 tty_pty.c --- sys/kern/tty_pty.c 2001/06/11 09:08:52 1.74.2.2 +++ sys/kern/tty_pty.c 2001/07/04 23:20:41 @@ -178,6 +178,7 @@ /* * XXX: Gross hack for DEVFS: + * XXX: DEVFS is no more, should this be removed? * If we openned this device, ensure we have the * next one too, so people can open it. */ @@ -826,6 +827,7 @@ cdevsw_add(&pts_cdevsw); cdevsw_add(&ptc_cdevsw); /* XXX: Gross hack for DEVFS */ + /* XXX: DEVFS is no more, should this be removed? */ ptyinit(0); } Index: sys/modules/coda/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sys/modules/coda/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- sys/modules/coda/Makefile 1999/12/12 16:47:23 1.7 +++ sys/modules/coda/Makefile 2001/07/04 23:20:45 @@ -4,7 +4,7 @@ KMOD= coda SRCS= vnode_if.h \ coda_fbsd.c coda_namecache.c coda_psdev.c coda_subr.c \ - coda_venus.c coda_vfsops.c coda_vnops.c opt_devfs.h vcoda.h + coda_venus.c coda_vfsops.c coda_vnops.c vcoda.h NOMAN= CLEANFILES= vcoda.h Index: sys/modules/if_tap/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sys/modules/if_tap/Makefile,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 Makefile --- sys/modules/if_tap/Makefile 2000/07/27 13:57:05 1.1.2.1 +++ sys/modules/if_tap/Makefile 2001/07/04 23:20:45 @@ -7,9 +7,9 @@ .PATH: ${.CURDIR}/../../net KMOD= if_tap -SRCS= if_tap.c opt_devfs.h opt_inet.h vnode_if.h +SRCS= if_tap.c opt_inet.h vnode_if.h -CLEANFILES+= opt_devfs.h opt_inet.h vnode_if.h +CLEANFILES+= opt_inet.h vnode_if.h opt_inet.h: echo "#define INET 1" > opt_inet.h Index: sys/modules/if_tun/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sys/modules/if_tun/Makefile,v retrieving revision 1.19 diff -u -r1.19 Makefile --- sys/modules/if_tun/Makefile 2000/01/29 01:11:03 1.19 +++ sys/modules/if_tun/Makefile 2001/07/04 23:20:45 @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_tun -SRCS= if_tun.c opt_devfs.h opt_inet.h vnode_if.h +SRCS= if_tun.c opt_inet.h vnode_if.h NOMAN= NBPF?= 1 Index: sys/modules/streams/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sys/modules/streams/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- sys/modules/streams/Makefile 1999/11/28 18:53:23 1.4 +++ sys/modules/streams/Makefile 2001/07/04 23:20:53 @@ -7,7 +7,7 @@ .PATH: ${.CURDIR}/../../dev/streams KMOD= streams -SRCS= streams.c opt_streams.h opt_devfs.h +SRCS= streams.c opt_streams.h NOMAN= Index: sys/modules/vn/Makefile =================================================================== RCS file: /stl/src/FreeBSD/src/sys/modules/vn/Attic/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- sys/modules/vn/Makefile 1999/11/28 18:53:42 1.5 +++ sys/modules/vn/Makefile 2001/07/04 23:20:58 @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../dev/vn KMOD= vn -SRCS= vn.c vnode_if.h opt_devfs.h +SRCS= vn.c vnode_if.h NOMAN= .include Index: sys/sys/conf.h =================================================================== RCS file: /stl/src/FreeBSD/src/sys/sys/conf.h,v retrieving revision 1.103.2.1 diff -u -r1.103.2.1 conf.h --- sys/sys/conf.h 2001/02/26 04:23:21 1.103.2.1 +++ sys/sys/conf.h 2001/07/04 23:20:58 @@ -59,8 +59,6 @@ char si_name[SPECNAMELEN + 1]; void *si_drv1, *si_drv2; struct cdevsw *si_devsw; - void *si_devfs; /* save cookie for devfs operations */ - void *si_bdevfs; /* XXX block device (should go away) */ int si_iosize_max; /* maximum I/O size (for physio &al) */ union { struct { @@ -127,10 +125,6 @@ typedef int l_start_t __P((struct tty *tp)); typedef int l_modem_t __P((struct tty *tp, int flag)); -/* This is type of the function DEVFS uses to hook into the kernel with */ -typedef void devfs_create_t __P((dev_t dev, uid_t uid, gid_t gid, int perms)); -typedef void devfs_remove_t __P((dev_t dev)); - /* * XXX: The dummy argument can be used to do what strategy1() never * did anywhere: Create a per device flag to lock the device during @@ -274,8 +268,6 @@ dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, char *fmt, ...)) __printflike(6, 7); int lminor __P((dev_t dev)); void setconf __P((void)); - -extern devfs_create_t *devfs_create_hook; /* * XXX: This included for when DEVFS resurfaces Index: sys/sys/kernel.h =================================================================== RCS file: /stl/src/FreeBSD/src/sys/sys/kernel.h,v retrieving revision 1.63.2.1 diff -u -r1.63.2.1 kernel.h --- sys/sys/kernel.h 2001/06/15 09:37:43 1.63.2.1 +++ sys/sys/kernel.h 2001/07/04 23:20:58 @@ -119,7 +119,6 @@ SI_SUB_VM_CONF = 0x2300000, /* config VM, set limits*/ SI_SUB_RUN_QUEUE = 0x2400000, /* the run queue*/ SI_SUB_CREATE_INIT = 0x2500000, /* create the init process */ - SI_SUB_DEVFS = 0x3000000, /* get DEVFS ready */ SI_SUB_DRIVERS = 0x3100000, /* Let Drivers initialize */ SI_SUB_CONFIGURE = 0x3800000, /* Configure devices */ SI_SUB_VFS = 0x4000000, /* virtual file system*/ Index: sys/sys/vnode.h =================================================================== RCS file: /stl/src/FreeBSD/src/sys/sys/vnode.h,v retrieving revision 1.111.2.8 diff -u -r1.111.2.8 vnode.h --- sys/sys/vnode.h 2001/06/03 05:00:10 1.111.2.8 +++ sys/sys/vnode.h 2001/07/04 23:21:01 @@ -63,7 +63,7 @@ enum vtagtype { VT_NON, VT_UFS, VT_NFS, VT_MFS, VT_PC, VT_LFS, VT_LOFS, VT_FDESC, VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS, - VT_UNION, VT_MSDOSFS, VT_DEVFS, VT_TFS, VT_VFS, VT_CODA, VT_NTFS, + VT_UNION, VT_MSDOSFS, VT_TFS, VT_VFS, VT_CODA, VT_NTFS, VT_HPFS, VT_NWFS, VT_SMBFS }; @@ -427,8 +427,7 @@ || (vp)->v_tag == VT_NFS \ || (vp)->v_tag == VT_LFS \ || (vp)->v_tag == VT_ISOFS \ - || (vp)->v_tag == VT_MSDOSFS \ - || (vp)->v_tag == VT_DEVFS) + || (vp)->v_tag == VT_MSDOSFS) #define ASSERT_VOP_LOCKED(vp, str) \ do { \ Index: usr.sbin/dpt/dpt_softc/dpt_softc.c =================================================================== RCS file: /stl/src/FreeBSD/src/usr.sbin/dpt/dpt_softc/dpt_softc.c,v retrieving revision 1.3 diff -u -r1.3 dpt_softc.c --- usr.sbin/dpt/dpt_softc/dpt_softc.c 1999/08/28 01:16:10 1.3 +++ usr.sbin/dpt/dpt_softc/dpt_softc.c 2001/07/04 23:21:41 @@ -54,7 +54,6 @@ * If you build a kernel without these options, edit here and recompile. */ #define DPT_MEASURE_PERFORMANCE -#define DEVFS #include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message