summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_vnops.c
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
* 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
* 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-191-14/+14
|
* 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
* 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
* Backed out vestiges of the quick fixes for the transient breakage ofbde2001-10-131-1/+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-121-38/+38
| | | | | | | | | | | | | | 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
* Change the way deletes are managed in DEVFS.phk2001-05-231-41/+113
| | | | | | | 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.
* 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-131-5/+4
| | | | | | | | | 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-011-6/+7
| | | | | | | | | | | 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-231-0/+2
|
* 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-021-0/+15
| | | | | 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-301-1/+4
| | | | Existences revealed, but no details offered by: bp
* staticize.phk2000-12-081-2/+2
|
* 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>.
* Don't hold an extra reference to vnodes. Devfs vnodes are sufficientlyphk2000-10-091-12/+18
| | | | | | | | | | | | | | 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.
* 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
|
* Add refcounts to the "global" DEVFS inode slots, this allows usphk2000-09-061-22/+38
| | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | 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-271-187/+219
| | | | | | 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@)
* Fix panic when removing open device (found by bp@)phk2000-08-241-74/+118
| | | | | | | | | | | | 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-8/+8
| | | | | | Remove unused #includes. Bug spotted by: markm
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-0/+569
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