]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Divorce "dev_t" from the "major|minor" bitmap, which is now called
authorPoul-Henning Kamp <phk@FreeBSD.org>
Tue, 11 May 1999 19:55:07 +0000 (19:55 +0000)
committerPoul-Henning Kamp <phk@FreeBSD.org>
Tue, 11 May 1999 19:55:07 +0000 (19:55 +0000)
commitbfbb9ce67005673c7b7c8b2267024adef44f7d1d
tree9ffcbddb82416102ac7aed6b4c9c9b5bf02d13e3
parentac9a7ff18c4b3ed2974b52ffccdddff73dfd5cad
Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).
71 files changed:
sys/amd64/amd64/mem.c
sys/coda/coda.h
sys/coda/coda_venus.c
sys/compat/linux/linux_file.c
sys/compat/linux/linux_stats.c
sys/dev/ata/ata-disk.c
sys/dev/ccd/ccd.c
sys/dev/vn/vn.c
sys/fs/cd9660/cd9660_node.c
sys/fs/cd9660/cd9660_node.h
sys/fs/cd9660/cd9660_rrip.c
sys/fs/cd9660/cd9660_vnops.c
sys/fs/coda/coda.h
sys/fs/coda/coda_venus.c
sys/fs/msdosfs/msdosfs_denode.c
sys/fs/msdosfs/msdosfs_vnops.c
sys/fs/ntfs/ntfs_ihash.c
sys/fs/ntfs/ntfs_vfsops.c
sys/fs/ntfs/ntfs_vnops.c
sys/fs/specfs/spec_vnops.c
sys/geom/geom_ccd.c
sys/gnu/ext2fs/ext2_ihash.c
sys/i386/apm/apm.c
sys/i386/bios/apm.c
sys/i386/i386/mem.c
sys/i386/isa/diskslice_machdep.c
sys/i386/isa/if_le.c
sys/i386/isa/pcvt/pcvt_hdr.h
sys/i386/linux/linux_file.c
sys/i386/linux/linux_stats.c
sys/isofs/cd9660/cd9660_node.c
sys/isofs/cd9660/cd9660_node.h
sys/isofs/cd9660/cd9660_rrip.c
sys/isofs/cd9660/cd9660_vnops.c
sys/kern/kern_conf.c
sys/kern/kern_descrip.c
sys/kern/kern_proc.c
sys/kern/subr_diskmbr.c
sys/kern/subr_diskslice.c
sys/kern/subr_dkbad.c
sys/kern/uipc_usrreq.c
sys/kern/vfs_export.c
sys/kern/vfs_subr.c
sys/miscfs/devfs/devfs_vnops.c
sys/miscfs/kernfs/kernfs_vfsops.c
sys/miscfs/specfs/spec_vnops.c
sys/miscfs/specfs/specdev.h
sys/msdosfs/msdosfs_denode.c
sys/msdosfs/msdosfs_vnops.c
sys/nfs/nfs_common.c
sys/nfs/nfs_serv.c
sys/nfs/nfs_subs.c
sys/nfs/nfs_vnops.c
sys/nfsclient/nfs_subs.c
sys/nfsclient/nfs_vnops.c
sys/nfsserver/nfs_serv.c
sys/nfsserver/nfs_srvsubs.c
sys/ntfs/ntfs_ihash.c
sys/ntfs/ntfs_vfsops.c
sys/ntfs/ntfs_vnops.c
sys/sys/conf.h
sys/sys/linedisc.h
sys/sys/param.h
sys/sys/stat.h
sys/sys/systm.h
sys/sys/types.h
sys/sys/vnode.h
sys/ufs/mfs/mfs_vfsops.c
sys/ufs/ufs/ufs_ihash.c
sys/ufs/ufs/ufs_vnops.c
sys/vm/device_pager.c