summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_node.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-3/+2
| | | | OK mpi@
* Implement proper locking for NFS nodes.mpi2018-05-051-2/+9
| | | | Tested in bulks by many. ok visa@, beck@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-2/+2
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Change the representation of an NFS mount point by caching the rootmpi2018-04-091-13/+1
| | | | | | | | | | | | | | | nodes. nfs_root() now returns a "locked" vnode, so vput(9) must be called to release it. Note that this has currently no effect as nfs_lock/unlock are still stubs. This will prevent some lock odering problems with upcoming NFSnode locking. Tested by landry@, sthen@, visa@, naddy@ and myself. From NetBSD with some tweaks, ok visa@
* Check for possible race after sleeping instead of using a rwlock tompi2018-03-281-15/+7
| | | | | | | | protect insertions in `nm_ntree'. This will prevent a future lock ordering problem with NFSnode's lock. ok tedu@, visa@
* replace the use of RB macros with the RBT functions.dlg2016-09-271-7/+13
|
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-2/+2
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* sync a function's comment with its signaturemmcc2016-02-091-4/+3
| | | | ok tedu@, with a slight tweak
* 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@
* to be safe, revert locking change until further tested.tedu2014-12-231-9/+5
|
* optimize locking a wee bit by holding it for critical parts onlytedu2014-12-231-5/+9
|
* 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
* add sizes for free(ptr, sizeof(*ptr)). use sizeof(*ptr) for malloc sizes.tedu2014-11-151-2/+2
|
* remove uneeded proc.h includesjsg2014-09-141-2/+2
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* Bring back the "End the VOP experiment." diff, naddy's issues wherethib2010-12-211-3/+5
| | | | | | unrelated, and his alpha is much happier now. OK deraadt@
* Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)thib2010-09-101-5/+3
| | | | have been resolved.
* End the VOP experiment. Instead of the ridicolusly complicated operationthib2010-09-061-3/+5
| | | | | | | | | | | | | | | | | | | vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.
* No "\n" needed at the end of panic() strings.krw2010-08-071-3/+3
| | | | | | | Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
* This fixes a case where we could panic on a null deref with a bad vnodebeck2009-12-171-6/+32
| | | | | | | | | | | | | | | | | | | in nfs_inactive, on a reboot. The core of the problem was in nfs_nget, when we lose the race to put a new nfsnode in the tree, we have previously allocated a vnode, which getnewvnode has done an insmntque into the nfs mp's mntlist. The problem being we then try again with a new vnode, abandoning this one on the mntlist, leaving junk there for us to die on when we unmount. This introduces VLARVAL - so we can indicate in a vnode that the higher level stuff hiding in v_data is incompletely set up. This flag is then used by nfs to deal with a halfway set up vnode and release it correctly. analysis and bogus fix by art@, correct fix by me after serveral failed attempts and much painful testing by krw@, good suggestions by tedu and miod ok krw@ oga@ thib@ blambert@ art@
* back out previous fix, apparently neither art or i can fix anything right on the first trybeck2009-12-151-2/+1
| | | | vgone doesn't work in other cases of this. I must fix this slightly differntly
* This fixes a case where we could panic on a null deref with a bad vnodebeck2009-12-151-1/+2
| | | | | | | | | | | | | | | in nfs_inactive, on a reboot. The core of the problem was in nfs_nget, when we lose the race to put a new nfsnode in the tree, we have previously allocated a vnode, which getnewvnode has done an insmntque into the nfs mp's mntlist. The problem being we then try again with a new vnode, abandoning this one on the mntlist, leaving junk there for us to die on when we unmount. analysis and bogus fix by art@, correct fix by me. much painful testing by krw@ ok oga@, art@
* Use the nfs_hashlock to protect the nfs_nodetree hanging of the mount.thib2009-08-141-9/+27
| | | | | | | | | | | | | | | What can happen is that a recycling of a vnode could pull one from out under us (since NFS has issues with ref counts...). Dance around getnewvnode() since we can end up recycling vnodes that where formerly owned by NFS, causing recursive locking. We where lucky with the old hashtables has the race was rare but now with more aggresive recycling we loose, just as theo found out on vax. help from oga, beck and blambert (beck mostly screamed though). ok oga@, beck@, blambert@
* tiny knf and use curproc directly instead of a setting up a local procthib2009-08-111-10/+6
| | | | | | pointer since its just used in one place. ok blambert@
* Use an RB tree instead of a hashtable for fh/node lookups.thib2009-08-101-51/+44
| | | | | | Idea from NetBSD. OK blambert@
* (struct foo *)0 -> NULL, every where I could find it.thib2009-07-201-3/+3
| | | | OK blambert@
* Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tthib2008-12-241-4/+1
| | | | | | | hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
* small indent fixthib2008-12-231-9/+8
|
* o nfs_vinvalbuf() is always called with the intrflag as 1, and thenthib2008-08-091-2/+2
| | | | | | | | | | checks if the mount is actually interrutable, and if not sets it 0. remove this argument from nfs_vinvalbuf and just do the checking inside the function. o give nfs_vinvalbuf() a makeover so it looks nice. (spacing, casts, &c); o Actually pass PCATCH too tsleep() if the mount it interrutable. ok art@, blambert@
* Remove code for variable-sized allocations of NFS filehandles by malloc(),blambert2008-08-081-9/+2
| | | | | | | as it was never used because there were 64-bit buffers already allocated for filehandles in nfsnode structs. ok thib@
* A bunch of pool_get() + bzero() -> pool_get(..., .. | PR_ZERO)mk2008-06-141-3/+2
| | | | | | | conversions that should shave a few bytes off the kernel. ok henning, krw, jsing, oga, miod, and thib (``even though i usually prefer FOO|BAR''; thanks for looking.
* Canonical for() -> queue.h FOREACH macro conversions.blambert2008-06-111-2/+3
| | | | | | | | | Also, it is historical practice to #include <sys/queue.h> when using queue.h macros. ok thib@ krw@ special thanks to krw@ for reminders vice violence
* o Avoid putting duplicate entries into the name cache,thib2008-06-101-1/+2
| | | | | | | | | | | | | | | | add a function to handle cache_enter()'s for us since we need to update the appropriate timestamps so we don't miss on lookup; o Do not purge the dvp in nfs_rmdir(), since there's no need; o cache the new entry created in nfs_mkdir(); o Do caching of the access modes, this drastically reduces the amount of over the wire access RPCs we do in the NFSv3 case. This diff was written by Pedro Martelletto, sometime in 2004. A lot of people have been running with it at one time or another, this includes at least markus and matthieu. OK deraadt@, blambert@
* Garbage collect nfsdmap and leftover code. That structurethib2007-12-131-18/+3
| | | | | | | was used as a part of the "old-style directory caching" that was removed in 2001; ok beck@, blambert@
* MALLOC/FREE -> malloc/free + M_ZERO.thib2007-09-201-3/+3
| | | | | | Uneeded includes and casts... ok krw@
* pedro ok'd this ~3500 line diff which removes the vop argumentderaadt2007-06-011-8/+3
| | | | | "ap = v" comments in under 8 seconds, so it must be ok. and it compiles too.
* Add a name argument to the RWLOCK_INITIALIZER macro.thib2007-05-291-2/+2
| | | | | | Pick reasonble names for the locks involved.. ok tedu@, art@
* lockmgr -> rwlock for the nfs_hashlock.thib2007-05-281-7/+6
| | | | ok tedu@
* add a name to rwlock so that we can tell where procs are getting stucktedu2006-05-071-2/+2
| | | | | | without breaking into ddb. doubles the size of rwlock [1], but moving forward this really helps. ok/tested pedro fgsch millert krw [1 - next person to add a field to this struct gets whipped with a wet noodle]
* Put vprint() under DIAGNOSTIC, as to save space in generated ramdisks.pedro2006-01-091-1/+7
| | | | Inspiration from miod@, okay deraadt@. Tested on i386, macppc and amd64.
* Use NULL where NULL is meantpedro2005-11-191-2/+2
|
* Remove unnecessary lockmgr() archaism that was costing too much in termspedro2005-11-191-4/+4
| | | | | | of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-2/+2
| | | | no change in compiler assembly output.
* NFS commit coalescion: instead of sending a commit for each block, coalescemarius2004-08-031-1/+3
| | | | | | | | these into larger ranges wherever possible. this should speed up NFS writes quite a bit. ok art@ millert@ pedro@ tedu@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* use hash.h for nfs_hash as well as namei's hashericj2002-07-021-20/+4
| | | | ok art@ costa@
* First round of __P removal in sysmillert2002-03-141-2/+2
|
* Sigh. The diff is out for testing for three months without a single problem.art2002-02-231-25/+11
| | | | | Two days after commit people report serious lockups all over the place. Back out nfs locking changes.
* More locking in the NFS codecsapuntz2002-02-221-11/+25
|
* Pool deals fairly well with physical memory shortage, but it doesn't dealart2002-01-231-2/+2
| | | | | | | | | | | | | | | | | | well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.