aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vnode_if.src
Commit message (Collapse)AuthorAgeFilesLines
* Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)Matthew D Fleming2011-04-191-3/+3
| | | | | | | | | drive looping and potentially yielding. Requested by: kib Notes: svn path=/head/; revision=220846
* Add the posix_fallocate(2) syscall. The default implementation inMatthew D Fleming2011-04-181-0/+10
| | | | | | | | | | | | | | | | | vop_stdallocate() is filesystem agnostic and will run as slow as a read/write loop in userspace; however, it serves to correctly implement the functionality for filesystems that do not implement a VOP_ALLOCATE. Note that __FreeBSD_version was already bumped today to 900036 for any ports which would like to use this function. Also reserve space in the syscall table for posix_fadvise(2). Reviewed by: -arch (previous version) Notes: svn path=/head/; revision=220791
* Add VOP_ADVLOCKPURGE so that the file system is called when purgingZachary Loafman2010-05-121-0/+7
| | | | | | | | | | locks (in the case where the VFS impl isn't using lf_*) Submitted by: Matthew Fleming <matthew.fleming@isilon.com> Reviewed by: zml, dfr Notes: svn path=/head/; revision=208003
* Add explicit struct ucred * argument for VOP_VPTOCNP, to be used byKonstantin Belousov2009-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 Notes: svn path=/head/; revision=194601
* Stop asserting on exclusive locks in fsync since it can now supportPaul Saab2009-06-111-1/+1
| | | | | | | | | shared vnode locking on ZFS. Reviewed by: jhb Notes: svn path=/head/; revision=194019
* Simply shared vnode locking and extend it to also include fsync.Paul Saab2009-06-081-1/+1
| | | | | | | | | | Also, in vop_write, no longer assert for exclusive locks on the vnode. Reviewed by: jhb, kmacy, jeffr Notes: svn path=/head/; revision=193762
* Add VOP_ACCESSX, which can be used to query for newly added V*Edward Tomasz Napierala2009-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@ Notes: svn path=/head/; revision=193092
* Remove VOP_LEASE and supporting functions. This hasn't been used sinceRobert Watson2009-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 Notes: svn path=/head/; revision=190888
* Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that aJohn Baldwin2009-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 Notes: svn path=/head/; revision=189696
* Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP:John Baldwin2009-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 Notes: svn path=/head/; revision=187526
* Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component nameJoe Marcus Clarke2008-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 Notes: svn path=/head/; revision=185956
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessaryEdward Tomasz Napierala2008-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) Notes: svn path=/head/; revision=184413
* - Whitespace fix for vop_poll.John Baldwin2008-10-271-2/+2
| | | | | | | - Use the right label for vop_vptofh lock assertions so they are enforced. Notes: svn path=/head/; revision=184377
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadAttilio Rao2008-08-281-2/+0
| | | | | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com> Notes: svn path=/head/; revision=182371
* Add the new kernel-mode NFS Lock Manager. To use it instead of theDoug Rabson2008-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 Notes: svn path=/head/; revision=177633
* Do not assert any locks for VOP_PRINT. In particular, do not assert thatKonstantin Belousov2008-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 Notes: svn path=/head/; revision=176590
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isAttilio Rao2008-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> Notes: svn path=/head/; revision=176559
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inAttilio Rao2008-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> Notes: svn path=/head/; revision=175294
* Revert UF_OPENING workaround for CURRENT.Konstantin Belousov2007-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) Notes: svn path=/head/; revision=170152
* Since renaming of vop_lock to _vop_lock, pre- and post-conditionKonstantin Belousov2007-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. Notes: svn path=/head/; revision=169671
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.Pawel Jakub Dawidek2007-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 Notes: svn path=/head/; revision=166774
* change vop_lock handling to allowing tracking of callers' file and line forKip Macy2006-11-131-1/+3
| | | | | | | | | acquisition of lockmgr locks Approved by: scottl (standing in for mentor rwatson) Notes: svn path=/head/; revision=164248
* Remove two locking assertion entries that:Diomidis Spinellis2006-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. Notes: svn path=/head/; revision=159104
* Assertion code specifications are introduced using special characterDiomidis Spinellis2006-05-301-182/+182
| | | | | | | | sequences that are distinct from comments. %% is used for argument locks; %! for pre- and post-conditions. Notes: svn path=/head/; revision=159082
* Remove incorrect lock validation specifications that causedDiomidis Spinellis2006-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@ Notes: svn path=/head/; revision=159080
* Add missing % signs in the lock annotations of the functions:Diomidis Spinellis2006-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. Notes: svn path=/head/; revision=159002
* Eradicate caddr_t from the VFS API.Dag-Erling Smørgrav2005-12-141-2/+2
| | | | Notes: svn path=/head/; revision=153400
* Allow EVFILT_VNODE events to work on every filesystem type, not justSuleiman Souhlal2005-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) Notes: svn path=/head/; revision=147198
* - Mark the VOPs that require exclusive locks. Those that aren't markedJeff Roberson2005-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. Notes: svn path=/head/; revision=144909
* - CLOSE, REVOKE, INACTIVE, and RECLAIM are not L L L, that's a locked vnodeJeff Roberson2005-03-131-4/+4
| | | | | | | | | on enter, exit, error. This allows for the removal of the XLOCK. Sponsored by: Isilon Systems, Inc. Notes: svn path=/head/; revision=143492
* VOP_DESTROYVOBJECT() is no more.Poul-Henning Kamp2005-02-071-7/+0
| | | | Notes: svn path=/head/; revision=141449
* Take VOP_GETVOBJECT() out to pasture. We use the direct pointer now.Poul-Henning Kamp2005-01-251-8/+0
| | | | Notes: svn path=/head/; revision=140783
* Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystemPoul-Henning Kamp2005-01-251-9/+0
| | | | | | | for a given vnode to create a vnode_pager object if one is needed. Notes: svn path=/head/; revision=140781
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().Poul-Henning Kamp2005-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 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
* Make VOP_BMAP return a struct bufobj for the underlying storage devicePoul-Henning Kamp2004-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.) Notes: svn path=/head/; revision=137726
* Remove VOP_SPECSTRATEGY() from the system.Poul-Henning Kamp2004-10-291-9/+0
| | | | Notes: svn path=/head/; revision=137043
* Remove the buffercache/vnode side of BIO_DELETE processing inPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=135135
* 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
* Rename VOP_RMEXTATTR() to VOP_DELETEEXTATTR() for consistency with theRobert Watson2003-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 Notes: svn path=/head/; revision=118131
* Call the new argument "fdidx" that is more precise than "fd".Poul-Henning Kamp2003-07-271-1/+1
| | | | Notes: svn path=/head/; revision=118093
* Add a "int fd" argument to VOP_OPEN() which in the future willPoul-Henning Kamp2003-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. Notes: svn path=/head/; revision=118047
* Expose vop_rmextattr as an explicit operation at the vnode operationRobert Watson2003-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 Notes: svn path=/head/; revision=116698
* Add comment about **vpp being special-cased in vnode_if.awk (1.38)Stefan Eßer2003-06-201-0/+6
| | | | Notes: svn path=/head/; revision=116615
* Add vop_listextattr(), similar to vop_getextattr() but without aRobert Watson2003-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 Notes: svn path=/head/; revision=115867
* Temporarily introduce a new VOP_SPECSTRATEGY operation while I tryPoul-Henning Kamp2003-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 Notes: svn path=/head/; revision=108686
* Flush vop_refreshlabel() definition, since it is no longer used.Robert Watson2002-12-241-9/+0
| | | | | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=108263
* - We don't need any automated lock checking for vop_islocked.Jeff Roberson2002-09-261-1/+1
| | | | Notes: svn path=/head/; revision=103980
* VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link()Don Lewis2002-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) Notes: svn path=/head/; revision=103636
* Introduce the VOP_OPENEXTATTR() and VOP_CLOSEEXTATTR() methods.Poul-Henning Kamp2002-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 Notes: svn path=/head/; revision=102990