summaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfs_node.c
Commit message (Collapse)AuthorAgeFilesLines
* University of Michigan's Citi NFSv4 kernel client code.Alfred Perlstein2003-11-141-3/+8
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=122698
* Since the addition of the VI_DOINGINACT flag some time ago,Ian Dowse2003-10-051-15/+1
| | | | | | | | | | VOP_INACTIVE routines need not worry about their vnode getting recycled if they block. Remove the code from nfs_inactive() that used vget() to get an extra vnode reference that was held during the nfs_vinvalbuf() call. Notes: svn path=/head/; revision=120812
* - We don't need to cache_purge() in nfs_reclaim(), vclean() does it for us.Jeff Roberson2003-10-051-2/+0
| | | | Notes: svn path=/head/; revision=120786
* Name the vnode method vectors consistently with the rest of the filesystems.Poul-Henning Kamp2003-09-121-1/+1
| | | | | | | This improves the output of src/tools/tools/vop_table Notes: svn path=/head/; revision=120003
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Remove extern declarations of stuff which is static in nfs_node.cPoul-Henning Kamp2002-10-201-0/+3
| | | | | | | | | Move related macro to nfs_node.c Spotted by: FlexeLint Notes: svn path=/head/; revision=105563
* Regularize the vop_stdlock'ing protocol across all the filesystemsKirk McKusick2002-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | that use it. Specifically, vop_stdlock uses the lock pointed to by vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to reference vp->v_lock. Filesystems that wish to use the default do not need to allocate a lock at the front of their node structure (as some still did) or do a lockinit. They can simply start using vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks, but still use the vop_stdlock functions (such as nullfs) can simply replace vp->v_vnlock with a pointer to the lock that they wish to have used for the vnode. Such filesystems are responsible for setting the vp->v_vnlock back to the default in their vop_reclaim routine (e.g., vp->v_vnlock = &vp->v_lock). In theory, this set of changes cleans up the existing filesystem lock interface and should have no function change to the existing locking scheme. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=105077
* - Lock access to the buf lists.Jeff Roberson2002-09-251-3/+3
| | | | | | | | - Use vrefcnt() where appropriate. - Add some locking asserts. Notes: svn path=/head/; revision=103939
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.Nate Lawson2002-09-141-1/+1
| | | | | | | | | | | | | | | v_tag is now const char * and should only be used for debugging. Additionally: 1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK 2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP. Suggested by: phk Reviewed by: bde, rwatson (earlier version) Notes: svn path=/head/; revision=103314
* Convert old style (type foo *)0 casts to NULLsMatthew Dillon2002-07-111-3/+3
| | | | | | | | PR: kern/40360 Requested by: Hiten PAndya via direct email Notes: svn path=/head/; revision=99797
* Remove the nfs_{lock,unlock,islocked} functions and the associatedIan Dowse2002-04-271-86/+0
| | | | | | | | definitions; they have been unused and #if 0'd out since the Lite/2 merge and we are unlikely to want them in the future. Notes: svn path=/head/; revision=95590
* Remove references to vm_zone.h and switch over to the new uma API.Jeff Roberson2002-03-201-7/+8
| | | | Notes: svn path=/head/; revision=92783
* nfs_nget() does no locking whatsoever when looking up a vnode. If theMatthew Dillon2001-12-271-1/+4
| | | | | | | | | | vget() sleeps we have to retry the operation to avoid racing against a deletion. MFC maybe: submitted to re's Notes: svn path=/head/; revision=88541
* Cleanup and split of nfs client and server code.Peter Wemm2001-09-181-60/+33
| | | | | | | This builds on the top of several repo-copies. Notes: svn path=/head/; revision=83651
* KSE Milestone 2Julian Elischer2001-09-121-10/+10
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=83366
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-3/+6
| | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=76166
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-291-2/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-231-0/+2
| | | | Notes: svn path=/head/; revision=75858
* Create debug.hashstat.[raw]nchash and debug.hashstat.[raw]nfsnode toPeter Wemm2001-04-111-0/+79
| | | | | | | | | | | | | | enable easy access to the hash chain stats. The raw prefixed versions dump an integer array to userland with the chain lengths. This cheats and calls it an array of 'struct int' rather than 'int' or sysctl -a faithfully dumps out the 128K array on an average machine. The non-raw versions return 4 integers: count, number of chains used, maximum chain length, and percentage utilization (fixed point, multiplied by 100). The raw forms are more useful for analyzing the hash distribution, while the other form can be read easily by humans and stats loggers. Notes: svn path=/head/; revision=75402
* Use the same API as the example code.Peter Wemm2001-03-201-1/+1
| | | | | | | | | | | | | Allow the initial hash value to be passed in, as the examples do. Incrementally hash in the dvp->v_id (using the official api) rather than add it. This seems to help power-of-two predictable filename trees where the filenames repeat on a power-of-two cycle and the directory trees have power-of-two components in it. The simple add then mask was causing things like 12000+ entry collision chains while most other entries have between 0 and 3 entries each. This way seems to improve things. Notes: svn path=/head/; revision=74501
* Use a generic implementation of the Fowler/Noll/Vo hash (FNV hash).Peter Wemm2001-03-171-28/+2
| | | | | | | | | | | | | | | | | | | | Make the name cache hash as well as the nfsnode hash use it. As a special tweak, create an unsigned version of register_t. This allows us to use a special tweak for the 64 bit versions that significantly speeds up the i386 version (ie: int64 XOR int64 is slower than int64 XOR int32). The code layout is a little strange for the string function, but I was able to get between 5 to 10% improvement over the original version I started with. The layout affects gcc code generation choices and this way was fastest on x86 and alpha. Note that 'CPUTYPE=p3' etc makes a fair difference to this. It is around 45% faster with -march=pentiumpro on a p6 cpu. Notes: svn path=/head/; revision=74384
* Dramatically improve the **lame** nfs_hash(). This is based on thePeter Wemm2001-03-171-8/+16
| | | | | | | | | | | | | | | | Fowler / Noll / Vo Hash (http://www.isthe.com/chongo/tech/comp/fnv/). This improves hash coverage a *massive* amount. We were seeing one set of machines that were using 0.84% of their 131072 entry nfsnode hash buckets with maximum chain lengths of up to ~500 entries. The machine was spending nearly 100% of its time in 'system'. A test with this has pushed the coverage from a few perCent up to 91% utilization with a max chain length of 11. Submitted by: David Filo Notes: svn path=/head/; revision=74381
* In preparation for deprecating CIRCLEQ macros in favor of TAILQKirk McKusick2000-11-141-2/+2
| | | | | | | | macros which provide the same functionality and are a bit more efficient, convert use of CIRCLEQ's in NFS to TAILQ's. Notes: svn path=/head/; revision=68711
* Remove unneeded #include <sys/proc.h> lines.Poul-Henning Kamp2000-10-291-1/+0
| | | | Notes: svn path=/head/; revision=67882
* Add missed vop_stdunlock() for fifo's vnops (this affects only v2 mounts).Boris Popov2000-10-151-0/+1
| | | | | | | Give nfs's node lock its own name. Notes: svn path=/head/; revision=67151
* Convert lockmgr locks from using simple locks to using mutexes.Jason Evans2000-10-041-0/+2
| | | | | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed. Notes: svn path=/head/; revision=66615
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-1/+1
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-1/+1
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Enhance reassignbuf(). When a buffer cannot be time-optimally insertedMatthew Dillon2000-01-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | into vnode dirtyblkhd we append it to the list instead of prepend it to the list in order to maintain a 'forward' locality of reference, which is arguably better then 'reverse'. The original algorithm did things this way to but at a huge time cost. Enhance the append interlock for NFS writes to handle intr/soft mounts better. Fix the hysteresis for NFS async daemon I/O requests to reduce the number of unnecessary context switches. Modify handling of NFS mount options. Any given user option that is too high now defaults to the kernel maximum for that option rather then the kernel default for that option. Reviewed by: Alfred Perlstein <bright@wintelcom.net> Notes: svn path=/head/; revision=55431
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-151-17/+0
| | | | Notes: svn path=/head/; revision=54655
* Fix two problems: First, fix the append seek position race that canMatthew Dillon1999-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | occur due to np->n_size potentially changing if nfs_getcacheblk() blocks in nfs_write(). Second, under -current we must supply the proper bufsize when obtaining buffers that straddle the EOF, but due to the fact that np->n_size can change out from under us it is possible that we may specify the wrong buffer size and wind up truncating dirty data written by another process. Both problems are solved by implementing nfs_rslock(), which allows us to lock around sensitive buffer cache operations such as those that occur when appending to a file. It is believed that this race is responsible for causing dirtyoff/dirtyend and (in stable) validoff/validend to exceed the buffer size. Therefore we have now added a warning printf for the dirtyoff/end case in current. However, we have introduced a new problem which we need to fix at some point, and that is that soft or intr NFS mounts may become uninterruptable from the point of view of process A which is stuck waiting on rslock while process B is stuck doing the rpc. To unstick process A, process B would have to be interrupted first. Reviewed by: Alfred Perlstein <bright@wintelcom.net> Notes: svn path=/head/; revision=54605
* Lock reporting and assertion changes.Eivind Eklund1999-12-111-0/+1
| | | | | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter Notes: svn path=/head/; revision=54444
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Thanks to Bruce for noticing this.... compare against the *new* nfsnode'sMatt Jacob1999-06-191-2/+2
| | | | | | | | | | | mount point for seeing whether or not the new nfsnode is already in the hash queue. We're pretty much guaranteed that the old nfsnode is already in the hash queue. Wank! Infinite Loop! Looks like just a minor typo.... (ah the influence of fortran ... np && np2... why not nfsnode_the_first && nfsnode_the_second???)... Notes: svn path=/head/; revision=48024
* If we retry this operation from the top of this routine, we need toMatt Jacob1999-06-151-1/+5
| | | | | | | | | make sure we've freed any allocated resources (to avoid a memory leak) and and do the right thing with respect to the nfs node hash lock we'd acquired. Notes: svn path=/head/; revision=47938
* Fix a malloc racePeter Wemm1999-06-051-3/+12
| | | | | | | Obtained from: OpenBSD (csapuntz) Notes: svn path=/head/; revision=47750
* Do not need (or want) to take a reference on an NFS file thatKirk McKusick1998-09-291-6/+12
| | | | | | | | | | | | is being deleted due to an forcible unmount. The problem is that vgone calls vclean() which then calls calls nfs_inactive() with VXLOCK set on the vnode. Nfs_inactive() was calling vget() to get a reference on the vnode, which in turn hung on VXLOCK. Nfs_inactive() now checks v_usecount to make sure that the vnode is not coming from vclean() before it does a vget(). Notes: svn path=/head/; revision=39789
* Convert a couple of large allocations to use zones rather than mallocPeter Wemm1998-05-241-14/+9
| | | | | | | | | for better packing. This means that we can choose better values for the various hash entries without having to try and get it all to fit within an artificial power of two limit for malloc's sake. Notes: svn path=/head/; revision=36329
* Add missing arg to vget().. Serves me right for committing a 2.2 patch toPeter Wemm1998-05-131-2/+2
| | | | | | | | | -current without testing it there.. :-( Submitted by: Michael Hancock <michaelh@cet.co.jp> Notes: svn path=/head/; revision=36013
* Hold a reference to the vnode during the sillyrename cleanup. If we blockPeter Wemm1998-05-131-1/+9
| | | | | | | | | | | | | | | | | | in nfs_vinvalbuf() or the nfs_removeit(), we can have the nfsnode reallocated from underneath us (eg: replaced by a ufs 'struct inode') which can cause disk corruption ('freeing free block' when di_db[5] gets trashed). This is not a cheap fix, but it'll do until the nfsnodes get reference counting and/or locking. Apparently NetBSD have a similar fix (apparently from BSDI). I wish all PR's had this much useful detail. :-) PR: 6611 Submitted by: Stephen Clawson <sclawson@marker.cs.utah.edu> Notes: svn path=/head/; revision=35994
* Staticize.Eivind Eklund1998-02-091-4/+4
| | | | Notes: svn path=/head/; revision=33181
* Unspammed nested include of <vm/vm_zone.h>.Bruce Evans1997-12-271-1/+3
| | | | Notes: svn path=/head/; revision=32011
* Don't #include <nfs/nfs.h> in <nfs/nfs_node.h> if KERNEL is defined.Bruce Evans1997-10-281-1/+2
| | | | | | | Fixed everything that depended on the nested include. Notes: svn path=/head/; revision=30808
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.Poul-Henning Kamp1997-10-121-2/+2
| | | | | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde Notes: svn path=/head/; revision=30354
* Distribute and statizice a lot of the malloc M_* types.Poul-Henning Kamp1997-10-111-1/+3
| | | | | | | Substantial input from: bde Notes: svn path=/head/; revision=30309
* Change the M_NAMEI allocations to use the zone allocator. This changeJohn Dyson1997-09-211-2/+2
| | | | | | | | | | | plus the previous changes to use the zone allocator decrease the useage of malloc by half. The Zone allocator will be upgradeable to be able to use per CPU-pools, and has more intelligent usage of SPLs. Additionally, it has reasonable stats gathering capabilities, while making most calls inline. Notes: svn path=/head/; revision=29653
* Removed unused #includes.Bruce Evans1997-08-021-4/+1
| | | | Notes: svn path=/head/; revision=27845
* Fix memory leak caused by the fact that the directory offset cookies andDoug Rabson1997-05-091-4/+4
| | | | | | | the sillyrename information are stored in the same place. Notes: svn path=/head/; revision=25610
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975