summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda/coda_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the mis-handling of the VV_TEXT on the nullfs vnodes.kib2012-09-281-2/+2
| | | | | | | | | | | | | | | | If you have a binary on a filesystem which is also mounted over by nullfs, you could execute the binary from the lower filesystem, or from the nullfs mount. When executed from lower filesystem, the lower vnode gets VV_TEXT flag set, and the file cannot be modified while the binary is active. But, if executed as the nullfs alias, only the nullfs vnode gets VV_TEXT set, and you still can open the lower vnode for write. Add a set of VOPs for the VV_TEXT query, set and clear operations, which are correctly bypassed to lower vnode. Tested by: pho (previous version) MFC after: 2 weeks
* Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.mckusick2012-04-171-8/+1
| | | | | | | | | | | | | | | | | | | | | The primary changes are that the user of the interface no longer needs to manage the mount-mutex locking and that the vnode that is returned has its mutex locked (thus avoiding the need to check to see if its is DOOMED or other possible end of life senarios). To minimize compatibility issues for third-party developers, the old MNT_VNODE_FOREACH interface will remain available so that this change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH will be removed in head. The reason for this update is to prepare for the addition of the MNT_VNODE_FOREACH_ACTIVE interface that will loop over just the active vnodes associated with a mount point (typically less than 1% of the vnodes associated with the mount point). Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks
* Synchronize Coda kernel module definitions in our coda.h to Coda 6'srwatson2010-04-051-1/+1
| | | | | | | | | | | | | | | | | | | coda.h: - CodaFid typdef -> struct CodaFid throughout. - Use unsigned int instead of unsigned long for venus_dirent and other cosmetic fixes. - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs. - Synchronize comments and macros. - Use u_int32_t instead of unsigned long for coda_out_hdr. With these changes, a 64-bit Coda kernel module now works with coda6_client, whereas previous userspace and kernel versions of RPCs differed sufficiently to prevent using the file system. This has been verified only with casual testing, but /coda is now usable for at least basic operations on amd64. MFC after: 1 week
* Fix few missed accmode changes in coda.trasz2008-11-031-2/+2
| | | | Approved by: rwatson (mentor)
* In Coda, flush the attribute cache for a cnode when its fid isrwatson2008-02-141-1/+4
| | | | | | | changed, as its synthesized inode number may have changed and we want stat(2) to pick up the new inode number. MFC after: 1 month
* Update cache flushing behavior in light of recent namecache andrwatson2008-02-131-7/+0
| | | | | | | | | | | | | access cache improvements: - Flush just access control state on CODA_PURGEUSER, not the full namecache for /coda. - When replacing a fid on a cnode as a result of, e.g., reintegration after offline operation, we no longer need to purge the namecache entries associated with its vnode. MFC after: 1 month
* Implement a rudimentary access cache for the Coda kernel module,rwatson2008-02-131-8/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modeled on the access cache found in NFS, smbfs, and the Linux coda module. This is a positive access cache of a single entry per file, tracking recently granted rights, but unlike NFS and smbfs, supporting explicit invalidation by the distributed file system. For each cnode, maintain a C_ACCCACHE flag indicating the validity of the cache, and a cached uid and mode tracking recently granted positive access control decisions. Prefer the cache to venus_access() in VOP_ACCESS() if it is valid, and when we must fall back to venus_access(), update the cache. Allow Venus to clear the access cache, either the whole cache on CODA_FLUSH, or just entries for a specific uid on CODA_PURGEUSER. Unlike the Coda module on Linux, we don't flush all entries on a user purge using a generation number, we instead walk present cnodes and clear only entries for the specific user, meaning it is somewhat more expensive but won't hit all users. Since the Coda module is agressive about not keeping around unopened cnodes, the utility of the cache is somewhat limited for files, but works will for directories. We should make Coda less agressive about GCing cnodes in VOP_INACTIVE() in order to improve the effectiveness of in-kernel caching of attributes and access rights. MFC after: 1 month
* Rather than having the Coda module use its own namecache, use the globalrwatson2008-02-131-17/+30
| | | | | | | | | | | | | | | | | VFS namecache, as is done by the Coda module on Linux. Unlike the Coda namecache, the global VFS namecache isn't tagged by credential, so use ore conservative flushing behavior (for now) when CODA_PURGEUSER is issued by Venus. This improves overall integration with the FreeBSD VFS, including allowing __getcwd() to work better, procfs/procstat monitoring, and so on. This improves shell behavior in many cases, and improves ".." handling. It may lead to some slowdown until we've implemented a specific access cache, which should net improve performance, but in the mean time, lookup access control now always goes to Venus, whereas previously it didn't. MFC after: 1 month
* Since we're now actively maintaining the Coda module in the FreeBSD sourcerwatson2008-02-101-330/+328
| | | | | | | | | | | tree, restyle everything but coda.h (which is more explicitly shared across systems) into a closer approximation to style(9). Remove a few more unused function prototypes. Add or clarify some comments. MFC after: 1 month
* The Coda module was originally ported to NetBSD from Mach by rvb, andrwatson2008-02-081-2/+2
| | | | | | | | | | then later to FreeBSD. Update various NetBSD-related comments: in some cases delete them because they don't appply, in others update to say FreeBSD as they still apply but in FreeBSD (and might for that matter no longer apply on NetBSD), and flag one case where I'm not sure whether it applies. MFC after: 1 month
* Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/codarwatson2007-07-121-4/+4
| | | | | | | | | | 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
* - The VI_DOOMED flag now signals the end of a vnode's relationship withjeff2005-03-131-1/+1
| | | | | | the filesystem. Check that rather than VI_XLOCK. Sponsored by: Isilon Systems, Inc.
* Start each of the license/copyright comments with /*-imp2005-01-051-2/+2
|
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-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.
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-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
* Include <sys/mutex.h>. Don't depend on namespace pollution in <sys/vnode.h>.bde2003-10-051-2/+1
| | | | | Fixed a nearby style bug. The include of vcoda.h used angle brackets and was not used.
* - Check XLOCK prior to accessing v_data.jeff2003-10-051-0/+6
|
* - Make proper use of the mntvnode_mtx. We do not need the loop labeljeff2003-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.
* Add support for the Coda 6.x venus<->kernel interface. This extendstjr2003-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).
* Use __FBSDID().obrien2003-06-101-5/+4
|
* - Use vrefcnt() instead of directly accessing v_usecount.jeff2002-09-251-8/+8
|
* - Replace v_flag with v_iflag and v_vflagjeff2002-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
* More s/file system/filesystem/gtrhodes2002-05-161-1/+1
|
* Don't put a line break in string literals. GCC 3.1 complains and GCCmarcel2002-04-201-13/+10
| | | | 3.2 drops the ball.
* 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
* Backed out vestiges of the quick fixes for the transient breakage ofbde2001-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>).
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-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)
* fix it so it compiles againmjacob2001-04-231-0/+2
|
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-2/+2
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Delete unused #include <sys/select.h>.wollman2001-01-091-1/+0
|
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-1/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Remove the RCS "Log" and all the verbiage it has generated.phk1999-07-211-177/+3
|
* Clean up the KLD/LKM goop a bit.peter1999-01-171-5/+7
|
* Venus must be passed O_CREAT flag on VOP_OPEN iff this isrvb1998-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.
* Fixes for lkm:rvb1998-09-291-2/+7
| | | | | 1. use VFS_LKM vs ACTUALLY_LKM_NOT_KERNEL 2. don't pass -DCODA to lkm build
* Put "stray" printouts under DIAGNOSTIC. Make everything buildrvb1998-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.)
* Finish conversion of cfs -> codarvb1998-09-131-7/+11
|
* All the references to cfs, in symbols, structs, and stringsrvb1998-09-111-134/+133
| | | | have been changed to coda. (Same for CFS.)
* Clean LINTrvb1998-09-061-3/+7
|
* Pass2 completervb1998-09-021-50/+36
|
* Very Preliminary Codarvb1998-08-291-0/+750
OpenPOWER on IntegriCloud