summaryrefslogtreecommitdiff
path: root/sys/coda/coda_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/codaRobert Watson2007-07-121-573/+0
| | | | | | | | | | | | | by removing files from src/sys/coda, and updating include paths in the new location, kernel configuration, and Makefiles. In one case add $FreeBSD$. Discussed with: anderson, Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Repo-copy madness: simon Notes: svn path=/head/; revision=171416
* - The VI_DOOMED flag now signals the end of a vnode's relationship withJeff Roberson2005-03-131-1/+1
| | | | | | | | | the filesystem. Check that rather than VI_XLOCK. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=143510
* Start each of the license/copyright comments with /*-Warner Losh2005-01-051-2/+2
| | | | Notes: svn path=/head/; revision=139745
* When we traverse the vnodes on a mountpoint we need to look out forPoul-Henning Kamp2004-07-041-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our cached 'next vnode' being removed from this mountpoint. If we find that it was recycled, we restart our traversal from the start of the list. Code to do that is in all local disk filesystems (and a few other places) and looks roughly like this: MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp...); (vp = nvp) != NULL; nvp = TAILQ_NEXT(vp,...)) { if (vp->v_mount != mp) goto loop; MNT_IUNLOCK(mp); ... MNT_ILOCK(mp); } MNT_IUNLOCK(mp); The code which takes vnodes off a mountpoint looks like this: MNT_ILOCK(vp->v_mount); ... TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes); ... MNT_IUNLOCK(vp->v_mount); ... vp->v_mount = something; (Take a moment and try to spot the locking error before you read on.) On a SMP system, one CPU could have removed nvp from our mountlist but not yet gotten to assign a new value to vp->v_mount while another CPU simultaneously get to the top of the traversal loop where it finds that (vp->v_mount != mp) is not true despite the fact that the vnode has indeed been removed from our mountpoint. Fix: Introduce the macro MNT_VNODE_FOREACH() to traverse the list of vnodes on a mountpoint while taking into account that vnodes may be removed from the list as we go. This saves approx 65 lines of duplicated code. Split the insmntque() which potentially moves a vnode from one mount point to another into delmntque() and insmntque() which does just what the names say. Fix delmntque() to set vp->v_mount to NULL while holding the mountpoint lock. Notes: svn path=/head/; revision=131551
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.Alexander Kabaev2003-11-051-3/+3
| | | | | | | | | | | | | Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to operate on this mutex transparently. Eventually new mutex will be protecting more fields in struct mount, not only vnode list. Discussed with: jeff Notes: svn path=/head/; revision=122091
* Include <sys/mutex.h>. Don't depend on namespace pollution in <sys/vnode.h>.Bruce Evans2003-10-051-2/+1
| | | | | | | | Fixed a nearby style bug. The include of vcoda.h used angle brackets and was not used. Notes: svn path=/head/; revision=120794
* - Check XLOCK prior to accessing v_data.Jeff Roberson2003-10-051-0/+6
| | | | Notes: svn path=/head/; revision=120784
* - Make proper use of the mntvnode_mtx. We do not need the loop labelJeff Roberson2003-10-041-3/+5
| | | | | | | | because we do not drop the mntvnode_mtx. If this code had ever executed and hit the loop condition it would have spun forever. Notes: svn path=/head/; revision=120735
* Add support for the Coda 6.x venus<->kernel interface. This extendsTim J. Robbins2003-09-071-45/+44
| | | | | | | | | | | | | | | | | FIDs to be 128-bits wide and adds support for realms. Add a new CODA_COMPAT_5 option, which requests support for the old Coda 5.x interface instead of the new one. Create a new coda5.ko module that supports the 5.x interface, and make the existing coda.ko module use the new 6.x interface. These modules cannot both be loaded at the same time. Obtained from: Jan Harkes & the coda-6.0.2 distribution, NetBSD (drochner) (CODA_COMPAT_5 option). Notes: svn path=/head/; revision=119832
* Use __FBSDID().David E. O'Brien2003-06-101-5/+4
| | | | Notes: svn path=/head/; revision=116173
* - Use vrefcnt() instead of directly accessing v_usecount.Jeff Roberson2002-09-251-8/+8
| | | | Notes: svn path=/head/; revision=103937
* - Replace v_flag with v_iflag and v_vflagJeff Roberson2002-08-041-2/+4
| | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=101308
* More s/file system/filesystem/gTom Rhodes2002-05-161-1/+1
| | | | Notes: svn path=/head/; revision=96755
* Don't put a line break in string literals. GCC 3.1 complains and GCCMarcel Moolenaar2002-04-201-13/+10
| | | | | | | 3.2 drops the ball. Notes: svn path=/head/; revision=95094
* Change the vnode list under the mount point from a LIST to a TAILQMatthew Dillon2001-10-231-2/+2
| | | | | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days Notes: svn path=/head/; revision=85339
* Backed out vestiges of the quick fixes for the transient breakage ofBruce Evans2001-10-131-1/+0
| | | | | | | | <sys/mount.h> in rev.1.106 of the latter (don't include <sys/socket.h> just to work around bugs in <sys/mount.h>). Notes: svn path=/head/; revision=84873
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-2/+2
| | | | | | | | | | | | | | 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
* fix it so it compiles againMatt Jacob2001-04-231-0/+2
| | | | Notes: svn path=/head/; revision=75877
* Mechanical change to use <sys/queue.h> macro API instead ofPoul-Henning Kamp2001-02-041-2/+2
| | | | | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=71999
* Delete unused #include <sys/select.h>.Garrett Wollman2001-01-091-1/+0
| | | | Notes: svn path=/head/; revision=70833
* Remove unneeded #include <sys/proc.h> lines.Poul-Henning Kamp2000-10-291-1/+0
| | | | Notes: svn path=/head/; revision=67882
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Remove the RCS "Log" and all the verbiage it has generated.Poul-Henning Kamp1999-07-211-177/+3
| | | | Notes: svn path=/head/; revision=48960
* Clean up the KLD/LKM goop a bit.Peter Wemm1999-01-171-5/+7
| | | | Notes: svn path=/head/; revision=42763
* Venus must be passed O_CREAT flag on VOP_OPEN iff this isRobert V. Baron1998-10-281-17/+6
| | | | | | | | | a creat so that we can will allow a mode 444 file to be written into. Sync with the latest coda.h and deal with collateral damage. Notes: svn path=/head/; revision=40706
* Fixes for lkm:Robert V. Baron1998-09-291-2/+7
| | | | | | | | 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL 2. don't pass -DCODA to lkm build Notes: svn path=/head/; revision=39778
* Put "stray" printouts under DIAGNOSTIC. Make everything buildRobert V. Baron1998-09-251-3/+11
| | | | | | | | with DEBUG on. Add support for lkm. (The macro's don't work for me; for a good chuckle look at the end of coda_fbsd.c.) Notes: svn path=/head/; revision=39650
* Finish conversion of cfs -> codaRobert V. Baron1998-09-131-7/+11
| | | | Notes: svn path=/head/; revision=39126
* All the references to cfs, in symbols, structs, and stringsRobert V. Baron1998-09-111-134/+133
| | | | | | | have been changed to coda. (Same for CFS.) Notes: svn path=/head/; revision=39085
* Clean LINTRobert V. Baron1998-09-061-3/+7
| | | | Notes: svn path=/head/; revision=38884
* Pass2 completeRobert V. Baron1998-09-021-50/+36
| | | | Notes: svn path=/head/; revision=38759
* Very Preliminary CodaRobert V. Baron1998-08-291-0/+750
Notes: svn path=/cvs2svn/branches/CODA/; revision=38625