summaryrefslogtreecommitdiffstats
path: root/sys/fs/nwfs
Commit message (Collapse)AuthorAgeFilesLines
* Locking for the per-process resource limits structure.jhb2004-02-041-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* Remove useless SMP check code.des2003-12-071-10/+0
|
* Don't mess around with spare fields of public structures.phk2003-11-121-1/+0
|
* Initialize b_offset before calling VOP_STRATEGY/VOP_SPECSTRATEGY.phk2003-10-181-1/+0
| | | | | Remove various comments of KASSERTS and comments about B_PHYS which does not apply anymore.
* Convert some if(bla) panic("foo") to KASSERTS to improve grep-ability.phk2003-10-181-2/+1
|
* - Don't cache_purge() in *_reclaim routines. vclean() does it for us sojeff2003-10-051-1/+0
| | | | this is redundant.
* Synchronize access to a vm page's valid field using the containingalc2003-10-041-4/+2
| | | | vm object's lock.
* - Remove the backtrace() call from the *_vinvalbuf() functions. Thanks to ajeff2003-10-041-5/+1
| | | | | | | | stack trace supplied by phk, I now understand what's going on here. The check for VI_XLOCK stops us from calling vinvalbuf once the vnode has been partially torn down in vclean(). It is not clear that this would cause a problem. Document this in nfs_bio.c, which is where the other two filesystems copied this code from.
* - Remove interlock protection around VI_XLOCK. The interlock is notjeff2003-09-191-3/+3
| | | | | | | | | | | | | sufficient to guarantee that this race is not hit. The XLOCK will likely have to be redesigned due to the way reference counting and mutexes work in FreeBSD. We currently can not be guaranteed that xlock was not set and cleared while we were blocked on the interlock while waiting to check for XLOCK. This would lead us to reference a vnode which was not the vnode we requested. - Add a backtrace() call inside of INVARIANTS in the hopes of finding out if this condition is ever hit. It should not, since we should be retaining a reference to the vnode in these cases. The reference would be sufficient to block recycling.
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-2/+2
| | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place.
* Lock the vm object when freeing a vm page.alc2003-06-191-1/+7
|
* Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementationsphk2003-06-151-0/+2
| | | | to check that the buffer points to the correct vnode.
* Initialize struct vfsops C99-sparsely.phk2003-06-121-23/+17
| | | | | Submitted by: hmp Reviewed by: phk
* Specify the M_WAITOK flag explicitly in the MALLOC call to silence atjr2003-04-011-1/+2
| | | | runtime warning ("Bad malloc flags: 0").
* Rename vfs_stdsync function to vfs_stdnosync which matches morekan2003-03-111-52/+1
| | | | | | | | | | | | | closely what function is really doing. Update all existing consumers to use the new name. Introduce a new vfs_stdsync function, which iterates over mount point's vnodes and call FSYNC on each one of them in turn. Make nwfs and smbfs use this new function instead of rolling their own identical sync implementations. Reviewed by: jeff
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-1/+1
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-3/+3
|
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-5/+5
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-1/+1
|
* Copy some VM changes from smbfs_putpages() to nwfs_putpages(): locktjr2003-02-271-1/+3
| | | | page queues, use vm_page_undirty().
* Fix vnode corruption bug when trying to rename files across filesystems.tjr2003-02-271-10/+13
| | | | Similar to the bug fixed in smbfs_vnops.c rev 1.33.
* Sync nwfs_access() with smbfs_access(): use vaccess() instead of checkingtjr2003-02-271-13/+5
| | | | permissions ourself, fixes problem with VAPPEND.
* Catch up with recent netncp changes: ncp_chkintr() takes a thread, nottjr2003-02-271-1/+1
| | | | a proc, as its second argument.
* Back out M_* changes, per decision of the TRB.imp2003-02-192-2/+2
| | | | Approved by: trb
* Split the global timezone structure into two integer fields tophk2003-02-031-2/+2
| | | | | | | | | | prevent the compiler from optimizing assignments into byte-copy operations which might make access to the individual fields non-atomic. Use the individual fields throughout, and don't bother locking them with Giant: it is no longer needed. Inspired by: tjr
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-212-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-041-3/+0
| | | | | | | kern/vfs_defaults.c it is wrong for the individual filesystems to use the std* functions as that prevents override of the default. Found by: src/tools/tools/vop_table
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Return ENOTTY on unrecognized ioctls.phk2002-09-261-1/+1
|
* - Use vrefcnt() where it is safe to do so instead of doing direct andjeff2002-09-253-9/+9
| | | | | | | unlocked accesses to v_usecount. - Lock access to the buf lists in the various sync routines. interlock locking could be avoided almost entirely in leaf filesystems if the fsync function had a generic helper.
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-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)
* Add a missing #include <sys/lockmgr.h>.iedowse2002-09-011-0/+1
|
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-044-7/+12
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* o Lock page queue accesses in nwfs and smbfs.alc2002-08-021-0/+4
| | | | o Assert that the page queues lock is held in vm_page_deactivate().
* More s/file system/filesystem/gtrhodes2002-05-162-6/+6
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-273-9/+9
| | | | reference.
* 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
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-102-3/+3
| | | | also don't use ANSI string concatenation.
* Change the vnode list under the mount point from a LIST to a TAILQdillon2001-10-231-2/+2
| | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days
* KSE Milestone 2julian2001-09-129-215/+218
| | | | | | | | | | | | | | 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
* Protect the mnt_vnode list with the mntvnode lock.jhb2001-06-281-4/+15
|
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-132-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* - sys/n[tw]fs moved to sys/fs/n[tw]fsru2001-05-267-20/+20
| | | | - /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-22/+3
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
* Implement vop_std{get|put}pages() and add them to the default vop[].phk2001-05-011-4/+2
| | | | | Un-copy&paste all the VOP_{GET|PUT}PAGES() functions which do nothing but the default.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-5/+8
| | | | | | | | | | | 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)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-25/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* vnode_pager_freepage() is really vm_page_free() in disguise,alfred2001-04-191-2/+2
| | | | nuke vnode_pager_freepage() and replace all calls to it with vm_page_free()
* Add dependancy on libmchain module.bp2001-03-221-0/+1
| | | | Spotted by: Andrzej Tobola <san@iem.pw.edu.pl>
* Do not kill vnodes after rename. This can cause deadlocks in the deadfs.bp2001-03-111-6/+2
| | | | Noticed by: Matthew N. Dodd <winter@jurai.net>
OpenPOWER on IntegriCloud