summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_devs.c
Commit message (Collapse)AuthorAgeFilesLines
* Back out M_* changes, per decision of the TRB.imp2003-02-191-5/+5
| | | | Approved by: trb
* NODEVFS cleanup: remove #ifdefs.phk2003-01-291-2/+0
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-5/+5
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Originally when DEVFS was added, a global variable "devfs_present"phk2003-01-191-1/+0
| | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit.
* Remove dm_root entry from struct devfs_mount. It's never set, and isrwatson2002-12-091-3/+3
| | | | | | | | | | | | unused. Replace it with a dm_mount back-pointer to the struct mount that the devfs_mount is associated with. Export that pointer to MAC Framework entry points, where all current policies don't use the pointer. This permits the SEBSD port of SELinux's FLASK/TE to compile out-of-the-box on 5.0-CURRENT with full file system labeling support. Approved by: re (murray) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* s/struct dev_t */dev_t */phk2002-09-281-1/+1
|
* Introduce support for Mandatory Access Control and extensiblerwatson2002-07-311-0/+15
| | | | | | | | | | | | | | | | kernel access control. Instrument devfs to support per-dirent MAC labels. In particular, invoke MAC framework when devfs directory entries are instantiated due to make_dev() and related calls, and invoke the MAC framework when vnodes are instantiated from these directory entries. Implement vop_setlabel() for devfs, which pushes the label update into the devfs directory entry for semi-persistant store. This permits the MAC framework to assign labels to devices and directories as they are instantiated, and export access control information via devfs vnodes. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Introduce the DEVFS "rule" subsystem. DEVFS rules permit thedd2002-07-171-0/+2
| | | | | | | | | | | administrator to define certain properties of new devfs nodes before they become visible to the userland. Both static (e.g., /dev/speaker) and dynamic (e.g., /dev/bpf*, some removable devices) nodes are supported. Each DEVFS mount may have a different ruleset assigned to it, permitting different policies to be implemented for things like jails. Approved by: phk
* Add a new sysinit SI_SUB_DEVFS. Devfs hooks into the kernel at SI_ORDER_FIRST,msmith2002-01-091-1/+1
| | | | | | and devices can be created anytime after that. Print a warning if an atttempt is made to create a device too early.
* Use a sysinit to initialise the devfs hooks in kern_conf.c rather than commonmsmith2002-01-091-3/+10
| | | | | | variables. Reviewed by: phk (in principle)
* Use vfs_timestamp() instead of getnanotime() directly.phk2001-11-031-3/+3
| | | | | | Fix some modes on directories and symlinks. Instructed by: bde
* KSE Milestone 2julian2001-09-121-2/+2
| | | | | | | | | | | | | | 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
* Create a general facility for making dev_t's depend on anotherphk2001-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* Convert DEVFS from an "opt-in" to an "opt-out" option.phk2001-05-131-0/+2
| | | | | | | | | If for some reason DEVFS is undesired, the "NODEVFS" option is needed now. Pending any significant issues, DEVFS will be made mandatory in -current on july 1st so that we can start reaping the full benefits of having it.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-4/+5
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* At the point in time where most devices are created, we don't know whatphk2001-02-021-1/+1
| | | | | time it is because boottime is not yet initialized. Finagle the relevant fields when we get the chance.
* Fix two minor nits.phk2001-01-301-1/+2
| | | | Existences revealed, but no details offered by: bp
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-8/+4
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* staticize.phk2000-12-081-2/+5
|
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-1/+0
|
* Don't hold an extra reference to vnodes. Devfs vnodes are sufficientlyphk2000-10-091-10/+6
| | | | | | | | | | | | | | cheap to setup that it doesn't really matter that we recycle device vnodes at kleenex speed. Implement first cut try at killing cloned devices when they are not needed anymore. For now only the bpf driver is involved in this experiment. Cloned devices can set the SI_CHEAPCLONE flag which allows us to destroy_dev() it when the vcount() drops to zero and the vnode is reclaimed. For now it's a requirement that the driver doesn't keep persistent state from close to (re)open. Some whitespace changes.
* Add refcounts to the "global" DEVFS inode slots, this allows usphk2000-09-061-23/+211
| | | | | | | | | | | | | | | | | | | to recycle inodes after a destroy_dev() but not until all mounts have picked up the change. Add support for an overflow table for DEVFS inodes. The static table defaults to 1024 inodes, if that fills, an overflow table of 32k inodes is allocated. Both numbers can be changed at compile time, the size of the overflow table also with the sysctl vfs.devfs.noverflow. Use atomic instructions to barrier between make_dev()/destroy_dev() and the mounts. Add lockmgr() locking of directories for operations accessing or modifying the directory TAILQs. Various nitpicking here and there.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-25/+3
| | | | | | | | | | | | | | | | | | 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.
* Reorder vop's alphabetically.phk2000-08-271-16/+27
| | | | | | Smarter use of devfs_allocv() (from bp@) Introduce devfs_find() ".." fixes to devfs_lookup (from bp@)
* Fix panic when removing open device (found by bp@)phk2000-08-241-23/+56
| | | | | | | | | | | | Implement subdirs. Build the full "devicename" for cloning functions. Fix panic when deleted device goes away. Collaps devfs_dir and devfs_dirent structures. Add proper cloning to the /dev/fd* "device-"driver. Fix a bug in make_dev_alias() handling which made aliases appear multiple times. Use devfs_clone to implement getdiskbyname() Make specfs maintain the stat(2) timestamps per dev_t
* Fix devfs_access() bug on directories.phk2000-08-211-3/+0
| | | | | | Remove unused #includes. Bug spotted by: markm
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-0/+230
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
OpenPOWER on IntegriCloud