summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Sync VFS documentation with realitykn2018-06-041-4/+2
| | | | | | | | Missed during the "Namecache revamp" in 2009. Reported by Georg Bege <georg at bege dot email>, thanks. OK visa jmc mpi jca
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-4/+3
| | | | OK mpi@
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-021-3/+3
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-3/+3
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Use TAILQ_FOREACH_SAFE in cache_purgevfs(). Fix whitespaces.bluhm2017-02-091-11/+7
| | | | No binary change.
* move the namecache_rb_tree from RB macros to RBT functions.dlg2016-09-161-10/+17
| | | | | | i had to shuffle the includes a bit. all the knowledge of the RB tree is now inside vfs_cache.c, and all accesses are via cache_* functions.
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* pool_setipldlg2016-08-251-1/+2
| | | | ok kettenis@
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-3/+3
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Sync no-argument function declaration and definition by adding (void).naddy2016-03-071-2/+2
| | | | ok mpi@ millert@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* revert back to initial vnodes again so we can be sure nfs likes ittedu2015-01-281-2/+2
|
* increase namecache to maxvnodes again now that the n^2 loop is no more.tedu2015-01-161-2/+2
| | | | battle tested by krw
* increasing the size of the namecache suddenly made the commenttedu2015-01-161-11/+3
| | | | | | | | | | | "This makes the algorithm O(n^2), but do you think I care?" a lot more meaningful, as discovered by krw. fix the loop so it doesn't restart all the time, as it's not necessary. (this was also tried years ago in rev 1.20 and reverted, but that change also introduced pool_put before the namecache was ready to free things. we have been freeing cache entries with pool_put for some time now, so that's been made safe.) ok deraadt krw
* revert the namecache embiggening since it seems to cause hangs at reboot.tedu2015-01-121-2/+2
| | | | reported and revert tested by krw
* rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadttedu2015-01-091-2/+2
|
* increase namecache size to follow maxvnodes. seems better than desiredvnodes.tedu2015-01-081-2/+2
| | | | | (accuracy of variable names, aside) ok kettenis
* start retiring the nointr allocator. specify PR_WAITOK as a flag as atedu2014-12-191-3/+3
| | | | marker for which pools are not interrupt safe. ok dlg
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+2
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* convert bcopy to memcpy. ok millerttedu2014-12-101-2/+2
|
* Replace all queue *_END macro calls except CIRCLEQ_END with NULL.doug2014-09-131-5/+3
| | | | | | | | CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
* Assert that we never have destinations cached for a non-VDIR vnode.jsing2013-11-271-1/+4
| | | | ok beck@
* rename NCHNAMLEN to NAMECACHE_MAXLEN. easier to read, easier to type.tedu2013-03-271-4/+4
| | | | ok beck deraadt after a style issue noticed by kettenis
* Fix use after free in cache_lookup() - found by Pedrobeck2012-01-041-8/+9
| | | | | | | | | | fix is to manipulate the name cache structures before potentially sleeping on a vn_lock(). This avoids the race of the ncp entry being recycled while we are asleep. run in snaps and on ftp.openbsd.org for months ok thib@
* clean up a few things that where left to rot after bob's vfs cache work.thib2010-05-191-24/+11
| | | | | | | sync a few comments to reality (or remove them), remove the cn_hash member from struct componentname, spacing. ok beck@
* garbage collect the nchash variable that used to store thethib2009-08-241-2/+1
| | | | size of cache hashtable that has now been removed.
* Namecache revamp.beck2009-08-121-147/+179
| | | | | | | | | | | | | | | This eliminates the large single namecache hash table, and implements the name cache as a global lru of entires, and a redblack tree in each vnode. It makes cache_purge actually purge the namecache entries associated with a vnode when a vnode is recycled (very important for later on actually being able to resize the vnode pool) This commit does #if 0 out a bunch of procmap code that was already broken before this change, but needs to be redone completely. Tested by many, including in thib's nfs test setup. ok oga@,art@,thib@,miod@
* Remove the VREF() macro and replaces all instances with a call to verf(),thib2009-07-091-2/+2
| | | | | | | | | | | which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
* another oops.tedu2008-10-241-10/+8
|
* a better fix for the "uvm_km thread runs out of memory" problem.tedu2008-10-231-8/+10
| | | | | | | | | | | | add a new arg to the backend so it can tell pool to slow down. when we get this flag, yield *after* putting the page in the pool's free list. whatever we do, don't let the thread sleep. this makes things better by still letting the thread run when a huge pf request comes in, but without artificially increasing pressure on the backend by eating pages without feeding them forward. ok deraadt
* The optimization done in 1.19 (and repaired in 1.20) results inderaadt2008-10-201-9/+14
| | | | | | | | cache entries which are freed (and potentially reused), but which are currently in use by another kernel thread which was sleeping in vput() or vget(). This causes the crash in PR 5960, but potentially a bunch of other side effects. figured out with pedro. ok kettenis
* Add a PR_ZERO flag for pools, to compliment the M_ZEROthib2008-05-061-3/+2
| | | | | | | malloc flag, does the same thing. use it in a few places. OK tedu@, "then go ahead. and don't forget the manpage (-:" miod@
* english, okay jmc@pedro2007-06-211-5/+4
|
* back out vfs change - todd fries has seen afs issues, and I'm suspiciousbeck2007-05-301-87/+50
| | | | this can cause other problems.
* missing couple of #ifdef DIAGNOSTIC and style nits from art@beck2007-05-291-6/+7
|
* Step one of some vnode improvements - change getnewvnode tobeck2007-05-291-47/+83
| | | | | | | | actually allocate "desiredvnodes" - add a vdrop to un-hold a vnode held with vhold, and change the name cache to make use of vhold/vdrop, while keeping track of which vnodes are referred to by which cache entries to correctly hold/drop vnodes when the cache uses them. ok thib@, tedu@, art@
* Fix freeing of namecache entries in cache_purgevfs(), okay miod@ art@pedro2007-04-191-6/+7
|
* After we bumped the maximal number of vnodes by quite a bit we becameart2007-04-191-14/+8
| | | | | | | | | | | | | | painfully aware of what the comment: "This makes the algorithm O(n^2), but do you think I care?" actually means. I started to care. Fix up the cache_purgevfs algorithm to not be O(n^2) since it's not preemptible anyway and while I'm here, make this code actually return the cache entries to the pool instead of hogging them and implement a marginally faster free list. This way we return memory to the system when some parameters change. miod@ ok
* Make sure cache_revlookup() doesn't return invalid cache entries.pedro2006-01-211-2/+2
| | | | This function will be used in the future. Okay marius@.
* Remove remaining whiteout tentacles; OK deraadt@ miod@ weingart@millert2005-06-181-12/+1
|
* fix one missed case for removing reverse name cache entries.marius2005-05-281-1/+5
| | | | ok pedro@
* styling nits, ok marius@pedro2005-05-261-10/+10
|
* add a reverse name mapping into the namecache. (vnode->name)marius2005-05-261-23/+126
| | | | | | this will help speedup getcwd (coming soon). ok pedro@
* Fix handling of names bigger than NCHNAMLEN in cache_enter(), okay tedu@pedro2005-03-041-6/+3
|
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-6/+7
| | | | no change in compiler assembly output.
* cacheing -> cachingpedro2004-10-041-3/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* set *vpp to NULL on entry. this provides a good example for other fs.tedu2003-02-251-6/+3
| | | | ok art@
* File system locking fixups, mostly from NetBSD:art2003-01-311-21/+102
| | | | | | | | | | | | | | | - cache_lookup move common code from various fs's here always return with vnode and parent locked adjust return codes - PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode - kernfs and procfs lock vnode in get_root don't unlock (again) in kernfs_freevp fix memory leak in procfs From tedu@stanford.edu deraadt@ and various other ok
* Change all variables definitions (int foo) in sys/sys/*.h to variablemiod2002-07-031-1/+3
| | | | declarations (extern int foo), and compensate in the appropriate locations.