aboutsummaryrefslogtreecommitdiff
path: root/sys/coda
Commit message (Collapse)AuthorAgeFilesLines
* Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/codaRobert Watson2007-07-1221-7102/+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
* Fix ioctls on the control vnode: ioctls on a character device fail withRobert Watson2007-07-111-1/+1
| | | | | | | | | | | ENOTTY. Make the control vnode a regular file so that ioctls are passed through to our kernel module. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Notes: svn path=/head/; revision=171379
* Avoid a panic in insmntque when we pass a NULL mount: this reenablesRobert Watson2007-07-111-7/+1
| | | | | | | | | | | | some previously disabled code which according to the comment caused a problem during shutdown. But even that is still better than triggering a kernel panic whenever venus is started. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Notes: svn path=/head/; revision=171378
* Replace CODA_OPEN with CODA_OPEN_BY_FD: coda_open was disabled becauseRobert Watson2007-07-116-131/+54
| | | | | | | | | | | | | | we can't open container files by device/inode number pair anymore. Replace the CODA_OPEN upcall with CODA_OPEN_BY_FD, where venus returns an open file descriptor for the container file. We can then grab a reference on the vnode coda_psdev.c:vc_nb_write and use this vnode for further accesses to the container file. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Notes: svn path=/head/; revision=171377
* Resolve Coda mount failing because Coda failed to match the deviceRobert Watson2007-07-111-8/+4
| | | | | | | | | | | operations. But we don't have to, if we find the coda_mntinfo structure for this device in our linked list, we know the device is good. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Notes: svn path=/head/; revision=171375
* Avoid crash when opening Coda device: when allocating coda_mntinfo, weRobert Watson2007-07-112-7/+10
| | | | | | | | | | | need to initialize dev so that we can actually find the allocated coda_mntinfo structure later on. Submitted by: Jan Harkes <jaharkes@cs.cmu.edu> Approved by: re (kensmith) Notes: svn path=/head/; revision=171374
* Remove now-stale 00READ file in the Coda tree; rvb isn't the currentRobert Watson2007-07-111-15/+0
| | | | | | | | | contact for the Coda kernel module in FreeBSD. Approved by: re (kensmith) Notes: svn path=/head/; revision=171360
* Revert UF_OPENING workaround for CURRENT.Konstantin Belousov2007-05-311-3/+3
| | | | | | | | | | | | Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation argument from being file descriptor index into the pointer to struct file. Proposed and reviewed by: jhb Reviewed by: daichi (unionfs) Approved by: re (kensmith) Notes: svn path=/head/; revision=170152
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionKonstantin Belousov2007-05-182-3/+3
| | | | | | | | | function calls are no more generated for vop_lock. Rename _vop_lock to vop_lock1 to satisfy tools/vnode_if.awk assumption about vop naming conventions. This restores pre/post-condition calls. Notes: svn path=/head/; revision=169671
* Make insmntque() externally visibile and allow it to fail (e.g. duringTor Egge2007-03-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib Notes: svn path=/head/; revision=167497
* coda_vptofh is never defined nor used.Pawel Jakub Dawidek2007-02-021-1/+0
| | | | Notes: svn path=/head/; revision=166429
* change vop_lock handling to allowing tracking of callers' file and line forKip Macy2006-11-132-3/+3
| | | | | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson) Notes: svn path=/head/; revision=164248
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* CODA_COMPAT_5 may not be defined unconditionally in the coda5 module.Yaroslav Tykhiy2006-02-271-1/+6
| | | | | | | | | | | | | | | Otherwise a kernel build would break in the coda5 module if the main kernel conf file enabled CODA_COMPAT_5, too. Redefined symbols are strictly disallowed by -Werror. To overcome this issue, introduce a different symbol indicating coda5 build, CODA5_MODULE, and translate it to CODA_COMPAT_5 appropriately in /sys/coda/coda.h. MFC after: 3 days Notes: svn path=/head/; revision=156062
* - Reorder calls to vrele() after calls to vput() when the vrele is aJeff Roberson2006-02-011-12/+9
| | | | | | | | | | | | | | | directory. vrele() may lock the passed vnode, which in these cases would give an invalid lock order of child -> parent. These situations are deadlock prone although do not typically deadlock because the vrele is typically not releasing the last reference to the vnode. Users of vrele must consider it as a call to vn_lock() and order it appropriately. MFC After: 1 week Sponsored by: Isilon Systems, Inc. Tested by: kkenn Notes: svn path=/head/; revision=155160
* Convert last four functions in coda_vnops.c to ANSI C functionRobert Watson2006-01-211-14/+6
| | | | | | | | | | declarations. I knew I would get to fix something in Coda eventually. MFC after: 1 week Notes: svn path=/head/; revision=154647
* o Fix typo in the define: s/MRAK_INT_GEN/MARK_INT_GEN/. The typoMaxim Konovalov2006-01-091-1/+1
| | | | | | | | | was harmless because the define is not used in coda_vfsops.c. Submitted by: Hugo Meiland Notes: svn path=/head/; revision=154144
* Fix -Wundef from compiling the amd64 LINT.Ruslan Ermilov2005-12-041-1/+1
| | | | Notes: svn path=/head/; revision=153084
* Normalize a significant number of kernel malloc type names:Robert Watson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names. Notes: svn path=/head/; revision=151897
* Merge the dev_clone and dev_clone_cred event handlers into a singleRobert Watson2005-08-081-3/+4
| | | | | | | | | | | | | | | | event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs. This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules. Requested by: phk MFC after: 3 days Notes: svn path=/head/; revision=148868
* - Change all filesystems and vfs_cache to relock the dvp once the child isJeff Roberson2005-04-131-0/+1
| | | | | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=145006
* Explicitly hold a reference to the cdev we have just cloned. ThisPoul-Henning Kamp2005-03-311-0/+1
| | | | | | | | closes the race where the cdev was reclaimed before it ever made it back to devfs lookup. Notes: svn path=/head/; revision=144389
* - Don't panic if we can't lock a child in lookup, return an error instead.Jeff Roberson2005-03-281-5/+4
| | | | | | | | | | | - Only unlock the directory if this is a DOTDOT lookup. Previously this code could have deadlocked if there was a DOTDOT lookup with LOCKPARENT set and another thread was locking the other way up the tree. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=144227
* - Update vfs_root implementations to match the new prototype. None ofJeff Roberson2005-03-241-1/+2
| | | | | | | | | | | these filesystems will support shared locks until they are explicitly modified to do so. Careful review must be done to ensure that this is safe for each individual filesystem. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=144059
* Disable two users of findcdev. They do the wrong thing now and willPoul-Henning Kamp2005-03-151-0/+4
| | | | | | | | need to be fixed. In both cases the API should be reengineered to do something (more) sensible. Notes: svn path=/head/; revision=143637
* Print devtoname() instead of minor().Poul-Henning Kamp2005-03-151-2/+2
| | | | Notes: svn path=/head/; revision=143624
* - 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
* - The c_lock in the coda node does not offer any features over the standardJeff Roberson2005-03-132-16/+8
| | | | | | | | | | | | vnode lock. Remove the c_lock and use the vn lock in its place. - Keep the coda lock functions so that the debugging information is preserved, but call directly to the vop_std*lock routines for the real functionality. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=143507
* Replace the workaround for a deadlock bug in Coda with a differentDavid Schultz2005-02-202-16/+4
| | | | | | | workaround that does not rely on vfs_start(). Notes: svn path=/head/; revision=142152
* Remove vop_destroyvobject() initialization.Poul-Henning Kamp2005-02-071-1/+0
| | | | Notes: svn path=/head/; revision=141439
* Make filesystems get rid of their own vnodes vnode_pager object inPoul-Henning Kamp2005-01-281-0/+1
| | | | | | | VOP_RECLAIM(). Notes: svn path=/head/; revision=140939
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.Poul-Henning Kamp2005-01-251-1/+0
| | | | Notes: svn path=/head/; revision=140783
* Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystemPoul-Henning Kamp2005-01-251-1/+0
| | | | | | | for a given vnode to create a vnode_pager object if one is needed. Notes: svn path=/head/; revision=140781
* Don't call VOP_CREATEVOBJECT(), it's the responsibility of thePoul-Henning Kamp2005-01-241-26/+0
| | | | | | | filesystem which owns the vnode. Notes: svn path=/head/; revision=140779
* Remove unused coda_fbsd_getpages()Poul-Henning Kamp2005-01-192-68/+0
| | | | Notes: svn path=/head/; revision=140470
* Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()Poul-Henning Kamp2005-01-132-8/+8
| | | | | | | directly. Notes: svn path=/head/; revision=140181
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().Poul-Henning Kamp2005-01-114-10/+6
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=140048
* Start each of the license/copyright comments with /*-Warner Losh2005-01-0519-27/+27
| | | | Notes: svn path=/head/; revision=139745
* Convert coda to nmount.Poul-Henning Kamp2004-12-061-19/+13
| | | | Notes: svn path=/head/; revision=138478
* Back when VOP_* was introduced, we did not have new-style structPoul-Henning Kamp2004-12-012-184/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=138290
* Make VOP_BMAP return a struct bufobj for the underlying storage devicePoul-Henning Kamp2004-11-151-4/+4
| | | | | | | | | | | | instead of a vnode for it. The vnode_pager does not and should not have any interest in what the filesystem uses for backend. (vfs_cluster doesn't use the backing store argument.) Notes: svn path=/head/; revision=137726
* Do not use devsw() but si_devsw direction. This is still bogus but aPoul-Henning Kamp2004-09-231-1/+1
| | | | | | | fair bit less so. Notes: svn path=/head/; revision=135613
* General modernization of coda:Brooks Davis2004-09-014-93/+54
| | | | | | | | | | | - Ditch NVCODA - Don't use a static major - Don't declare functions extern Reviewed by: peter Notes: svn path=/head/; revision=134585
* Kill count device support from config. I've changed the last fewPeter Wemm2004-08-303-3/+3
| | | | | | | | | | | | | | | | | | | | remaining consumers to have the count passed as an option. This is i4b, pc98/wdc, and coda. Bump configvers.h from 500013 to 600000. Remove heuristics that tried to parse "device ed5" as 5 units of the ed device. This broke things like the snd_emu10k1 device, which required quotes to make it parse right. The no-longer-needed quotes have been removed from NOTES, GENERIC etc. eg, I've removed the quotes from: device snd_maestro device "snd_maestro3" device snd_mss I believe everything will still compile and work after this. Notes: svn path=/head/; revision=134542
* Put a version element in the VFS filesystem configuration structurePoul-Henning Kamp2004-07-301-13/+14
| | | | | | | | | | | | | | | | | | | | | and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code. Notes: svn path=/head/; revision=132902
* Avoid casts as lvalues.Alexander Kabaev2004-07-281-1/+1
| | | | Notes: svn path=/head/; revision=132765
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-07-151-2/+2
| | | | | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything". Notes: svn path=/head/; revision=132199
* Remove 'td = curthread' that shadows the arguments to coda_root().Robert Watson2004-07-121-1/+0
| | | | | | | Missed by: alfred Notes: svn path=/head/; revision=132037
* Make VFS_ROOT() and vflush() take a thread argument.Alfred Perlstein2004-07-121-2/+3
| | | | | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread. Notes: svn path=/head/; revision=132023
* 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