summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_default.c
Commit message (Collapse)AuthorAgeFilesLines
* Add VOP_ADVLOCKPURGE so that the file system is called when purgingzml2010-05-121-0/+11
| | | | | | | locks (in the case where the VFS impl isn't using lf_*) Submitted by: Matthew Fleming <matthew.fleming@isilon.com> Reviewed by: zml, dfr
* Supply default implementation of VOP_RENAME() that does neccessarykib2010-04-021-0/+16
| | | | | | | | | | | | unlocks and unreferences for argument vnodes, as expected by kern_renameat(9), and returns EOPNOTSUPP. This fixes locks and reference leaks when rename is attempted on fs that does not implement rename. PR: kern/107439 Based on submission by: Mikolaj Golub <to.my.trociny gmail com> Tested by: Mikolaj Golub MFC after: 1 week
* Use vput() instead of VOP_UNLOCK()+vrele(). The comment here is out-dated,pjd2010-02-181-4/+1
| | | | we no longer pass thread pointer to VOP_UNLOCK().
* Revert r198873. Having different VAPPEND semantics for VOP_ACCESS(9)trasz2009-11-111-8/+0
| | | | and VOP_ACCESSX(9) is not a good idea.
* While VAPPEND without VWRITE makes sense for VOP_ACCESSX(9) (e.g. to checktrasz2009-11-041-0/+8
| | | | | | for the permission to create subdirectory (ACE4_ADD_SUBDIRECTORY)), it doesn't really make sense for VOP_ACCESS(9). Also, many VOP_ACCESS(9) implementations don't expect that. Make sure we don't confuse them.
* Provide default implementation for VOP_ACCESS(9), so that filesystems whichtrasz2009-10-011-0/+15
| | | | | | | want to provide VOP_ACCESSX(9) don't have to implement both. Note that this commit makes implementation of either of these two mandatory. Reviewed by: kib
* Add explicit struct ucred * argument for VOP_VPTOCNP, to be used bykib2009-06-211-4/+5
| | | | | | | | | | vn_open_cred in default implementation. Valid struct ucred is needed for audit and MAC, and curthread credentials may be wrong. This further requires modifying the interface of vn_fullpath(9), but it is out of scope of this change. Reviewed by: rwatson
* Add another flags argument to vn_open_cred. Use it to specify that somekib2009-06-211-1/+1
| | | | | | | | | | | | | | vn_open_cred invocations shall not audit namei path. In particular, specify VN_OPEN_NOAUDIT for dotdot lookup performed by default implementation of vop_vptocnp, and for the open done for core file. vn_fullpath is called from the audit code, and vn_open there need to disable audit to avoid infinite recursion. Core file is created on return to user mode, that, in particular, happens during syscall return. The creation of the core file is audited by direct calls, and we do not want to overwrite audit information for syscall. Reported, reviewed and tested by: rwatson
* Add mac_framework.h include missed when MAC code was (presumably) copiedrwatson2009-06-051-0/+2
| | | | from another file.
* Add VOP_ACCESSX, which can be used to query for newly added V*trasz2009-05-301-0/+17
| | | | | | | | permissions, such as VWRITE_ACL. For a filsystems that don't implement it, there is a default implementation, which works as a wrapper around VOP_ACCESS. Reviewed by: rwatson@
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-12/+8
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Remove VOP_LEASE and supporting functions. This hasn't been used sincerwatson2009-04-101-1/+0
| | | | | | | | | | | | | | the removal of NQNFS, but was left in in case it was required for NFSv4. Since our new NFSv4 client and server can't use it for their requirements, GC the old mechanism, as well as other unused lease- related code and interfaces. Due to its impact on kernel programming and binary interfaces, this change should not be MFC'd. Proposed by: jeff Reviewed by: jeff Discussed with: rmacklem, zach loafman @ isilon
* Add a default implementation for VOP_VPTOCNP(9) which scans the parentmarcus2009-03-081-1/+235
| | | | | | | | | | | | directory of a vnode to find a dirent with a matching file number. The name from that dirent is then used to provide the component name. Note: if the initial vnode argument is not a directory itself, then the default VOP_VPTOCNP(9) implementation still returns ENOENT. Reviewed by: kib Approved by: kib Tested by: pho
* Extract the no_poll() and vop_nopoll() code into the common routinekib2009-03-061-11/+1
| | | | | | | | | poll_no_poll(). Return a poll_no_poll() result from devfs_poll_f() when filedescriptor does not reference the live cdev, instead of ENXIO. Noted and tested by: hps MFC after: 1 week
* Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component namemarcus2008-12-121-0/+8
| | | | | | | | | | | | | | | | on a best-effort basis. Teach vn_fullpath to use this new VOP if a regular VFS cache lookup fails. This VOP is designed to supplement the VFS cache to provide a better chance that a vnode-to-name lookup will succeed. Currently, an implementation for devfs is being committed. The default implementation is to return ENOENT. A big thanks to kib for the mentorship on this, and to pho for running it through his stress test suite. Reviewed by: arch Approved by: kib
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-281-6/+10
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Move the head of byte-level advisory lock list from thekib2008-04-161-1/+40
| | | | | | | | | | | | | | | | | | | | | | filesystem-specific vnode data to the struct vnode. Provide the default implementation for the vop_advlock and vop_advlockasync. Purge the locks on the vnode reclaim by using the lf_purgelocks(). The default implementation is augmented for the nfs and smbfs. In the nfs_advlock, push the Giant inside the nfs_dolock. Before the change, the vop_advlock and vop_advlockasync have taken the unlocked vnode and dereferenced the fs-private inode data, racing with with the vnode reclamation due to forced unmount. Now, the vop_getattr under the shared vnode lock is used to obtain the inode size, and later, in the lf_advlockasync, after locking the vnode interlock, the VI_DOOMED flag is checked to prevent an operation on the doomed vnode. The implementation of the lf_purgelocks() is submitted by dfr. Reported by: kris Tested by: kris, pho Discussed with: jeff, dfr MFC after: 2 weeks
* - Complete part of the unfinished bufobj work by consistently usingjeff2008-03-221-15/+12
| | | | | | | | | | | | | | | | | BO_LOCK/UNLOCK/MTX when manipulating the bufobj. - Create a new lock in the bufobj to lock bufobj fields independently. This leaves the vnode interlock as an 'identity' lock while the bufobj is an io lock. The bufobj lock is ordered before the vnode interlock and also before the mnt ilock. - Exploit this new lock order to simplify softdep_check_suspend(). - A few sync related functions are marked with a new XXX to note that we may not properly interlock against a non-zero bv_cnt when attempting to sync all vnodes on a mountlist. I do not believe this race is important. If I'm wrong this will make these locations easier to find. Reviewed by: kib (earlier diff) Tested by: kris, pho (earlier diff)
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-4/+1
| | | | | | | | | always curthread. As KPI gets broken by this patch, manpages and __FreeBSD_version will be updated by further commits. Tested by: Andrea Barberio <insomniac at slackware dot it>
* - Introduce lockmgr_args() in the lockmgr space. This function performsattilio2008-02-151-1/+2
| | | | | | | | | | | the same operation of lockmgr() but accepting a custom wmesg, prio and timo for the particular lock instance, overriding default values lkp->lk_wmesg, lkp->lk_prio and lkp->lk_timo. - Use lockmgr_args() in order to implement BUF_TIMELOCK() - Cleanup BUF_LOCK() - Remove LK_INTERNAL as it is nomore used in the lockmgr namespace Tested by: Andrea Barberio <insomniac at slackware dot it>
* Cleanup lockmgr interface and exported KPI:attilio2008-01-241-4/+3
| | | | | | | | | | | | | | | | | | | | - Remove the "thread" argument from the lockmgr() function as it is always curthread now - Axe lockcount() function as it is no longer used - Axe LOCKMGR_ASSERT() as it is bogus really and no currently used. Hopefully this will be soonly replaced by something suitable for it. - Remove the prototype for dumplockinfo() as the function is no longer present Addictionally: - Introduce a KASSERT() in lockstatus() in order to let it accept only curthread or NULL as they should only be passed - Do a little bit of style(9) cleanup on lockmgr.h KPI results heavilly broken by this change, so manpages and FreeBSD_version will be modified accordingly by further commits. Tested by: matteo
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-131-4/+5
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionkib2007-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.
* Remove VFS_VPTOFH entirely. API is already broken and it is good time topjd2007-02-161-14/+1
| | | | | | do it. Suggested by: rwatson
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-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
* change vop_lock handling to allowing tracking of callers' file and line forkmacy2006-11-131-3/+5
| | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
* Don't try to obtain a reference to a nonexisting (NULL) mount structure integge2006-09-201-4/+6
| | | | default VOP_GETWRITEMOUNT().
* - GETWRITEMOUNT now returns a referenced mountpoint to prevent itsjeff2006-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.
* - Add a comment warning about an anomalous condition where we VOP_UNLOCKjeff2006-01-301-0/+1
| | | | | and then vrele rather than vput because we would like to VOP_UNLOCK with a specific thread.
* Add marker vnodes to ensure that all vnodes associated with the mount point aretegge2006-01-091-3/+5
| | | | | | iterated over when using MNT_VNODE_FOREACH. Reviewed by: truckman
* Eradicate caddr_t from the VFS API.des2005-12-141-1/+1
|
* In vop_stdpathconf(ap) also default for _PC_NAME_MAX and _PC_PATH_MAX.phk2005-08-171-0/+6
|
* - Replace the series of DEBUG_LOCKS hacks which tried to save the vn_lockjeff2005-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>
* - Add and enhance asserts related to the wrong bufobj panic.jeff2005-06-141-0/+3
| | | | | Sponsored by: Isilon Systems, Inc. Approved by: re (blanket vfs)
* Allow EVFILT_VNODE events to work on every filesystem type, not justssouhlal2005-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)
* - Remove unnecessary spls.jeff2005-05-011-10/+2
|
* - Now that writes to character devices supporting softupdates canjeff2005-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.
* - Fixup the default vfs_root function to match the new prototype.jeff2005-03-241-1/+2
| | | | Sponsored by: Isilon Systems, Inc.
* - Don't drop the lock in the default inactive handler anymore, VOP_NULLjeff2005-03-131-14/+1
| | | | | | will do for vop_stdinactive now. Sponsored by: Isilon Systems, Inc.
* Remove VFS_START(). Its original purpose involved the mfs filesystem,das2005-02-201-10/+0
| | | | | | | which is long gone. Discussed with: mckusick Reviewed by: phk
* Remove vop_stddestroyvobject()phk2005-02-071-13/+0
|
* Move the contents of vop_stddestroyvobject() to the new vnode_pagerphk2005-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.
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.phk2005-01-251-24/+0
|
* Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystemphk2005-01-251-14/+0
| | | | for a given vnode to create a vnode_pager object if one is needed.
* Move the body of vop_stdcreatevobject() over to the vnode_pager underphk2005-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.
* Kill the VV_OBJBUF and test the v_object for NULL instead.phk2005-01-241-2/+1
|
* - Remove GIANT_REQUIRED where it is no longer required.jeff2005-01-241-4/+0
| | | | Sponsored By: Isilon Systems, Inc.
* Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()phk2005-01-131-1/+1
| | | | directly.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-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
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
OpenPOWER on IntegriCloud