summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs
Commit message (Collapse)AuthorAgeFilesLines
* Make devfs to give honour to PDIRUNLOCK flag.semenu2002-06-011-9/+13
| | | | | Reviewed by: jeff MFC after: 1 week
* Fix several bugs in devfs_lookupx(). When we check the nameiop tomux2002-05-101-3/+3
| | | | | | | | | make sure it's a correct operation for devfs, do it only in the ISLASTCN case. If we don't, we are assuming that the final file will be in devfs, which is not true if another partition is mounted on top of devfs or with special filenames (like /dev/net/../../foo). Reviewed by: phk
* Convert devfs to nmount.mux2002-05-021-6/+5
| | | | Reviewed by: phk
* Use vnode locking with devfs; permit VFS locking assertions to makerwatson2002-04-291-0/+6
| | | | | | | | sense for devfs vnodes, and reduce/remove potential races in the devfs code. Submitted by: iadowse Approved by: phk
* Don't attempt to decvlare M_DEVFS whern MALLOC_DECLARE is not defined.bde2002-04-211-3/+6
| | | | | | | | This fixes warnings that should be errors in fstat. Reminded by: alpha tinderbox Fixed some style bugs (ones near BOF and EOF; there are many more).
* Fixed assorted bugs in setting of timestamps in devfs_setattr().bde2002-04-051-21/+24
| | | | | | | | | | | | Setting of timestamps on devices had no effect visible to userland because timestamps for devices were set in places that are never used. This broke: - update of file change time after a change of an attribute - setting of file access and modification times. The VA_UTIMES_NULL case did not work. Revs 1.31-1.32 were supposed to fix this by copying correct bits from ufs, but had little or no effect because the old checks were not removed.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-6/+5
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove __P.alfred2002-03-192-21/+21
|
* Be consistent with UFS in a way how devfs_setattr() checks credentialsmaxim2002-03-141-4/+5
| | | | | | | | for chmod(2), chown(2) and utimes(2) with respect to jail(2). Reviewed by: rwatson, ru Not objected by: phk Approved by: ru
* 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)
* Address two minor issues: implement the _PC_NAME_MAX and _PC_PATH_MAXdd2001-11-251-2/+29
| | | | | | | | | pathconf() variables for directories, and set st_size and st_blocks (of struct stat) for directories as appropriate. Note that st_size is always set to DEV_BSIZE, since the size of the directories is not currently kept. Reviewed by: phk, bde
* Fix "echo > /dev/null" for non-root users which broke in previous commit.phk2001-11-041-5/+7
|
* Use vfs_timestamp() instead of getnanotime().phk2001-11-031-3/+12
| | | | | | Add magic stuff copied from ufs_setattr(). Instructed by: bde
* Use vfs_timestamp() instead of getnanotime() directly.phk2001-11-031-3/+3
| | | | | | Fix some modes on directories and symlinks. Instructed by: bde
* Backed out vestiges of the quick fixes for the transient breakage ofbde2001-10-132-2/+0
| | | | | <sys/mount.h> in rev.1.106 of the latter (don't include <sys/socket.h> just to work around bugs in <sys/mount.h>).
* The behaviour of whiteout'ing symlinks were too confusing, insteadphk2001-09-301-1/+8
| | | | remove them when asked to.
* KSE Milestone 2julian2001-09-124-55/+55
| | | | | | | | | | | | | | 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
* linux ls fails on DEVFS /dev because linux_getdents fails becausephk2001-08-141-4/+22
| | | | | | | | | | linux_getdents uses VOP_READDIR( ..., &ncookies, &cookies ) instead of VOP_READDIR( ..., NULL, NULL ) because it seems to need the offsets for linux_dirent and sizeof(dirent) != sizeof(linux_dirent)... PR: 29467 Submitted by: Michael Reifenberger <root@nihil.plaut.de> Reviewed by: phk
* Support /dev/tun cloning. Ansify if_tun.c while I'm there.brian2001-06-011-1/+2
| | | | | | | | | | | | | | Only tun0 -> tun32767 may now be opened as struct ifnet's if_unit is a short. It's now possible to open /dev/tun and get a handle back for an available tun device (use devname to find out what you got). The implementation uses rman by popular demand (and against my judgement) to track opened devices and uses the new dev_depends() to ensure that all make_dev()d devices go away before the module is unloaded. Reviewed by: phk
* Don't copy the trailing zero in readlink, it confuses namei().phk2001-05-261-1/+1
| | | | PR: 27656
* 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()
* Change the way deletes are managed in DEVFS.phk2001-05-232-42/+114
| | | | | | | This fixes a number of warnings relating to removed cloned devices. It also makes it possible to recreate deleted devices with mknod(2). The major/minor arguments are ignored.
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-12/+2
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
* After a successfull poll of the cloning functions, match on thephk2001-05-141-14/+6
| | | | | | | returned dev_t rather than the original name. This allows cloning from one name to another which is useful for /dev/tty and later for the pty's.
* Convert DEVFS from an "opt-in" to an "opt-out" option.phk2001-05-133-5/+8
| | | | | | | | | 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.
* Remove unneeded devfs_badop()phk2001-05-061-10/+0
| | | | Noticed by: rwatson
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-013-14/+17
| | | | | | | | | | | 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)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-23/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* add this ridiculous include foo so it will compile againmjacob2001-04-232-0/+4
|
* Reviewed by: jlemonadrian2001-03-011-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount.
* Remove a debug printf.phk2001-02-181-3/+1
|
* At the point in time where most devices are created, we don't know whatphk2001-02-022-1/+16
| | | | | time it is because boottime is not yet initialized. Finagle the relevant fields when we get the chance.
* Only superuser can create symlinks.phk2001-02-021-2/+5
| | | | | Give symlinks mode 755 by default to avoid triggering alert eyes. (the mode isn't use on symlinks)
* Fix two minor nits.phk2001-01-302-2/+6
| | | | Existences revealed, but no details offered by: bp
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-082-10/+5
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* staticize.phk2000-12-083-6/+7
|
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-292-2/+0
|
* Don't hold an extra reference to vnodes. Devfs vnodes are sufficientlyphk2000-10-093-24/+28
| | | | | | | | | | | | | | 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.
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-10-041-0/+2
| | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
* Ignore attempts to set flags to zero. This quenches a syslog warningphk2000-09-181-1/+1
| | | | from login(1).
* Add canonical checks to devfs_setattr().phk2000-09-161-14/+50
|
* Use size_t instead of u_int for 4th argument to copyinstr().jhb2000-09-121-1/+1
|
* Add refcounts to the "global" DEVFS inode slots, this allows usphk2000-09-064-71/+294
| | | | | | | | | | | | | | | | | | | 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.
* Off by one error.phk2000-09-041-1/+1
| | | | Submitted by: des
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-023-31/+4
| | | | | | | | | | | | | | | | | | 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.
* o Restructure vaccess() so as to check for DAC permission to modify therwatson2000-08-291-1/+1
| | | | | | | | | | | | | | | | object before falling back on privilege. Make vaccess() accept an additional optional argument, privused, to determine whether privilege was required for vaccess() to return 0. Add commented out capability checks for reference. Rename some variables to make it more clear which modes/uids/etc are associated with the object, and which with the access mode. o Update file system use of vaccess() to pass NULL as the optional privused argument. Once additional patches are applied, suser() will no longer set ASU, so privused will permit passing of privilege information up the stack to the caller. Reviewed by: bde, green, phk, -security, others Obtained from: TrustedBSD Project
* Reorder vop's alphabetically.phk2000-08-274-245/+278
| | | | | | Smarter use of devfs_allocv() (from bp@) Introduce devfs_find() ".." fixes to devfs_lookup (from bp@)
* Minor cleanups tp devfs_readdir();phk2000-08-261-11/+33
| | | | Add devfs_read() for directories. (inspired by bp@)
OpenPOWER on IntegriCloud