summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing vop_bypass (returning EOPNOTSUPP).phk2004-12-031-1/+3
| | | | Tripped up: marks
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-011-42/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Make more sense out of vop_stdcreatevobject()phk2004-11-181-21/+21
|
* Make VOP_BMAP return a struct bufobj for the underlying storage devicephk2004-11-151-3/+3
| | | | | | | | | 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.)
* The default VOP_REVOKE() should be vop_panic() as we should neverphk2004-11-131-1/+1
| | | | get here in the first place.
* Properly implement a default version of VOP_GETWRITEMOUNT.phk2004-11-061-0/+1
| | | | | Remove improper access to vop_stdgetwritemount() which should and will instead rely on the VOP default path.
* Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc()alc2004-11-061-0/+1
| | | | | | | | | because this call is only needed to wake threads that slept when they discovered a dead object connected to a vnode. To eliminate unnecessary calls to wakeup() by vnode_pager_dealloc(), introduce a new flag, OBJ_DISCONNECTWNT. Reviewed by: tegge@
* Remove VOP_SPECSTRATEGY() from the system.phk2004-10-291-1/+0
|
* Eliminate unnecessary KASSERT.phk2004-10-271-3/+0
| | | | | Eliminate a printf which would never tell us anything anyway because the KASSERT would have triggered.
* Loose the v_dirty* and v_clean* alias macros.phk2004-10-251-4/+3
| | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST().
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITphk2004-10-211-9/+7
| | | | | | | | | | Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write count on a bufobj. Bufobj_wdrop() replaces vwakeup(). Use these functions all relevant places except in ffs_softdep.c where the use if interlocked_sleep() makes this impossible. Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
* Use vn_isdisk() to check if vnode is a disk.phk2004-09-241-1/+1
| | | | (repeat, CVS core dumped on me)
* use vn_isdisk() to see if vnode is a disk.phk2004-09-241-1/+1
|
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-1/+2
| | | | | | 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.
* style(9)alfred2004-07-071-1/+12
|
* do the vfsstd thing instead of messing up our VFS_SYSCTL macro.alfred2004-07-071-0/+10
|
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-041-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Clean up the stub fake vnode locking implemenations. The main reason thispeter2004-03-291-160/+0
| | | | | | | | | | | | stuff was here (NFS) was fixed by Alfred in November. The only remaining consumer of the stub functions was umapfs, which is horribly horribly broken. It has missed out on about the last 5 years worth of maintenence that was done on nullfs (from which umapfs is derived). It needs major work to bring it up to date with the vnode locking protocol. umapfs really needs to find a caretaker to bring it into the 21st century. Functions GC'ed: vop_noislocked, vop_nolock, vop_nounlock, vop_sharedlock.
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-11-051-5/+5
| | | | | | | | | | 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
* Take care not to call vput if thread used in corresponding vgetkan2003-11-021-1/+2
| | | | | | | | | | wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported.
* Temporarily undo parts of the stuct mount locking commit by jeff.kan2003-11-011-5/+1
| | | | | | | | It is unsafe to hold a mutex across vput/vrele calls. This will be redone when a better locking strategy is agreed upon. Discussed with: jeff
* Relock mntvnode_mtx if vget fails in vfs_stdsync. The loop iskan2003-10-301-0/+1
| | | | always shoould entered with mutex locked.
* Introduce no_poll() default method for device drivers. Have itphk2003-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | do exactly the same as vop_nopoll() for consistency and put a comment in the two pointing at each other. Retire seltrue() in favour of no_poll(). Create private default functions in kern_conf.c instead of public ones. Change default strategy to return the bio with ENODEV instead of doing nothing which would lead the bio stranded. Retire public nullopen() and nullclose() as well as the entire band of public no{read,write,ioctl,mmap,kqfilter,strategy,poll,dump} funtions, they are the default actions now. Move the final two trivial functions from subr_xxx.c to kern_conf.c and retire the now empty subr_xxx.c
* I have not had any reports of trouble for a long time, so remove thephk2003-06-151-25/+3
| | | | | gentle versions of the vop_strategy()/vop_specstrategy() mismatch methods and use vop_panic() instead.
* Use __FBSDID().obrien2003-06-111-3/+3
|
* Lock the vm_object when performing vm_pager_deallocate().alc2003-05-061-1/+1
|
* Lock access to the vm_object's flags in vop_stdcreatevobject().alc2003-05-021-1/+4
|
* Lock an update to a vm_object's ref_count.alc2003-05-011-0/+2
|
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* - Lock the vm_object on entry to vm_object_terminate().alc2003-04-261-2/+5
|
* - Remove a race between fsync like functions and flushbufqueues() byjeff2003-03-131-1/+0
| | | | | | | | | | | requiring locked bufs in vfs_bio_awrite(). Previously the buf could have been written out by fsync before we acquired the buf lock if it weren't for giant. The cluster_wbuild() handles this race properly but the single write at the end of vfs_bio_awrite() would not. - Modify flushbufqueues() so there is only one copy of the loop. Pass a parameter in that says whether or not we should sync bufs with deps. - Call flushbufqueues() a second time and then break if we couldn't find any bufs without deps.
* Rename vfs_stdsync function to vfs_stdnosync which matches morekan2003-03-111-1/+56
| | | | | | | | | | | | | 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
* Remove trainling whitespace.kan2003-03-101-16/+15
|
* Respect any passed in external lockmgr flags such as LK_NOWAIT in thejhb2003-03-071-4/+2
| | | | | | | default implementations of VOP_LOCK() and VOP_UNLOCK(). Tested by: jlemon, phk Glanced at by: jeffr
* - Correct the wchan in vop_stdfsync()jeff2003-03-031-1/+1
| | | | | This is almost what bde asked for. There is some desire to have per fs wchans still but that is difficult giving the current arrangement of the code.
* Pick up one file missed in the previous vprint() cleanupnjl2003-03-031-3/+3
|
* - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.jeff2003-02-251-1/+1
| | | | | | | | | | - Remove the buftimelock mutex and acquire the buf's interlock to protect these fields instead. - Hold the vnode interlock while locking bufs on the clean/dirty queues. This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another BUF_LOCK with a LK_TIMEFAIL to a single lock. Reviewed by: arch, mckusick
* - Claim we're 'fsync' and not 'spec_fsync' in vop_stdfsync.jeff2003-02-091-1/+1
|
* - Cleanup unlocked accesses to buf flags by introducing a new b_vflag memberjeff2003-02-091-0/+89
| | | | | | | | | | that is protected by the vnode lock. - Move B_SCANNED into b_vflags and call it BV_SCANNED. - Create a vop_stdfsync() modeled after spec's sync. - Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some fs specific processing. This gives all of these filesystems proper behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag. - Annotate the locking in buf.h
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to sort out disk-io from file-io in the vm/buffer/filesystem space. The intent is to sort VOP_STRATEGY calls into those which operate on "real" vnodes and those which operate on VCHR vnodes. For the latter kind, the call will be changed to VOP_SPECSTRATEGY, possibly conditionally for those places where dual-use happens. Add a default VOP_SPECSTRATEGY method which will call the normal VOP_STRATEGY. First time it is called it will print debugging information. This will only happen if a normal vnode is passed to VOP_SPECSTRATEGY by mistake. Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY does on a VCHR vnode today. Add a new VOP_STRATEGY method in specfs to catch instances where the conversion to VOP_SPECSTRATEGY has not yet happened. Handle the request just like we always did, but first time called print debugging information. Apart up to two instances of console messages per boot, this amounts to a glorified no-op commit. If you get any of the messages on your console I would very much like a copy of them mailed to phk@freebsd.org
* resort the vnode ops list.phk2003-01-041-1/+1
|
* Don't try to be cute and save a call/return by implementing a degeneratephk2002-10-241-5/+1
| | | | vrele() inline.
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-141-7/+7
| | | | | | | | | | | | | | | | | | | | 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 the standard vp interlock macros.jeff2002-09-251-8/+12
|
* Remember to unlock the (optional) vnode in vfs_stdextattrctl(). Failingphk2002-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | to do this made the following script hang: #!/bin/sh set -ex extattrctl start /tmp extattrctl initattr 64 /tmp/EA00 extattrctl enable /tmp user ea00 /tmp/EA00 extattrctl showattr /tmp/EA00 if the filesystem backing /tmp did not support EAs. The real solution is probably to have the extattrctl syscall do the unlocking rather than depend on the filesystem to do it. Considering that extattrctl is going to be made obsolete anyway, this has dogwash priority. Sponsored by: DARPA & NAI Labs.
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-1/+1
| | | | | | | | | | | | | | | - 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
* - The default for lock, unlock, and islocked is now std* instead of no*.jeff2002-07-271-3/+3
|
* Remove vfs_stdmount() and vfs_stdunmount(). They are notmux2002-07-091-20/+0
| | | | really useful and are incompatible with nmount.
* Remove a stale comment saying that the vnode lock must be the firstiedowse2002-04-271-3/+0
| | | | | element in the structure pointed to by vp->v_data; the vnode lock is now within the vnode structure itself.
OpenPOWER on IntegriCloud