summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_default.c
Commit message (Collapse)AuthorAgeFilesLines
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionKonstantin Belousov2007-05-181-2/+2
| | | | | | | | | 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
* Remove VFS_VPTOFH entirely. API is already broken and it is good time toPawel Jakub Dawidek2007-02-161-14/+1
| | | | | | | | | do it. Suggested by: rwatson Notes: svn path=/head/; revision=166795
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.Pawel Jakub Dawidek2007-02-151-0/+11
| | | | | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs Notes: svn path=/head/; revision=166774
* change vop_lock handling to allowing tracking of callers' file and line forKip Macy2006-11-131-3/+5
| | | | | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson) Notes: svn path=/head/; revision=164248
* Don't try to obtain a reference to a nonexisting (NULL) mount structure inTor Egge2006-09-201-4/+6
| | | | | | | default VOP_GETWRITEMOUNT(). Notes: svn path=/head/; revision=162455
* - GETWRITEMOUNT now returns a referenced mountpoint to prevent itsJeff Roberson2006-03-311-1/+15
| | | | | | | | | | | identity from changing. This is possible now that mounts are not freed. Discussed with: tegge Tested by: kris Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=157323
* - Add a comment warning about an anomalous condition where we VOP_UNLOCKJeff Roberson2006-01-301-0/+1
| | | | | | | | and then vrele rather than vput because we would like to VOP_UNLOCK with a specific thread. Notes: svn path=/head/; revision=155032
* Add marker vnodes to ensure that all vnodes associated with the mount point areTor Egge2006-01-091-3/+5
| | | | | | | | | iterated over when using MNT_VNODE_FOREACH. Reviewed by: truckman Notes: svn path=/head/; revision=154152
* Eradicate caddr_t from the VFS API.Dag-Erling Smørgrav2005-12-141-1/+1
| | | | Notes: svn path=/head/; revision=153400
* In vop_stdpathconf(ap) also default for _PC_NAME_MAX and _PC_PATH_MAX.Poul-Henning Kamp2005-08-171-0/+6
| | | | Notes: svn path=/head/; revision=149175
* - Replace the series of DEBUG_LOCKS hacks which tried to save the vn_lockJeff Roberson2005-08-031-5/+0
| | | | | | | | | | caller by saving the stack of the last locker/unlocker in lockmgr. We also put the stack in KTR at the moment. Contributed by: Antoine Brodin <antoine.brodin@laposte.net> Notes: svn path=/head/; revision=148668
* - Add and enhance asserts related to the wrong bufobj panic.Jeff Roberson2005-06-141-0/+3
| | | | | | | | Sponsored by: Isilon Systems, Inc. Approved by: re (blanket vfs) Notes: svn path=/head/; revision=147388
* Allow EVFILT_VNODE events to work on every filesystem type, not justSuleiman Souhlal2005-06-091-0/+8
| | | | | | | | | | | | | | | | | | UFS by: - Making the pre and post hooks for the VOP functions work even when DEBUG_VFS_LOCKS is not defined. - Moving the KNOTE activations into the corresponding VOP hooks. - Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct mount that permits filesystems to disable the new behavior. - Creating a default VOP_KQFILTER function: vfs_kqfilter() My benchmarks have not revealed any performance degradation. Reviewed by: jeff, bde Approved by: rwatson, jmg (kqueue changes), grehan (mentor) Notes: svn path=/head/; revision=147198
* - Remove unnecessary spls.Jeff Roberson2005-05-011-10/+2
| | | | Notes: svn path=/head/; revision=145732
* - Now that writes to character devices supporting softupdates canJeff Roberson2005-04-031-3/+4
| | | | | | | | | | | | generate dirty bufs even with a locked vnode, 100 retries is not that many. This should probably change from a retry count to an abort when we are no longer cleaning any buffers. - Don't call vprint() while we still hold the vnode locked. Move the call to later in the function. - Clean up a comment. Notes: svn path=/head/; revision=144584
* - Fixup the default vfs_root function to match the new prototype.Jeff Roberson2005-03-241-1/+2
| | | | | | | Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=144054
* - Don't drop the lock in the default inactive handler anymore, VOP_NULLJeff Roberson2005-03-131-14/+1
| | | | | | | | | will do for vop_stdinactive now. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=143494
* Remove VFS_START(). Its original purpose involved the mfs filesystem,David Schultz2005-02-201-10/+0
| | | | | | | | | | which is long gone. Discussed with: mckusick Reviewed by: phk Notes: svn path=/head/; revision=142153
* Remove vop_stddestroyvobject()Poul-Henning Kamp2005-02-071-13/+0
| | | | Notes: svn path=/head/; revision=141448
* Move the contents of vop_stddestroyvobject() to the new vnode_pagerPoul-Henning Kamp2005-01-281-26/+2
| | | | | | | | | | function vnode_destroy_vobject(). Make the new function zero the vp->v_object pointer so we can tell if a call is missing. Notes: svn path=/head/; revision=140929
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.Poul-Henning Kamp2005-01-251-24/+0
| | | | Notes: svn path=/head/; revision=140783
* Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystemPoul-Henning Kamp2005-01-251-14/+0
| | | | | | | for a given vnode to create a vnode_pager object if one is needed. Notes: svn path=/head/; revision=140781
* Move the body of vop_stdcreatevobject() over to the vnode_pager underPoul-Henning Kamp2005-01-241-50/+1
| | | | | | | | | | | | | | the name Sande^H^H^H^H^Hvnode_create_vobject(). Make the new function take a size argument which removes the need for a VOP_STAT() or a very pessimistic guess for disks. Call that new function from vop_stdcreatevobject(). Make vnode_pager_alloc() private now that its only user came home. Notes: svn path=/head/; revision=140767
* Kill the VV_OBJBUF and test the v_object for NULL instead.Poul-Henning Kamp2005-01-241-2/+1
| | | | Notes: svn path=/head/; revision=140734
* - Remove GIANT_REQUIRED where it is no longer required.Jeff Roberson2005-01-241-4/+0
| | | | | | | Sponsored By: Isilon Systems, Inc. Notes: svn path=/head/; revision=140717
* Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()Poul-Henning Kamp2005-01-131-1/+1
| | | | | | | directly. Notes: svn path=/head/; revision=140181
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().Poul-Henning Kamp2005-01-111-5/+3
| | | | | | | | | | | | | | | | | | | | | 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
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139804
* Add missing vop_bypass (returning EOPNOTSUPP).Poul-Henning Kamp2004-12-031-1/+3
| | | | | | | Tripped up: marks Notes: svn path=/head/; revision=138339
* Back when VOP_* was introduced, we did not have new-style structPoul-Henning Kamp2004-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) Notes: svn path=/head/; revision=138290
* Make more sense out of vop_stdcreatevobject()Poul-Henning Kamp2004-11-181-21/+21
| | | | Notes: svn path=/head/; revision=137845
* Make VOP_BMAP return a struct bufobj for the underlying storage devicePoul-Henning Kamp2004-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.) Notes: svn path=/head/; revision=137726
* The default VOP_REVOKE() should be vop_panic() as we should neverPoul-Henning Kamp2004-11-131-1/+1
| | | | | | | get here in the first place. Notes: svn path=/head/; revision=137677
* Properly implement a default version of VOP_GETWRITEMOUNT.Poul-Henning Kamp2004-11-061-0/+1
| | | | | | | | Remove improper access to vop_stdgetwritemount() which should and will instead rely on the VOP default path. Notes: svn path=/head/; revision=137308
* Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc()Alan Cox2004-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@ Notes: svn path=/head/; revision=137297
* Remove VOP_SPECSTRATEGY() from the system.Poul-Henning Kamp2004-10-291-1/+0
| | | | Notes: svn path=/head/; revision=137043
* Eliminate unnecessary KASSERT.Poul-Henning Kamp2004-10-271-3/+0
| | | | | | | | Eliminate a printf which would never tell us anything anyway because the KASSERT would have triggered. Notes: svn path=/head/; revision=136990
* Loose the v_dirty* and v_clean* alias macros.Poul-Henning Kamp2004-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(). Notes: svn path=/head/; revision=136943
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=136751
* Use vn_isdisk() to check if vnode is a disk.Poul-Henning Kamp2004-09-241-1/+1
| | | | | | | (repeat, CVS core dumped on me) Notes: svn path=/head/; revision=135711
* use vn_isdisk() to see if vnode is a disk.Poul-Henning Kamp2004-09-241-1/+1
| | | | Notes: svn path=/head/; revision=135710
* Make VFS_ROOT() and vflush() take a thread argument.Alfred Perlstein2004-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. Notes: svn path=/head/; revision=132023
* style(9)Alfred Perlstein2004-07-071-1/+12
| | | | Notes: svn path=/head/; revision=131734
* do the vfsstd thing instead of messing up our VFS_SYSCTL macro.Alfred Perlstein2004-07-071-0/+10
| | | | Notes: svn path=/head/; revision=131733
* When we traverse the vnodes on a mountpoint we need to look out forPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=131551
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-051-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127911
* Clean up the stub fake vnode locking implemenations. The main reason thisPeter Wemm2004-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. Notes: svn path=/head/; revision=127592
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.Alexander Kabaev2003-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 Notes: svn path=/head/; revision=122091
* Take care not to call vput if thread used in corresponding vgetAlexander Kabaev2003-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. Notes: svn path=/head/; revision=121874
* Temporarily undo parts of the stuct mount locking commit by jeff.Alexander Kabaev2003-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 Notes: svn path=/head/; revision=121847