summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vnops.c
Commit message (Collapse)AuthorAgeFilesLines
* - cache_lookup() relocks the parent in the DOTDOT case for us.jeff2005-04-141-2/+0
| | | | | Spotted by: phk Sponsored by: Isilon Systems, Inc.
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-3/+2
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - Remove wantparent, it is no longer necessary. An assert in vfs_lookup.cjeff2005-03-291-3/+2
| | | | | prevents any callers from doing a modifying op without LOCKPARENT or WANTPARENT.
* - cache_lookup() now locks the new vnode for us to prevent some races.jeff2005-03-291-38/+18
| | | | | | Remove redundant code. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-45/+10
| | | | | | | | | | | - Network filesystems are written with a special idiom that checks the cache first, and may even unlock dvp before discovering that a network round-trip is required to resolve the name. I believe dvp is prevented from being recycled even in the forced unmount case by the shared lock on the mount point. If not, this code should grow checks for VI_DOOMED after it relocks dvp or it will access NULL v_data fields. Sponsored by: Isilon Systems, Inc.
* - It is no longer necessary to lock and unlock the vnode in nfs_close() asjeff2005-03-131-6/+1
| | | | | | the top level does this for us now. Sponsored by: Isilon Systems, Inc.
* vp->v_id is a private field for the vfs namecache and it is a big mistakephk2005-02-221-13/+9
| | | | | | | that NFS ever started using it. Long time ago I added the necessary vhold()/vdrop() calls to replace it, but forgot to remove the v_id code. Do it now.
* Try to unbreak the vnode locking around vop_reclaim() (based mostly onphk2005-02-191-0/+2
| | | | | | | | | patch from kan@). Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on close. This is not yet a generally safe function, but for this very specific use it is safe. This solves the problem with buffers not being flushed by unmount or after failed mount attempts.
* Style cleanup for O_DIRECT sysctl comment introduced in nfs_vnops.c:1.242.rwatson2005-01-291-8/+9
|
* Create a vnode_pager object when a file is opened.phk2005-01-241-0/+1
|
* Remove unused cred arg from nfs_vinvalbuf() and many bogus argumentsphk2005-01-241-12/+9
| | | | passed for it.
* Add BO_SYNC() and add a default which uses the secret vnode pointerphk2005-01-111-0/+1
| | | | and VOP_FSYNC() for now.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-7/+7
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Turn NFS directio off until the stability issues are resolved.ps2004-12-231-1/+1
|
* Change the NFS sillyrename convention so that we won't run outps2004-12-161-11/+17
| | | | | | | | | | | | of sillyrenames (which were limited to 58 per pid per directory, for no good reason). The new format of sillyrenames looks like .nfs.0000b31a.00d24.4 ^^^^^^^^ ^^^^^ ticks pid Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* First cut of NFS direct IO support.ps2004-12-151-0/+39
| | | | | | | | | | | | | | - NFS direct IO completely bypasses the buffer and page caches. If a file is open for direct IO all caching is disabled. - Direct IO for Directories will be addressed later. - 2 new NFS directio related sysctls are added. One is a knob to disable NFS direct IO completely (direct IO is enabled by default). The other is to disallow mmaped IO on a file that has at least one O_DIRECT open (see the comment in nfs_vnops.c for more details). The default is to allow mmaps on a file that has O_DIRECT opens. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Revert rev 1.233. The null-pointer function call (a dereference onmarcel2004-12-111-3/+3
| | | | | | | | | ia64) was not the result of a change in the vector operations. It was caused by the NFS locking code using a FIFO and those bypassing the vnode. This indirectly caused the panic. The NFS locking code has been changed. Requested by: phk
* In nfs_rename(), skip the otw rename operation if the fsync (tops2004-12-101-3/+10
| | | | | | | | either src or dst) fails. This closes a potential data loss case (where the fsync failed with ENOSPC, for example). Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Store a hint in the nfsnode to detect sequential access of the file.ps2004-12-101-0/+1
| | | | | | | | Kick off a readahead only when sequential access is detected. This eliminates wasteful readaheads in random file access. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Fix for a Lock Order Reversal in the nfs_flush() path, between theps2004-12-071-4/+8
| | | | | | | vnode interlock and the proc lock. Reported by: marcel Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Rewrite of the NFS client's reply handling. We now have NFS socketps2004-12-061-0/+1
| | | | | | | | upcalls which do RPC header parsing and match up the reply with the request. NFS calls now sleep on the nfsreq structure. This enables us to eliminate the NFS recvlock. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* 2 fixes that improve on the consistency of the NFS client cache.ps2004-12-061-8/+13
| | | | | | | | | | | - Change the cached mtime to a 'struct timespec' from a time_t. Improving the precision of the cached mtime tightens up NFS' "close-to-open" consistency considerably. - Always force an over-the-wire consistency check from nfs_open() (unless the file is marked modified). This further improves NFS' "close-to-open" consistency. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Serialize NFS vinvalbuf operations by acquiring/upgrading to theps2004-12-061-2/+0
| | | | | | | | | | | | | vnode EXCLUSIVE lock. This prevents threads from adding pages to the vnode while an invalidation is in progress, closing potential races. In the bioread() path, callers acquire the SHARED vnode lock - so while an invalidate was in progress, it was possible to fault in new pages onto the vnode causing the invalidation to take a while or fail. We saw these races at Yahoo! with very large files+heavy concurrent access. Forcing an upgrade to EXCLUSIVE lock before doing the invalidation closes all these races. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* - If all data has been committed to stable storage on the server, itps2004-12-061-3/+7
| | | | | | | | | | is safe to turn off the nfsnode's NMODIFIED flag. - Move the check for signals to the top of the loop where we loop around the dirty buffers on the vnode, scheduling writes. This ensures that we'll break ouf of the flush operation on reception of a signal. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Fix null-pointer indirect function calls introduced in the previousmarcel2004-12-051-3/+3
| | | | | | | | | | | | commit. In the new world order, the transitive closure on the vector operations is not precomputed. As such, it's unsafe to actually use any of the function pointers in an indirect function call. They can be null, and we need to use the default vector in that case. This is mostly a quick fix for the four function pointers that are ed explicitly. A more generic or scalable solution is likely to see the light of day. No pathos on: current@
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-011-55/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
* Scripted modification of vop_* prototypes to use typedefs.phk2004-12-011-25/+25
|
* Add missing #includephk2004-12-011-0/+1
|
* Fix for a race between lookup and readdirplus, that causesps2004-12-011-0/+28
| | | | | | | | | | | a deadlock (with NFS exclusive vnode locks enabled). Lookup grabs the parent's lock and wants to lock child. Readdirplus locks the child and wants to lock parent (for loading the attrs for ".."). The fix is to not load the attrs for ".." in readdirplus. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Clean all dirty pages (dirtied by mmap'ed writes) in nfs_close().ps2004-12-011-0/+18
| | | | | | | | | | This closes a major hole in close-to-open consistency support. Added a new sysctl so that this can be disabled for single NFS client applications with very large amounts of mmap'ed IO (for performance). Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Fix for a bug in nfs_mkdir() that called vrele() instead of vput()ps2004-11-291-2/+2
| | | | | | | in the error cases, causing panics. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Move the buffer method vector (buf->b_op) to the bufobj.phk2004-10-241-1/+18
| | | | | | | | | | | | | | | | | Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
* Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.phk2004-10-221-7/+5
| | | | | | | | | | | | | | | | | | Initialize b_bufobj for all buffers. Make incore() and gbincore() take a bufobj instead of a vnode. Make inmem() local to vfs_bio.c Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj) also VI_MTX() to BO_MTX(), Make buf_vlist_add() take a bufobj instead of a vnode. Eliminate other uses of bp->b_vp where bp->b_bufobj will do. Various minor polishing: remove "register", turn panic into KASSERT, use new function declarations, TAILQ_FOREACH_SAFE() etc.
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITphk2004-10-211-15/+9
| | | | | | | | | | Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write count on a bufobj. Bufobj_wdrop() replaces vwakeup(). Use these functions all relevant places except in ffs_softdep.c where the use if interlocked_sleep() makes this impossible. Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
* Remove support for using NFS device nodes.phk2004-09-281-89/+2
|
* Remove unused B_WRITEINPROG flagphk2004-09-151-8/+3
|
* Explicitly pass vnode to nfs_doio() and mountpoint to nfs_asyncio().phk2004-09-071-4/+2
|
* Eliminate unused second argument to reassignbuf() and simplify itphk2004-07-251-1/+1
| | | | accordingly.
* NFS mobility PHASE I, II & III (phase VI, and V pending):alfred2004-07-061-12/+11
| | | | | | | | | | | | | | | Rebind the client socket when we experience a timeout. This fixes the case where our IP changes for some reason. Signal a VFS event when NFS transitions from up to down and vice versa. Add a placeholder vfs_sysctl where we will put status reporting shortly. Also: Make down NFS mounts return EIO instead of EINTR when there is a soft timeout or force unmount in progress.
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Flush cached access mode after modifying a files attributes forpeadar2004-04-031-0/+2
| | | | | | | | | | NFSv3. It's likely that modifying the attributes will affect the file's accessibility. This version of the patch is one suggested by Ian Dowse after reviewing my original attempt in the PR Reviewed By: iedowse PR: kern/44336 MFC after: 3 days
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathphk2004-03-111-1/+1
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* University of Michigan's Citi NFSv4 kernel client code.alfred2003-11-141-0/+3
| | | | Submitted by: Jim Rees <rees@umich.edu>
* Stop using shared locks for nfs vop locks.alfred2003-11-111-3/+0
| | | | | | | | | | | | | The reason this was done was to avoid a race to the root when an NFS server went down. However a semi-recent change to the way that the kernel's lookup() routine traverses mount points prevents this. Rev 1.39 of vfs_lookup.c changed the ordering of locks such that we aquire a shared lock on the mount point being accessed and then drop the directory vnode lock before requesting the target lock. With that in place we no longer need shared locks for NFS to prevent race to the root lockups.
* DuH!phk2003-10-181-1/+1
| | | | | bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in the file)
* Initialize bp->b_offset before calling VOP_STRATEGY().phk2003-10-181-3/+1
| | | | Remove KASSERTS and panics with B_PHYS checks which no longer apply.
* Name the vnode method vectors consistently with the rest of the filesystems.phk2003-09-121-15/+15
| | | | This improves the output of src/tools/tools/vop_table
* KNF: parentheses around return values.dds2003-09-041-4/+4
| | | | | | Suggested by: bde Approved by: schweikh (mentor - blanket) MFC after: 6 weeks
* Fix errno return values to better represent failure reasons fordds2003-09-021-4/+9
| | | | | | | | read and open. Approved by: schweikh (mentor) Agreed: bde MFC after: 6 weeks
OpenPOWER on IntegriCloud