summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
Commit message (Collapse)AuthorAgeFilesLines
* Break the following implementation of panic(3):bde2002-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!bin/sh # Original version of this by Michael Reifenberger # <root@nihil.plaut.de>. mdconfig -d -u 11 >/dev/null 2>&1 dd if=/dev/zero of=zz bs=1m count=1 while : do mdconfig -a -t vnode -f zz -u 11 fdisk -f - -iv /dev/md11 <<EOF1 g c1 h64 s32 p 1 165 0 2048 a 1 EOF1 mdconfig -d -u 11 done Garbage pointers in __si_u were not cleared by destroy_dev(). Not clearing si_disk made the above fatal because the disk layer uses si_disk as a flag to indicate that the dev_t has been completely initialized. disk_destroy() clears si_disk for the parent dev_t but doesn't get called for children. Not fixed: - setting the undocumented sysctl debug.free_devt should cause more complete destruction of the dev_t including clearing of __si_u, but actually causes the above to panic a little earlier. - the loop leaks 10 memory allocations per iteration (4 DEVFS, 2 devbuf and 4 dev_t). Reviewed by: timeout by MAINTAINER after 3 months
* Make the proposed name arg to dev_stdclone() const.phk2002-03-101-1/+1
|
* (Doing that whole test-immediately-after-commit-thing like obrien sez:)green2002-02-161-0/+2
| | | | Forgot to include lock.h and mutex.h for GIANT_REQUIRED.
* Add revoke_and_destroy_dev(), to be used by devices which decide whengreen2002-02-161-0/+13
| | | | | they choose to destroy themselves without regard to whether or not they are open.
* Add a new sysinit SI_SUB_DEVFS. Devfs hooks into the kernel at SI_ORDER_FIRST,msmith2002-01-091-1/+19
| | | | | | and devices can be created anytime after that. Print a warning if an atttempt is made to create a device too early.
* Back out the previous fix to the leading zero problem, I hadn'tphk2001-11-161-2/+0
| | | | | noticed it in there already. That should teach me to check exit code from cvsup.
* Reject leading zeros in dev_stdclone().phk2001-11-161-0/+2
| | | | | PR: 32019 Submitted by: fenner
* Do not allow leading zeros on device names in dev_stdclone().fenner2001-11-151-0/+2
| | | | | PR: kern/32019 Reviewed by: phk
* Fix a problem in the disk related hack where device nodes for a physicallyphk2001-10-281-1/+1
| | | | | | | | non-existent disk in a legacy /dev on a DEVFS system would panic the system if stat(2)'ed. Do not whine about anonymous device nodes not having a si_devsw, they're not supposed to.
* Nudge the axe a bit closer to cdevsw[]:phk2001-10-271-0/+11
| | | | | | | | | | | | Make it a panic to repeat make_dev() or destroy_dev(), this check should maybe be neutered when -current goes -stable. Whine if devsw() is called on anon dev_t's in a devfs system. Make a hack to avoid our lazy-eval disk code triggering the above whine. Fix the multiple make_dev() in disk code by making ${disk}${unit}s${slice} an alias/symlink to ${disk}${unit}s${slice}c
* Make cdevsw[] static.phk2001-10-261-1/+1
|
* Add dev_named(dev, name), which is similar in spirit to devtoname().jlemon2001-10-171-0/+13
| | | | | This function returns success if the device is known by either 'name' or any of its aliases.
* KSE Milestone 2julian2001-09-121-1/+1
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Make the fmt arguments to make_dev and make_dev_alias const char *.imp2001-08-021-2/+2
| | | | | | Approved on IRC as long as it didn't cause a large number of warnings by: phk MFC After: 700 hours
* Create a general facility for making dev_t's depend on anotherphk2001-05-261-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | dev_t. The dev_depends(dev_t, dev_t) function is for tying them to each other. When destroy_dev() is called on a dev_t, all dev_t's depending on it will also be destroyed (depth first order). Rewrite the make_dev_alias() to use this dependency facility. kern/subr_disk.c: Make the disk mini-layer use dependencies to make sure all relevant dev_t's are removed when the disk disappears. Make the disk mini-layer precreate some magic sub devices which the disk/slice/label code expects to be there. kern/subr_disklabel.c: Remove some now unneeded variables. kern/subr_diskmbr.c: Remove some ancient, commented out code. kern/subr_diskslice.c: Minor cleanup. Use name from dev_t instead of dsname()
* Call strlen() once instead of twice.brian2001-04-141-2/+2
|
* Add a KASSERT on unit2minor() so that we catch it if people try to passphk2001-03-201-0/+1
| | | | us unit numbers which doesn't fit in 24 bits.
* Fixes to track snapshot copy-on-write checking in the specinfomckusick2001-03-071-0/+1
| | | | | | structure rather than assuming that the device vnode would reside in the FFS filesystem (which is obviously a broken assumption with the device filesystem).
* KASSERT that the minor number passed to make_dev() is valid.brian2001-02-021-0/+3
|
* Convert a Debugger(3) to a panic(9) and a EINVAL.phk2001-01-211-1/+3
| | | | Reminded by: bde
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Axe some unused variables.jhb2000-11-101-2/+0
|
* Deprecate devsw->d_bmaj entirely.phk2000-10-311-41/+1
| | | | | | | 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{}.
* Allow all users to access the dev -> devname sysctl.phk2000-10-291-1/+1
|
* Rename lminor() to dev2unit(). This function gives a linear unit numberphk2000-09-191-1/+8
| | | | | | | | | | | | which hides the 'hole' in the minor bits. Introduce unit2minor() to do the reverse operation. Fix some some make_dev() calls which didn't use UID_* or GID_* macros. Kill the v_hashchain alias macro, it hides the real relationship. Introduce experimental SI_CHEAPCLONE flag set it on cloned bpfs.
* revent multiple make_dev() calls on the same dev_t and similar bogosities.phk2000-09-111-0/+16
| | | | | | A couple of new warnings may be emitted during boot if drivers DTWT. Tested by: George Cox <gjvc@gjvc.com>
* Add code to devname(3) so it can find the names of devices whichphk2000-09-091-0/+27
| | | | | | | | | | | | were not present when dev_mkdb(8) was run. First the dev_mkdb(8) database is searched, this caters for non-DEVFS cases where people have renamed a device. If that fails we ask the kernel using sysctl kern.devname if the device driver has put a name in the dev_t. This covers DEVFS cloned devices. If that also fails we format a string which isn't entirely useless.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-3/+28
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Change the "bdev-whiner" to whine when open is attempted and extendphk2000-05-091-5/+0
| | | | the deadline a month.
* Reword warning to make it clearer (I read it as "remove block devices createdkris2000-03-251-1/+1
| | | | before 2000-06-01" which is obviously not what was intended :-)
* Whine at users who still have block devices in /dev, give them untilphk2000-03-211-0/+5
| | | | june 1st to fix their system.
* Backout previous commit. It was a mistake.bp2000-01-231-1/+1
|
* Replace non obvious number with SPECNAMELEN constant.bp2000-01-231-1/+1
| | | | Reviewed by: phk
* Be more careful about NOUDEV and NODEV.phk2000-01-041-0/+8
| | | | Submitted by: bde
* Report swapdevices as cdevs rather than bdevs.phk1999-11-291-9/+0
| | | | Remove unused dev2budev() function.
* Remove the now unused chrtoblk() function.phk1999-11-291-17/+0
|
* Zap devsw_module_handler().peter1999-11-081-12/+0
|
* Rename remove_dev() to destroy_dev().phk1999-11-081-1/+1
| | | | Nagged about by: msmith
* Remove the devsw magic from DEV_MODULE()phk1999-11-071-17/+0
|
* A little step further in the dev_t cleanups:phk1999-10-041-17/+28
| | | | | | Refuse to register a bmajor if the D_DISK flag is not set in cdevsw. A little bit of cleanup while here.
* Const'ify devtoname() and d_name. This exposes some errors (2 non-benign).bde1999-09-131-3/+7
| | | | Handle negative minor numbers properly in devtoname().
* Add dev_t freeing code. Controlled by sysctl debug.free_devt, defaultphk1999-08-291-9/+58
| | | | is off.
* Put a brief comment on a couple of #defines.phk1999-08-281-0/+7
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-21/+5
| | | | | | | | | | | | | | | | 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().
* First small steps at merging DEVFS and PHK's Dev_t stuff.julian1999-08-201-1/+19
|
OpenPOWER on IntegriCloud