summaryrefslogtreecommitdiffstats
path: root/sys/kern/vnode_if.src
Commit message (Collapse)AuthorAgeFilesLines
* Add explicit struct ucred * argument for VOP_VPTOCNP, to be used bykib2009-06-211-0/+1
| | | | | | | | | | 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
* Stop asserting on exclusive locks in fsync since it can now supportps2009-06-111-1/+1
| | | | | | shared vnode locking on ZFS. Reviewed by: jhb
* Simply shared vnode locking and extend it to also include fsync.ps2009-06-081-1/+1
| | | | | | | Also, in vop_write, no longer assert for exclusive locks on the vnode. Reviewed by: jhb, kmacy, jeffr
* Add VOP_ACCESSX, which can be used to query for newly added V*trasz2009-05-301-0/+10
| | | | | | | | 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 VOP_LEASE and supporting functions. This hasn't been used sincerwatson2009-04-101-10/+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 new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that ajhb2009-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | filesystem supports additional operations using shared vnode locks. Currently this is used to enable shared locks for open() and close() of read-only file descriptors. - When an ISOPEN namei() request is performed with LOCKSHARED, use a shared vnode lock for the leaf vnode only if the mount point has the extended shared flag set. - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but not O_CREAT. - Use a shared vnode lock around VOP_CLOSE() if the file was opened with O_RDONLY and the mountpoint has the extended shared flag set. - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from vn_open() since it now may only have a shared vnode lock. - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since FIFO's require exclusive vnode locks for their open() and close() routines. (My recent MPSAFE patches for UDF and cd9660 already included this change.) - Enable extended shared operations on UFS, cd9660, and UDF. Submitted by: ups Reviewed by: pjd (ZFS bits) MFC after: 1 month
* Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP:jhb2009-01-211-0/+5
| | | | | | | | | | | | VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME can be performed while holding a shared vnode lock (the same functionality is done internally by VOP_READ which can run with a shared vnode lock). Add missing locking of the vnode interlock to the ufs implementation and remove a special note and test from the NFS client about not supporting the feature. Inspired by: ups Tested by: pho
* Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component namemarcus2008-12-121-0/+10
| | | | | | | | | | | | | | | | 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
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessarytrasz2008-10-281-1/+1
| | | | | | | to add more V* constants, and the variables changed by this patch were often being assigned to mode_t variables, which is 16 bit. Approved by: rwatson (mentor)
* - Whitespace fix for vop_poll.jhb2008-10-271-2/+2
| | | | - Use the right label for vop_vptofh lock assertions so they are enforced.
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-281-2/+0
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
* Do not assert any locks for VOP_PRINT. In particular, do not assert thatkib2008-02-261-1/+1
| | | | | | | | | | | the vnode interlock is not held. vn_printf() already correctly handles locked and unlocked vnode interlocks, and all the in-tree vop_print methods are interlock-agnostic. Some code calls vprintf() with the vnode interlock held, that causes unjustified panics with INVARIANTS (ffs_syncvnode() as example). Reported by: Peter Holm
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-1/+0
| | | | | | | | | 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>
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-131-2/+0
| | | | | | | | | | | 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>
* Revert UF_OPENING workaround for CURRENT.kib2007-05-311-1/+1
| | | | | | | | | Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation argument from being file descriptor index into the pointer to struct file. Proposed and reviewed by: jhb Reviewed by: daichi (unionfs) Approved by: re (kensmith)
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionkib2007-05-181-3/+3
| | | | | | 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.
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-151-0/+8
| | | | | | | | | | | | | | | | 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-1/+3
| | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson)
* Remove two locking assertion entries that:dds2006-05-311-2/+0
| | | | | | | a) were incorrectly written and therefore never compiled into assertions, and b) were incorrectly specified and when compiled resulted in a failed assertion.
* Assertion code specifications are introduced using special characterdds2006-05-301-182/+182
| | | | | sequences that are distinct from comments. %% is used for argument locks; %! for pre- and post-conditions.
* Remove incorrect lock validation specifications that causeddds2006-05-301-7/+0
| | | | | | | | failed assertions with DEBUG_VFS_LOCKS. We should reinstate them with correct specifications, possibly after extendng vnode_if.awk Noted by: truckman@
* Add missing % signs in the lock annotations of the functions:dds2006-05-281-8/+8
| | | | | | lookup, rename, strategy, islocked The missing % sign meant that the lines were processed as plain comments and the corresponding assertions were never generated.
* Eradicate caddr_t from the VFS API.des2005-12-141-2/+2
|
* Allow EVFILT_VNODE events to work on every filesystem type, not justssouhlal2005-06-091-0/+11
| | | | | | | | | | | | | | | 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)
* - Mark the VOPs that require exclusive locks. Those that aren't markedjeff2005-04-111-26/+26
| | | | | | | | | with E may be called with a shared lock held. This list really could be made per filesystem if we had any filesystems which differed from ffs in locking guarantees. VFS itself is not sensitive to this except where vgone() etc. are concerned. Sponsored by: Isilon Systems, Inc.
* - CLOSE, REVOKE, INACTIVE, and RECLAIM are not L L L, that's a locked vnodejeff2005-03-131-4/+4
| | | | | | on enter, exit, error. This allows for the removal of the XLOCK. Sponsored by: Isilon Systems, Inc.
* VOP_DESTROYVOBJECT() is no more.phk2005-02-071-7/+0
|
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.phk2005-01-251-8/+0
|
* Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystemphk2005-01-251-9/+0
| | | | for a given vnode to create a vnode_pager object if one is needed.
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-1/+0
| | | | | | | | | | | | | | | | | | 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
|
* Make VOP_BMAP return a struct bufobj for the underlying storage devicephk2004-11-151-2/+1
| | | | | | | | | 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.)
* Remove VOP_SPECSTRATEGY() from the system.phk2004-10-291-9/+0
|
* Remove the buffercache/vnode side of BIO_DELETE processing inphk2004-09-131-14/+0
| | | | | | | preparation for integration of p4::phk_bufwork. In the future, local filesystems will talk to GEOM directly and they will consequently be able to issue BIO_DELETE directly. Since the removal of the fla driver, BIO_DELETE has effectively been a no-op anyway.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with therwatson2003-07-281-2/+2
| | | | | | | | | | | | kernel ACL interfaces and system call names. Break out UFS2 and FFS extattr delete and list vnode operations from setextattr and getextattr to deleteextattr and listextattr, which cleans up the implementations, and makes the results more readable, and makes the APIs more clear. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Call the new argument "fdidx" that is more precise than "fd".phk2003-07-271-1/+1
|
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-0/+1
| | | | | | | | | 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.
* Expose vop_rmextattr as an explicit operation at the vnode operationrwatson2003-06-221-0/+11
| | | | | | | | interface, rather than relying on a NULL uio for the deletion operation. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Add comment about **vpp being special-cased in vnode_if.awk (1.38)se2003-06-201-0/+6
|
* Add vop_listextattr(), similar to vop_getextattr() but without arwatson2003-06-051-0/+12
| | | | | | | | | specific attribute name. It will have the same semantics as the older vop_getextattr() "retrieve the names" hack, returning a buffer with ASCII nul-seperated names. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryphk2003-01-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Flush vop_refreshlabel() definition, since it is no longer used.rwatson2002-12-241-9/+0
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* - We don't need any automated lock checking for vop_islocked.jeff2002-09-261-1/+1
|
* VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link()truckman2002-09-191-1/+1
| | | | | | | | | | wasn't doing. Rather than just lock and unlock the vnode around the call to VOP_FSYNC(), implement rwatson's suggestion to lock the file vnode in kern_link() before calling VOP_LINK(), since the other filesystems also locked the file vnode right away in their link methods. Remove the locking and and unlocking from the leaf filesystem link methods. Reviewed by: rwatson, bde (except for the unionfs_link() changes)
* Introduce the VOP_OPENEXTATTR() and VOP_CLOSEEXTATTR() methods.phk2002-09-051-0/+19
| | | | | | | | | | | | | | | | Together these two implement a simple transcation style grouping for modifications of extended attributes on a vnode. VOP_CLOSEEXTATTR() takes a boolean "commit" argument, which determines if the aggregate changes are attempted written or not. A commit will fail if any of the VOP_SETEXTATTR() calls since the VOP_OPENEXTATTR() have failed to meet their objective or if the flush to disk fails. The default operations for these two VOP's is to return EOPNOTSUPP. This API may still be subject to change. Sponsored by: DARPA & NAI Labs
* - Add two new debugging macros: ASSERT_VI_LOCKED and ASSERT_VI_UNLOCKEDjeff2002-08-211-2/+6
| | | | | | | | - Use the new VI asserts in place of the old mtx_assert checks. - Add the VI asserts to the automated lock checking in the VOP calls. The interlock should not be held across vops with a few exceptions. - Add the vop_(un)lock_{pre,post} functions to assert that interlock is held when LK_INTERLOCK is set.
* Begin committing support for Mandatory Access Control and extensiblerwatson2002-07-301-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | kernel access control. The MAC framework permits loadable kernel modules to link to the kernel at compile-time, boot-time, or run-time, and augment the system security policy. This commit includes the initial kernel implementation, although the interface with the userland components of the operating system is still under work, and not all kernel subsystems are supported. Later in this commit sequence, documentation of which kernel subsystems will not work correctly with a kernel compiled with MAC support will be added. Introduce two node vnode operations required to support MAC. First, VOP_REFRESHLABEL(), which will be invoked by callers requiring that vp->v_label be sufficiently "fresh" for access control purposes. Second, VOP_SETLABEL(), which be invoked by callers requiring that the passed label contents be updated. The file system is responsible for updating v_label if appropriate in coordination with the MAC framework, as well as committing to disk. File systems that are not MAC-aware need not implement these VOPs, as the MAC framework will default to maintaining a single label for all vnodes based on the label on the file system mount point. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* - Acknowledge recursive vnode locks in the vop_unlock specification. Thejeff2002-07-301-1/+1
| | | | vnode may not be unlocked even if the operation succeeded.
OpenPOWER on IntegriCloud