summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the way we internally store the mount options tomux2002-06-201-10/+45
| | | | | | | | | | a linked list. This is to allow the merging of the mount options in the MNT_UPDATE case, as the current data structure is unsuitable for this. There are no functional differences in this commit. Reviewed by: phk
* Change vfs_copyopt() so that the length argument passed to itmux2002-06-141-10/+7
| | | | | must be the exact same size as the mount option. This makes vfs_copyopt() much more useful.
* Move some sysctls from the debug tree to the vfs tree.des2002-06-061-3/+3
|
* Gratuitous whitespace cleanup.des2002-06-061-28/+27
|
* More s/file system/filesystem/gtrhodes2002-05-161-5/+5
|
* o Fix vfs_copyopt(), the first argument to bcopy() is the source,mux2002-05-161-15/+6
| | | | | | not the destination. o Remove some code from vfs_getopt() which was making the interface more complicated to use for a very slight gain.
* Switch from just holding the interlock to holding the standard lock throughoutjeff2002-05-071-12/+17
| | | | | getnewvnode(). This is safer. In the future, we should investigate requiring only the interlock to get the vnode object.
* Hold the currently selected vnode's lock across the call to VOP_GETVOBJECT.jeff2002-05-061-2/+4
| | | | | | | Don't try to create a vm object before the file system has a chance to finish initializing it. This is incorrect for a number of reasons. Firstly, that VOP requires a lock which the file system may not have initialized yet. Also, open and others will create a vm object if it is necessary later.
* Expand the one-line function pbreassignbuf() the only place it is or couldphk2002-05-051-14/+0
| | | | be used.
* Remove obsolete code (that was already #if 0'd out).dillon2002-05-041-18/+0
| | | | Requested by: Hiten Pandya <hitmaster2k@yahoo.com>
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-7/+7
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | 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@
* As discussed in -arch, add the new nmount(2) system call and themux2002-03-261-0/+77
| | | | | | | | | | new vfs_getopt()/vfs_copyopt() API. This is intended to be used later, when there will be filesystems implementing the VFS_NMOUNT operation. The mount(2) system call will disappear when all filesystems will be converted to the new API. Documentation will be committed in a while. Reviewed by: phk
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-201-9/+11
| | | | | Also, remove maxsockets. If you look carefully you'll notice that the old zone allocator never honored this anyway.
* Remove __P.alfred2002-03-191-14/+14
|
* Three p_ucred -> td_ucred's missed in jhb's earlier pass; all appear torwatson2002-03-051-1/+1
| | | | be safe.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-2/+2
| | | | reference.
* Make v_addpollinfo() visible and non-inline.phk2002-02-181-5/+5
| | | | | | | Have callers only call it as needed. Add necessary call in ufs_kqfilter(). Test-case found by: Andrew Gallatin <gallatin@cs.duke.edu>
* Remove yet a redundant VN_KNOTE() macro.phk2002-02-181-3/+0
|
* Move the stuff related to select and poll out of struct vnode.phk2002-02-171-23/+43
| | | | | | | | | The use of the zone allocator may or may not be overkill. There is an XXX: over in ufs/ufs/ufs_vnops.c that jlemon may need to revisit. This shaves about 60 bytes of struct vnode which on my laptop means 600k less RAM used for vnodes.
* Fix a couple of style bugs introduced (or touched by) previous commit.peter2002-02-071-2/+1
|
* Pre-KSE/M3 commit.julian2002-02-071-5/+6
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* In the routines vrele() and vput(), we must lock the vnode andmckusick2002-02-021-15/+15
| | | | | | | | | | | call VOP_INACTIVE before placing the vnode back on the free list. Otherwise there is a race condition on SMP machines between getnewvnode() locking the vnode to reclaim it and vrele() locking the vnode to inactivate it. This window of vulnerability becomes exaggerated in the presence of filesystems that have been suspended as the inactive routine may need to temporarily release the lock on the vnode to avoid deadlock with the syncer process.
* Remove 'VXLOCK: interlock avoided' warnings. This can now occur in normaldillon2002-01-191-0/+3
| | | | | | | | | | | | operation. The vgonel() code has always called vclean() but until we started proactively freeing vnodes it would never actually be called with a dirty vnode, so this situation did not occur prior to the vnlru() code. Now that we proactively free vnodes when kern.maxvnodes is hit, however, vclean() winds up with work to do and improperly generates the warnings. Reviewed by: peter Approved by: re (for MFC) MFC after: 1 day
* When downgrading a filesystem from read-write to read-only, operationsmckusick2002-01-151-2/+7
| | | | | | | | | | | | | | | | | | | | involving file removal or file update were not always being fully committed to disk. The result was lost files or corrupted file data. This change ensures that the filesystem is properly synced to disk before the filesystem is down-graded. This delta also fixes a long standing bug in which a file open for reading has been unlinked. When the last open reference to the file is closed, the inode is reclaimed by the filesystem. Previously, if the filesystem had been down-graded to read-only, the inode could not be reclaimed, and thus was lost and had to be later recovered by fsck. With this change, such files are found at the time of the down-grade. Normally they will result in the filesystem down-grade failing with `device busy'. If a forcible down-grade is done, then the affected files will be revoked causing the inode to be released and the open file descriptors to begin failing on attempts to read. Submitted by: "Sam Leffler" <sam@errno.com>
* Add vlruvp() routine - implements LRU operation for vnode recycling.dillon2002-01-101-0/+46
| | | | | | | | We calculate a trigger point that both guarentees we will find a sufficient number of vnodes to recycle and prevents us from recycling vnodes with lots of resident pages. This particular section of code is designed to recycle vnodes, not do unnecessary frees of cached VM pages.
* Fix type-o in previous commit (tsleep was using wrong rendezvous point)dillon2001-12-251-1/+1
|
* Fix a BUF_TIMELOCK race against BUF_LOCK and fix a deadlock in vget()dillon2001-12-201-1/+1
| | | | | | | | against VM_WAIT in the pageout code. Both fixes involve adjusting the lockmgr's timeout capability so locks obtained with timeouts do not interfere with locks obtained without a timeout. Hopefully MFC: before the 4.5 release
* Do not initialize static/global variables to 0. Use bss instead ofpeter2001-12-191-7/+7
| | | | taking up space in the data section.
* Use a different mechanism to get the vnlru process to wake up and noticepeter2001-12-191-4/+14
| | | | | | the shutdown request at reboot/halt time. Disable the printf 'vnlru process getting nowhere, pausing...' and instead export the count to the debug.vnlru_nowhere sysctl.
* This is a forward port of Peter's vlrureclaim() fix, with some minor modsdillon2001-12-181-8/+74
| | | | | | | | | | | | | by me to make it more efficient. The original code had serious balancing problems and could also deadlock easily. This code relegates the vnode reclamation to its own kproc and relaxes the vnode reclamation requirements to better maintain kern.maxvnodes. This code still doesn't balance as well as it could, but it does a much better job then the original code. Approved by: re@freebsd.org Obtained from: ps, peter, dillon MFS Assuming: Assuming no problems crop up in Yahoo testing MFC after: 7 days
* A slightly different version of the vlrureclaim fix.dillon2001-12-141-3/+1
| | | | Reported by: peter, ps
* If we were called to allocate a vnode that is not associated with apeter2001-12-131-0/+2
| | | | mount point, do not dereference the NULL mp argument.
* Add mnt_reservedvnlist so we can MFC to 4.x, in order to make all mountdillon2001-11-041-0/+1
| | | | | | | | structure changes now rather then piecemeal later on. mnt_nvnodelist currently holds all the vnodes under the mount point. This will eventually be split into a 'dirty' and 'clean' list. This way we only break kld's once rather then twice. nvnodelist will eventually turn into the dirty list and should remain compatible with the klds.
* Merge from POSIX.1e Capabilities development tree:rwatson2001-11-021-6/+17
| | | | | | | | | o POSIX.1e capabilities authorize overriding of VEXEC for VDIR based on CAP_DAC_READ_SEARCH, but of !VDIR based on CAP_DAC_EXECUTE. Add appropriate conditionals to vaccess() to take that into account. o Synchronization cap_check_xxx() -> cap_check() change. Obtained from: TrustedBSD Project
* syncdelay, filedelay, dirdelay, metadelay are ints, not time_t's,dillon2001-10-271-4/+4
| | | | and can also be made static.
* Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has adillon2001-10-261-36/+76
| | | | | | | | | | | | | | | | real effect. Optimize vfs_msync(). Avoid having to continually drop and re-obtain mutexes when scanning the vnode list. Improves looping case by 500%. Optimize ffs_sync(). Avoid having to continually drop and re-obtain mutexes when scanning the vnode list. This makes a couple of assumptions, which I believe are ok, in regards to vnode stability when the mount list mutex is held. Improves looping case by 500%. (more optimization work is needed on top of these fixes) MFC after: 1 week
* Add missing TAILQ_INSERT_TAIL's which somehow didn't get comitted withdillon2001-10-251-0/+2
| | | | the recent vnode cleanup.
* Change the vnode list under the mount point from a LIST to a TAILQdillon2001-10-231-11/+12
| | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days
* fix minor bug in kern.minvnodes sysctl. Use OID_AUTO.dillon2001-10-161-1/+1
|
* WS Cleanupdillon2001-10-081-4/+0
|
* vinvalbuf() was only waiting for write-I/O to complete. It really has todillon2001-10-051-4/+15
| | | | | | | | wait for both read AND write I/O to complete. Only NFS calls vinvalbuf() on an active vnode (when the server indicates that the file is stale), so this bug fix only effects NFS clients. MFC after: 3 days
* After extensive testing it has been determined that adding complexitydillon2001-10-011-29/+68
| | | | | | | | | | | | | | | | | | to avoid removing higher level directory vnodes from the namecache has no perceivable effect and will be removed. This is especially true when vmiodirenable is turned on, which it is by default now. ( vmiodirenable makes a huge difference in directory caching ). The vfs.vmiodirenable and vfs.nameileafonly sysctls have been left in to allow further testing, but I expect to rip out vfs.nameileafonly soon too. I have also determined through testing that the real problem with numvnodes getting too large is due to the VM Page cache preventing the vnode from being reclaimed. The directory stuff made only a tiny dent relative to Poul's original code, enough so that some tests succeeded. But tests with several million small files show that the bigger problem is the VM Page cache. This will have to be addressed by a future commit. MFC after: 3 days
* KSE Milestone 2julian2001-09-121-89/+90
| | | | | | | | | | | | | | 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
* If a file has been completely unlinked, stop automatically syncing thepeter2001-08-271-0/+3
| | | | | | file. ffs will discard any pending dirty pages when it is closed, so we may as well not waste time trying to clean them. This doesn't stop other things from writing it out, eg: pageout, fsync(2) etc.
* Revert previous accidental commit. FWIW, it was part of enablingpeter2001-07-271-23/+0
| | | | | | VM caching of disks through mmap() and stopping syncing of open files that had their last reference in the fs removed (ie: their unsync'ed pages get discarded on close already, so I made it stop syncing too).
* Fix cut/paste blunder. Serves me right for doing a last minute tweakpeter2001-07-271-0/+23
| | | | | | to what I had for some time. Submitted by: bde
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-10/+6
| | | | | | | | | (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.
* - Fix a mntvnode and vnode interlock reversal.jhb2001-06-281-6/+13
| | | | - Protect the mnt_vnode list with the mntvnode lock.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-1/+14
| | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud