aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
Commit message (Collapse)AuthorAgeFilesLines
* o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().Robert Watson2001-07-057-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | The p_can(...) construct was a premature (and, it turns out, awkward) abstraction. The individual calls to p_canxxx() better reflect differences between the inter-process authorization checks, such as differing checks based on the type of signal. This has a side effect of improving code readability. o Replace direct credential authorization checks in ktrace() with invocation of p_candebug(), while maintaining the special case check of KTR_ROOT. This allows ktrace() to "play more nicely" with new mandatory access control schemes, as well as making its authorization checks consistent with other "debugging class" checks. o Eliminate "privused" construct for p_can*() calls which allowed the caller to determine if privilege was required for successful evaluation of the access control check. This primitive is currently unused, and as such, serves only to complicate the API. Approved by: ({procfs,linprocfs} changes) des Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=79335
* - Update the vmmeter statistics for vnode pageins and pageouts inJohn Baldwin2001-07-041-2/+7
| | | | | | | | | getpages/putpages. - Use vm_page_undirty() instead of messing with pages' dirty fields directly. Notes: svn path=/head/; revision=79245
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachMatthew Dillon2001-07-043-17/+7
| | | | | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant. Notes: svn path=/head/; revision=79224
* Fix a mntvnode and vnode interlock reversal.John Baldwin2001-06-281-2/+3
| | | | Notes: svn path=/head/; revision=78907
* Protect the mnt_vnode list with the mntvnode lock.John Baldwin2001-06-282-4/+19
| | | | Notes: svn path=/head/; revision=78906
* #if 0 out pfs_null() to silence the warning about it not being referenced.Dag-Erling Smørgrav2001-06-151-0/+2
| | | | Notes: svn path=/head/; revision=78274
* Fix warning: 568: warning: `portal_badop' defined but not usedPeter Wemm2001-06-151-13/+0
| | | | Notes: svn path=/head/; revision=78244
* Fix warning (exposed NetBSD code):Peter Wemm2001-06-151-1/+1
| | | | | | | 94: warning: `ntfs_bmap' declared `static' but never defined Notes: svn path=/head/; revision=78242
* Fix warnings (mostly harmless, due to struct bio being embedded in buf):Peter Wemm2001-06-151-2/+2
| | | | | | | | 738: warning: passing arg 1 of `biodone' from incompatible pointer type 745: warning: passing arg 1 of `biodone' from incompatible pointer type Notes: svn path=/head/; revision=78241
* Fix warning: 552: warning: `fdesc_badop' defined but not usedPeter Wemm2001-06-151-12/+0
| | | | Notes: svn path=/head/; revision=78240
* Warning fix: coda_fbsd.c:113: warning: unused variable `ret'Peter Wemm2001-06-151-1/+0
| | | | Notes: svn path=/head/; revision=78229
* Coda do not call vop_defaultop(), so add nesessary calls for VM objects.Boris Popov2001-06-141-0/+3
| | | | | | | | Submitted by: Greg Troxel <gdt@ir.bbn.com> MFC after: 2 days Notes: svn path=/head/; revision=78205
* the last argument to copyinstr is of t ype size_t, not u_intMatt Jacob2001-06-131-3/+3
| | | | Notes: svn path=/head/; revision=78179
* With this commit, I hereby pronounce gensetdefs past its use-by date.Peter Wemm2001-06-134-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind Notes: svn path=/head/; revision=78161
* For some reason, though the module builds just fine without <sys/lock.h>,Dag-Erling Smørgrav2001-06-113-0/+3
| | | | | | | LINT fails to build without it. Notes: svn path=/head/; revision=78073
* Bail out if the fill function failed.Dag-Erling Smørgrav2001-06-101-0/+10
| | | | Notes: svn path=/head/; revision=78018
* Whoops, some of my test code snuck in here.Dag-Erling Smørgrav2001-06-101-1/+1
| | | | Notes: svn path=/head/; revision=78017
* Argh. Fix braino in previous commit.Dag-Erling Smørgrav2001-06-101-1/+1
| | | | Notes: svn path=/head/; revision=78003
* Add a 'flags' argument to the PFS_PROCDIR macro.Dag-Erling Smørgrav2001-06-101-2/+2
| | | | Notes: svn path=/head/; revision=78001
* Add support for process-dependent directories. This means that save forDag-Erling Smørgrav2001-06-106-147/+195
| | | | | | | the lack of a man page, pseudofs is mostly complete now. Notes: svn path=/head/; revision=77998
* Blah, not my day. This file needs <sys/mutex.h> now.Dag-Erling Smørgrav2001-06-101-0/+1
| | | | Notes: svn path=/head/; revision=77967
* Remember to unlock the process pfind() returns.Dag-Erling Smørgrav2001-06-101-1/+5
| | | | Notes: svn path=/head/; revision=77966
* Add missing #include of <sys/mutex.h>.Dag-Erling Smørgrav2001-06-103-0/+3
| | | | Notes: svn path=/head/; revision=77965
* Catch up with the change in sbuf_new's prototype.Dag-Erling Smørgrav2001-06-101-8/+8
| | | | Notes: svn path=/head/; revision=77964
* The kq write filter was hooked up to the wrong socket, and thus wasJonathan Lemon2001-06-061-4/+11
| | | | | | | | | | not behaving correctly. Fix by attaching to the correct socket. Also call so{rw}wakeup in addition to the fifo wakeup, so that any kqfilters attached to the socket buffer get poked. Notes: svn path=/head/; revision=77821
* Lock VM Giant prior to locking a vm map.Seigo Tanimura2001-06-061-0/+7
| | | | | | | | | Spotted by: Daniel Rock <D.Rock@t-online.de> Tested by: David Wolfskill <david@catwhisker.org>, Sean Eric Fagan <sef@kithrup.com> Notes: svn path=/head/; revision=77799
* Now works again and as a module and with devfs.Shafeeq Sinnamohideen2001-06-053-9/+73
| | | | | | | Used the bpf & tun drivers as examples as to what is necessary for devfs. Notes: svn path=/head/; revision=77784
* Support /dev/tun cloning. Ansify if_tun.c while I'm there.Brian Somers2001-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 Notes: svn path=/head/; revision=77589
* - VFS_SET(msdos) -> VFS_SET(msdosfs)Ruslan Ermilov2001-06-011-1/+1
| | | | | | | | | - msdos.ko -> msdosfs.ko - mount_msdos(8) -> mount_msdosfs(8) - "msdos" -> "msdosfs" compatibility glue in mount(8) Notes: svn path=/head/; revision=77577
* Don't copy the trailing zero in readlink, it confuses namei().Poul-Henning Kamp2001-05-261-1/+1
| | | | | | | PR: 27656 Notes: svn path=/head/; revision=77243
* - sys/n[tw]fs moved to sys/fs/n[tw]fsRuslan Ermilov2001-05-2612-41/+41
| | | | | | | - /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs Notes: svn path=/head/; revision=77223
* Create a general facility for making dev_t's depend on anotherPoul-Henning Kamp2001-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() Notes: svn path=/head/; revision=77215
* o Merge contents of struct pcred into struct ucred. Specifically, add theRobert Watson2001-05-252-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit Notes: svn path=/head/; revision=77183
* - sys/msdosfs moved to sys/fs/msdosfsRuslan Ermilov2001-05-256-27/+27
| | | | | | | | - msdos.ko renamed to msdosfs.ko - /usr/include/msdosfs moved to /usr/include/fs/msdosfs Notes: svn path=/head/; revision=77162
* Actually rename FDESC, PORTAL, UMAP and UNION file systems.Ruslan Ermilov2001-05-244-4/+4
| | | | | | | OK'ed by: bp Notes: svn path=/head/; revision=77133
* mount_umap(8) -> mount_umapfs(8).Ruslan Ermilov2001-05-241-1/+1
| | | | Notes: svn path=/head/; revision=77131
* mount_null(8) -> mount_nullfs(8).Ruslan Ermilov2001-05-241-4/+4
| | | | Notes: svn path=/head/; revision=77130
* Don't acquire/release Giant around some of the places that need it inJohn Baldwin2001-05-231-2/+1
| | | | | | | spec_getpages(). Instead, assert that Giant is held by the caller. Notes: svn path=/head/; revision=77084
* Change the way deletes are managed in DEVFS.Poul-Henning Kamp2001-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. Notes: svn path=/head/; revision=77050
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileRuslan Ermilov2001-05-2328-29/+29
| | | | | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles. Notes: svn path=/head/; revision=77031
* Sort includes from previous commit.John Baldwin2001-05-211-1/+1
| | | | Notes: svn path=/head/; revision=76945
* Introduce a global lock for the vm subsystem (vm_mtx).Alfred Perlstein2001-05-195-1/+18
| | | | | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb Notes: svn path=/head/; revision=76827
* Currently there is no way to tell if write operation invoked viaBoris Popov2001-05-181-1/+1
| | | | | | | | | | vn_start_write() on the given vnode will be successful. VOP_LEASE() may help to solve this problem, but its return value ignored nearly everywhere. For now just assume that the missing upper layer on write means insufficient access rights (which is correct for most cases). Notes: svn path=/head/; revision=76797
* VOP getwritemount() can be invoked on vnodes with VFREE flag set (used inBoris Popov2001-05-171-4/+12
| | | | | | | snapshots code). At this point upper vp may not exist. Notes: svn path=/head/; revision=76718
* Use vop_*vobject() VOPs to get reference to VM object from upper or lower fs.Boris Popov2001-05-173-60/+60
| | | | Notes: svn path=/head/; revision=76716
* Do not leave an extra reference on vnode.Boris Popov2001-05-171-6/+2
| | | | | | | | | PR: kern/27250 Submitted by: "Vladimir B. Grebenschikov" <vova@express.ru> MFC after: 2 weeks Notes: svn path=/head/; revision=76715
* Change the second argument of vflush() to an integer that specifiesIan Dowse2001-05-1613-143/+31
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=76688
* After a successfull poll of the cloning functions, match on thePoul-Henning Kamp2001-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. Notes: svn path=/head/; revision=76571
* Convert DEVFS from an "opt-in" to an "opt-out" option.Poul-Henning Kamp2001-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. Notes: svn path=/head/; revision=76554
* GC prototype for procfs_bmap() missed during a previous commit.John Baldwin2001-05-111-1/+0
| | | | Notes: svn path=/head/; revision=76491