summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs/union_subr.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove a warning.green2004-01-161-2/+0
|
* Fix an upper-vnode leak created in revision 1.52. When an upper-layergreen2004-01-161-16/+11
| | | | | | | | | | | | file has been removed, it should be purged from the cache, but it need not be removed from the directory stack causing corruption; instead, it will simply be removed once the last references and holds on it are dropped at the end of the unlink/rmdir system calls, and the normal !UN_CACHED VOP_INACTIVE() handler for unionfs finishes it off. This is easily reproduced by repeated "echo >file; rm file" on a unionfs mount. Strangely, "echo -n >file; rm file" didn't make it happen.
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-4/+4
| | | | | | | | | 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.
* Add a f_vnode field to struct file.phk2003-06-221-0/+1
| | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
* Introduce malloc types M_UNDCACHE and M_UNPATH for importantdas2003-06-141-10/+13
| | | | | | | unionfs-related data structures to aid in debugging memory leaks. Use NULL and NULLVP instead of 0 as appropriate. MFC after: 3 days
* Factor out the process of freeing ``directory caches'', which unionfsdas2003-06-141-16/+21
| | | | | | | | directory vnodes use to refer to their constituent vnodes, into union_dircache_free(). Also s/union_dircache/union_dircache_get/ and tweak the structure of union_dircache_r(). MFC after: 3 days
* Plug a serious memory leak. The -STABLE equivalent of this patch hasdas2003-06-131-8/+20
| | | | | | | | | | | been tested extensively, but -CURRENT testing has been hampered by a number of panics that also occur without the patch. Since the destabilizing changes between 4.X and 5.X are external to unionfs, I believe this patch applies equally well to both. Thanks to scrappy for assistance testing these and other changes. MFC after: 4 days
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-2/+2
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-7/+7
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-7/+7
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-131-1/+1
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-121-1/+1
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-141-2/+0
| | | | | | | | | | | | | | | | | | | | 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.
* - Use vrefcnt() where it is safe to do so instead of doing direct andjeff2002-09-251-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.
* Fix misspellings, capitalization, and punctuation in comments. Minortruckman2002-09-221-41/+43
| | | | comment phrasing and style changes.
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-09-141-2/+3
| | | | | | | | | | | | 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)
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-2/+3
| | | | | | | | | | | | | | | - 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
* Change the vm_zone calls over to uma calls. Remove the reference to thejeff2002-04-081-9/+9
| | | | vm_zone header.
* Remove __P.alfred2002-03-191-17/+17
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-3/+3
| | | | reference.
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* 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
* KSE Milestone 2julian2001-09-121-68/+68
| | | | | | | | | | | | | | 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
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-231-1/+1
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Sort includes from previous commit.jhb2001-05-211-1/+1
|
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-0/+1
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Use vop_*vobject() VOPs to get reference to VM object from upper or lower fs.bp2001-05-171-35/+4
|
* Do not leave an extra reference on vnode.bp2001-05-171-6/+2
| | | | | | PR: kern/27250 Submitted by: "Vladimir B. Grebenschikov" <vova@express.ru> MFC after: 2 weeks
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-4/+7
| | | | | | | | | | | 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)
* Use <sys/queue.h> macro API.phk2001-02-041-2/+1
|
* Convert lockmgr locks from using simple locks to using mutexes.jasone2000-10-041-0/+1
| | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
* Add snapshots to the fast filesystem. Most of the changes supportmckusick2000-07-111-6/+24
| | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words).
* Back out the previous change to the queue(3) interface.jake2000-05-261-1/+1
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-1/+1
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-9/+24
|
* Before we start to mess with the VFS name-cache clean things up a little bit:phk1999-10-031-5/+0
| | | | Isolate the namecache in its own file, and give it a dedicated malloc type.
* Make sure file after VOP_OPEN is VMIO'd when transfering control fromdillon1999-09-281-2/+4
| | | | | | | | | | | a lower layer to an upper layer. I'm not sure how necessary this is for reading. Fix bug in union_lookup() (note: there are probably still several bugs in union_lookup()). This one set lerror as a side effect without setting lowervp, causing copyup code further on down to crash on a null lowervp pointer. Changed the side effect to use a temporary variable instead.
* This is a major fixup of unionfs. At least 30 serious bugs have beendillon1999-09-261-196/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixed (many due to changing semantics in other parts of the kernel and not the original author's fault), including one critical one: unionfs could cause UFS corruption in the fronting store due to calling VOP_OPEN for writing without turning on vmio for the UFS vnode. Most of the bugs were related to semantics changes in VOP calls, lock ordering problems (causing deadlocks), improper handling of a read-only backing store (such as an NFS mount), improper referencing and locking of vnodes, not using real struct locks for vnode locking, not using recursive locks when accessing the fronting store, and things like that. New functionality has been added: unionfs now has mmap() support, but only partially tested, and rename has been enhanced considerably. There are still some things that unionfs cannot do. You cannot rename a directory without confusing unionfs, and there are issues with softlinks, hardlinks, and special files. unionfs mostly doesn't understand them (and never did). There are probably still panic situations, but hopefully no where near as many as before this commit. The unionfs in this commit has been tested overlayed on /usr/src (backing /usr/src being a read-only NFS mount, fronting /usr/src being a local filesystem). kernel builds have been tested, buildworld is undergoing testing. More testing is necessary.
* Changed old-style option UNION_DIAGNOSTIC to DEBUG and fixed printfbde1999-08-291-2/+2
| | | | | | | format errors exposed by this. It has nothing to do with diagnostics since it does little more than control tracing of normal operation. Actual diagnostics for the union file system are still controlled by the DIAGNOSTIC option.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* This code got moved as a result of confusion between union mounts andpeter1999-02-281-10/+1
| | | | | unionfs. Julian has already revived the union mount part of this move in vfs_syscalls.c rev 1.119, but forgot to take it out of here.
* Cleanup uninitialized-possibly-used (but really not) warningsdillon1998-12-141-2/+2
|
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-2/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* '\0' is the most ugly NULL pointer constant I've ever seen in real code.eivind1998-12-071-2/+2
|
* Finished updating module event handlers to be compatible withbde1998-11-151-2/+3
| | | | modeventhand_t.
* Change the #ifdef UNION code into a callable hook. Arrange to have thispeter1998-11-031-1/+79
| | | | set up when unionfs is present, either statically or as a kld module.
* Cast pointers to [u]intptr_t instead of to [unsigned] long.bde1998-07-151-2/+2
|
* In the words of the submitter:msmith1998-05-071-2/+5
| | | | | | | | | | | | | | | | | | | --------- Make callers of namei() responsible for releasing references or locks instead of having the underlying filesystems do it. This eliminates redundancy in all terminal filesystems and makes it possible for stacked transport layers such as umapfs or nullfs to operate correctly. Quality testing was done with testvn, and lat_fs from the lmbench suite. Some NFS client testing courtesy of Patrik Kudo. vop_mknod and vop_symlink still release the returned vpp. vop_rename still releases 4 vnode arguments before it returns. These remaining cases will be corrected in the next set of patches. --------- Submitted by: Michael Hancock <michaelh@cet.co.jp>
* Deleted KLOCK-hack.kato1998-02-261-17/+1
|
OpenPOWER on IntegriCloud