vnode_if.src revision 28732
11541Srgrimes# 21541Srgrimes# Copyright (c) 1992, 1993 31541Srgrimes# The Regents of the University of California. All rights reserved. 41541Srgrimes# 51541Srgrimes# Redistribution and use in source and binary forms, with or without 61541Srgrimes# modification, are permitted provided that the following conditions 71541Srgrimes# are met: 81541Srgrimes# 1. Redistributions of source code must retain the above copyright 91541Srgrimes# notice, this list of conditions and the following disclaimer. 101541Srgrimes# 2. Redistributions in binary form must reproduce the above copyright 111541Srgrimes# notice, this list of conditions and the following disclaimer in the 121541Srgrimes# documentation and/or other materials provided with the distribution. 131541Srgrimes# 3. All advertising materials mentioning features or use of this software 141541Srgrimes# must display the following acknowledgement: 151541Srgrimes# This product includes software developed by the University of 161541Srgrimes# California, Berkeley and its contributors. 171541Srgrimes# 4. Neither the name of the University nor the names of its contributors 181541Srgrimes# may be used to endorse or promote products derived from this software 191541Srgrimes# without specific prior written permission. 201541Srgrimes# 211541Srgrimes# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221541Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231541Srgrimes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241541Srgrimes# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251541Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261541Srgrimes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271541Srgrimes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281541Srgrimes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291541Srgrimes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301541Srgrimes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311541Srgrimes# SUCH DAMAGE. 321541Srgrimes# 3322521Sdyson# @(#)vnode_if.src 8.12 (Berkeley) 5/14/95 3428732Sphk# $Id: vnode_if.src,v 1.11 1997/02/10 02:11:11 dyson Exp $ 351541Srgrimes# 3622521Sdyson 3722521Sdyson# 3822521Sdyson# Above each of the vop descriptors is a specification of the locking 3922521Sdyson# protocol used by each vop call. The first column is the name of 4022521Sdyson# the variable, the remaining three columns are in, out and error 4122521Sdyson# respectively. The "in" column defines the lock state on input, 4222521Sdyson# the "out" column defines the state on succesful return, and the 4322521Sdyson# "error" column defines the locking state on error exit. 4422521Sdyson# 4522521Sdyson# The locking value can take the following values: 4622521Sdyson# L: locked. 4722521Sdyson# U: unlocked/ 4822521Sdyson# -: not applicable. vnode does not yet (or no longer) exists. 4922521Sdyson# =: the same on input and output, may be either L or U. 5022521Sdyson# X: locked if not nil. 5122521Sdyson# 5222521Sdyson 5322521Sdyson# 5422521Sdyson#% lookup dvp L ? ? 5522521Sdyson#% lookup vpp - L - 5622521Sdyson# 5722521Sdyson# XXX - the lookup locking protocol defies simple description and depends 5822521Sdyson# on the flags and operation fields in the (cnp) structure. Note 5922521Sdyson# especially that *vpp may equal dvp and both may be locked. 6022521Sdyson# 611541Srgrimesvop_lookup { 621541Srgrimes IN struct vnode *dvp; 631541Srgrimes INOUT struct vnode **vpp; 641541Srgrimes IN struct componentname *cnp; 651541Srgrimes}; 661541Srgrimes 6722521Sdyson# 6828732Sphk#% cachedlookup dvp L ? ? 6928732Sphk#% cachedlookup vpp - L - 7028732Sphk# 7128732Sphk# This must be an exact copy of lookup. See kern/vfs_cache.c for details. 7228732Sphk# 7328732Sphkvop_cachedlookup { 7428732Sphk IN struct vnode *dvp; 7528732Sphk INOUT struct vnode **vpp; 7628732Sphk IN struct componentname *cnp; 7728732Sphk}; 7828732Sphk 7928732Sphk# 8022521Sdyson#% create dvp L U U 8122521Sdyson#% create vpp - L - 8222521Sdyson# 831541Srgrimesvop_create { 841541Srgrimes IN WILLRELE struct vnode *dvp; 851541Srgrimes OUT struct vnode **vpp; 861541Srgrimes IN struct componentname *cnp; 871541Srgrimes IN struct vattr *vap; 881541Srgrimes}; 891541Srgrimes 9022521Sdyson# 9122521Sdyson#% whiteout dvp L L L 9222521Sdyson#% whiteout cnp - - - 9322521Sdyson#% whiteout flag - - - 9422521Sdyson# 9522521Sdysonvop_whiteout { 9622521Sdyson IN WILLRELE struct vnode *dvp; 9722521Sdyson IN struct componentname *cnp; 9822521Sdyson IN int flags; 9922521Sdyson}; 10022521Sdyson 10122521Sdyson# 10222521Sdyson#% mknod dvp L U U 10322521Sdyson#% mknod vpp - X - 10422521Sdyson# 1051541Srgrimesvop_mknod { 1061541Srgrimes IN WILLRELE struct vnode *dvp; 1071541Srgrimes OUT WILLRELE struct vnode **vpp; 1081541Srgrimes IN struct componentname *cnp; 1091541Srgrimes IN struct vattr *vap; 1101541Srgrimes}; 1111541Srgrimes 11222521Sdyson# 11322521Sdyson#% open vp L L L 11422521Sdyson# 1151541Srgrimesvop_open { 1161541Srgrimes IN struct vnode *vp; 1171541Srgrimes IN int mode; 1181541Srgrimes IN struct ucred *cred; 1191541Srgrimes IN struct proc *p; 1201541Srgrimes}; 1211541Srgrimes 12222521Sdyson# 12322521Sdyson#% close vp U U U 12422521Sdyson# 1251541Srgrimesvop_close { 1261541Srgrimes IN struct vnode *vp; 1271541Srgrimes IN int fflag; 1281541Srgrimes IN struct ucred *cred; 1291541Srgrimes IN struct proc *p; 1301541Srgrimes}; 1311541Srgrimes 13222521Sdyson# 13322521Sdyson#% access vp L L L 13422521Sdyson# 1351541Srgrimesvop_access { 1361541Srgrimes IN struct vnode *vp; 1371541Srgrimes IN int mode; 1381541Srgrimes IN struct ucred *cred; 1391541Srgrimes IN struct proc *p; 1401541Srgrimes}; 1411541Srgrimes 14222521Sdyson# 14322521Sdyson#% getattr vp = = = 14422521Sdyson# 1451541Srgrimesvop_getattr { 1461541Srgrimes IN struct vnode *vp; 1471541Srgrimes IN struct vattr *vap; 1481541Srgrimes IN struct ucred *cred; 1491541Srgrimes IN struct proc *p; 1501541Srgrimes}; 1511541Srgrimes 15222521Sdyson# 15322521Sdyson#% setattr vp L L L 15422521Sdyson# 1551541Srgrimesvop_setattr { 1561541Srgrimes IN struct vnode *vp; 1571541Srgrimes IN struct vattr *vap; 1581541Srgrimes IN struct ucred *cred; 1591541Srgrimes IN struct proc *p; 1601541Srgrimes}; 1611541Srgrimes 16222521Sdyson# 16322521Sdyson#% read vp L L L 16422521Sdyson# 1651541Srgrimesvop_read { 1661541Srgrimes IN struct vnode *vp; 1671541Srgrimes INOUT struct uio *uio; 1681541Srgrimes IN int ioflag; 1691541Srgrimes IN struct ucred *cred; 1701541Srgrimes}; 1711541Srgrimes 17222521Sdyson# 17322521Sdyson#% write vp L L L 17422521Sdyson# 1751541Srgrimesvop_write { 1761541Srgrimes IN struct vnode *vp; 1771541Srgrimes INOUT struct uio *uio; 1781541Srgrimes IN int ioflag; 1791541Srgrimes IN struct ucred *cred; 1801541Srgrimes}; 1811541Srgrimes 18222521Sdyson# 18322521Sdyson#% lease vp = = = 18422521Sdyson# 18522521Sdysonvop_lease { 18622521Sdyson IN struct vnode *vp; 18722521Sdyson IN struct proc *p; 18822521Sdyson IN struct ucred *cred; 18922521Sdyson IN int flag; 19022521Sdyson}; 19122521Sdyson 19222521Sdyson# 19322521Sdyson#% ioctl vp U U U 19422521Sdyson# 1951541Srgrimesvop_ioctl { 1961541Srgrimes IN struct vnode *vp; 19722521Sdyson IN u_long command; 1981541Srgrimes IN caddr_t data; 1991541Srgrimes IN int fflag; 2001541Srgrimes IN struct ucred *cred; 2011541Srgrimes IN struct proc *p; 2021541Srgrimes}; 2031541Srgrimes 20422521Sdyson# 20522521Sdyson#% select vp U U U 20622521Sdyson# 2071541Srgrimes# Needs work? (fflags) 20822521Sdyson# 2091541Srgrimesvop_select { 2101541Srgrimes IN struct vnode *vp; 2111541Srgrimes IN int which; 2121541Srgrimes IN int fflags; 2131541Srgrimes IN struct ucred *cred; 2141541Srgrimes IN struct proc *p; 2151541Srgrimes}; 2161541Srgrimes 21722521Sdyson# 21822521Sdyson#% revoke vp U U U 21922521Sdyson# 22022521Sdysonvop_revoke { 22122521Sdyson IN struct vnode *vp; 22222521Sdyson IN int flags; 22322521Sdyson}; 22422521Sdyson 22522521Sdyson# 22622521Sdyson# XXX - not used 22722521Sdyson# 2281541Srgrimesvop_mmap { 2291541Srgrimes IN struct vnode *vp; 2301541Srgrimes IN int fflags; 2311541Srgrimes IN struct ucred *cred; 2321541Srgrimes IN struct proc *p; 2331541Srgrimes}; 2341541Srgrimes 23522521Sdyson# 23622521Sdyson#% fsync vp L L L 23722521Sdyson# 2381541Srgrimesvop_fsync { 2391541Srgrimes IN struct vnode *vp; 2401541Srgrimes IN struct ucred *cred; 2411541Srgrimes IN int waitfor; 2421541Srgrimes IN struct proc *p; 2431541Srgrimes}; 2441541Srgrimes 24522521Sdyson# 24622521Sdyson# XXX - not used 24722521Sdyson# Needs work: Is newoff right? What's it mean? 24822521Sdyson# 2491541Srgrimesvop_seek { 2501541Srgrimes IN struct vnode *vp; 2511541Srgrimes IN off_t oldoff; 2521541Srgrimes IN off_t newoff; 2531541Srgrimes IN struct ucred *cred; 2541541Srgrimes}; 2551541Srgrimes 25622521Sdyson# 25722521Sdyson#% remove dvp L U U 25822521Sdyson#% remove vp L U U 25922521Sdyson# 2601541Srgrimesvop_remove { 2611541Srgrimes IN WILLRELE struct vnode *dvp; 2621541Srgrimes IN WILLRELE struct vnode *vp; 2631541Srgrimes IN struct componentname *cnp; 2641541Srgrimes}; 2651541Srgrimes 26622521Sdyson# 26722521Sdyson#% link vp U U U 26822521Sdyson#% link tdvp L U U 26922521Sdyson# 2709842Sdgvop_link { 2719842Sdg IN WILLRELE struct vnode *tdvp; 2729842Sdg IN struct vnode *vp; 2739842Sdg IN struct componentname *cnp; 2749842Sdg}; 2751541Srgrimes 27622521Sdyson# 27722521Sdyson#% rename fdvp U U U 27822521Sdyson#% rename fvp U U U 27922521Sdyson#% rename tdvp L U U 28022521Sdyson#% rename tvp X U U 28122521Sdyson# 2821541Srgrimesvop_rename { 2831541Srgrimes IN WILLRELE struct vnode *fdvp; 2841541Srgrimes IN WILLRELE struct vnode *fvp; 2851541Srgrimes IN struct componentname *fcnp; 2861541Srgrimes IN WILLRELE struct vnode *tdvp; 2871541Srgrimes IN WILLRELE struct vnode *tvp; 2881541Srgrimes IN struct componentname *tcnp; 2891541Srgrimes}; 2901541Srgrimes 29122521Sdyson# 29222521Sdyson#% mkdir dvp L U U 29322521Sdyson#% mkdir vpp - L - 29422521Sdyson# 2951541Srgrimesvop_mkdir { 2961541Srgrimes IN WILLRELE struct vnode *dvp; 2971541Srgrimes OUT struct vnode **vpp; 2981541Srgrimes IN struct componentname *cnp; 2991541Srgrimes IN struct vattr *vap; 3001541Srgrimes}; 3011541Srgrimes 30222521Sdyson# 30322521Sdyson#% rmdir dvp L U U 30422521Sdyson#% rmdir vp L U U 30522521Sdyson# 3061541Srgrimesvop_rmdir { 3071541Srgrimes IN WILLRELE struct vnode *dvp; 3081541Srgrimes IN WILLRELE struct vnode *vp; 3091541Srgrimes IN struct componentname *cnp; 3101541Srgrimes}; 3111541Srgrimes 31222521Sdyson# 31322521Sdyson#% symlink dvp L U U 31422521Sdyson#% symlink vpp - U - 31522521Sdyson# 31622521Sdyson# XXX - note that the return vnode has already been VRELE'ed 31722521Sdyson# by the filesystem layer. To use it you must use vget, 31822521Sdyson# possibly with a further namei. 31922521Sdyson# 3201541Srgrimesvop_symlink { 3211541Srgrimes IN WILLRELE struct vnode *dvp; 3221541Srgrimes OUT WILLRELE struct vnode **vpp; 3231541Srgrimes IN struct componentname *cnp; 3241541Srgrimes IN struct vattr *vap; 3251541Srgrimes IN char *target; 3261541Srgrimes}; 3271541Srgrimes 32822521Sdyson# 32922521Sdyson#% readdir vp L L L 33022521Sdyson# 3311541Srgrimesvop_readdir { 3321541Srgrimes IN struct vnode *vp; 3331541Srgrimes INOUT struct uio *uio; 3341541Srgrimes IN struct ucred *cred; 3353167Sdfr INOUT int *eofflag; 33622521Sdyson OUT int *ncookies; 33722521Sdyson INOUT u_long **cookies; 3381541Srgrimes}; 3391541Srgrimes 34022521Sdyson# 34122521Sdyson#% readlink vp L L L 34222521Sdyson# 3431541Srgrimesvop_readlink { 3441541Srgrimes IN struct vnode *vp; 3451541Srgrimes INOUT struct uio *uio; 3461541Srgrimes IN struct ucred *cred; 3471541Srgrimes}; 3481541Srgrimes 34922521Sdyson# 35022521Sdyson#% abortop dvp = = = 35122521Sdyson# 3521541Srgrimesvop_abortop { 3531541Srgrimes IN struct vnode *dvp; 3541541Srgrimes IN struct componentname *cnp; 3551541Srgrimes}; 3561541Srgrimes 35722521Sdyson# 35822521Sdyson#% inactive vp L U U 35922521Sdyson# 3601541Srgrimesvop_inactive { 3611541Srgrimes IN struct vnode *vp; 36222521Sdyson IN struct proc *p; 3631541Srgrimes}; 3641541Srgrimes 36522521Sdyson# 36622521Sdyson#% reclaim vp U U U 36722521Sdyson# 3681541Srgrimesvop_reclaim { 3691541Srgrimes IN struct vnode *vp; 37022521Sdyson IN struct proc *p; 3711541Srgrimes}; 3721541Srgrimes 37322521Sdyson# 37422521Sdyson#% lock vp U L U 37522521Sdyson# 3761541Srgrimesvop_lock { 3771541Srgrimes IN struct vnode *vp; 37822521Sdyson IN int flags; 37922521Sdyson IN struct proc *p; 3801541Srgrimes}; 3811541Srgrimes 38222521Sdyson# 38322521Sdyson#% unlock vp L U L 38422521Sdyson# 3851541Srgrimesvop_unlock { 3861541Srgrimes IN struct vnode *vp; 38722521Sdyson IN int flags; 38822521Sdyson IN struct proc *p; 3891541Srgrimes}; 3901541Srgrimes 39122521Sdyson# 39222521Sdyson#% bmap vp L L L 39322521Sdyson#% bmap vpp - U - 39422521Sdyson# 3951541Srgrimesvop_bmap { 3961541Srgrimes IN struct vnode *vp; 3971541Srgrimes IN daddr_t bn; 3981541Srgrimes OUT struct vnode **vpp; 3991541Srgrimes IN daddr_t *bnp; 4001541Srgrimes OUT int *runp; 40110551Sdyson OUT int *runb; 4021541Srgrimes}; 4031541Srgrimes 40422521Sdyson# 40522521Sdyson# Needs work: no vp? 40622521Sdyson# 4071541Srgrimes#vop_strategy { 4081541Srgrimes# IN struct buf *bp; 4091541Srgrimes#}; 4101541Srgrimes 41122521Sdyson# 41222521Sdyson#% print vp = = = 41322521Sdyson# 4141541Srgrimesvop_print { 4151541Srgrimes IN struct vnode *vp; 4161541Srgrimes}; 4171541Srgrimes 41822521Sdyson# 41922521Sdyson#% islocked vp = = = 42022521Sdyson# 4211541Srgrimesvop_islocked { 4221541Srgrimes IN struct vnode *vp; 4231541Srgrimes}; 4241541Srgrimes 42522521Sdyson# 42622521Sdyson#% pathconf vp L L L 42722521Sdyson# 4281541Srgrimesvop_pathconf { 4291541Srgrimes IN struct vnode *vp; 4301541Srgrimes IN int name; 43122521Sdyson OUT register_t *retval; 4321541Srgrimes}; 4331541Srgrimes 43422521Sdyson# 43522521Sdyson#% advlock vp U U U 43622521Sdyson# 4371541Srgrimesvop_advlock { 4381541Srgrimes IN struct vnode *vp; 4391541Srgrimes IN caddr_t id; 4401541Srgrimes IN int op; 4411541Srgrimes IN struct flock *fl; 4421541Srgrimes IN int flags; 4431541Srgrimes}; 4441541Srgrimes 44522521Sdyson# 44622521Sdyson#% blkatoff vp L L L 44722521Sdyson# 4481541Srgrimesvop_blkatoff { 4491541Srgrimes IN struct vnode *vp; 4501541Srgrimes IN off_t offset; 4511541Srgrimes OUT char **res; 4521541Srgrimes OUT struct buf **bpp; 4531541Srgrimes}; 4541541Srgrimes 45522521Sdyson# 45622521Sdyson#% valloc pvp L L L 45722521Sdyson# 4581541Srgrimesvop_valloc { 4591541Srgrimes IN struct vnode *pvp; 4601541Srgrimes IN int mode; 4611541Srgrimes IN struct ucred *cred; 4621541Srgrimes OUT struct vnode **vpp; 4631541Srgrimes}; 4641541Srgrimes 46522521Sdyson# 46622521Sdyson#% reallocblks vp L L L 46722521Sdyson# 4681541Srgrimesvop_reallocblks { 4691541Srgrimes IN struct vnode *vp; 4701541Srgrimes IN struct cluster_save *buflist; 4711541Srgrimes}; 4721541Srgrimes 47322521Sdyson# 47422521Sdyson#% vfree pvp L L L 47522521Sdyson# 4761541Srgrimesvop_vfree { 4771541Srgrimes IN struct vnode *pvp; 4781541Srgrimes IN ino_t ino; 4791541Srgrimes IN int mode; 4801541Srgrimes}; 4811541Srgrimes 48222521Sdyson# 48322521Sdyson#% truncate vp L L L 48422521Sdyson# 4851541Srgrimesvop_truncate { 4861541Srgrimes IN struct vnode *vp; 4871541Srgrimes IN off_t length; 4881541Srgrimes IN int flags; 4891541Srgrimes IN struct ucred *cred; 4901541Srgrimes IN struct proc *p; 4911541Srgrimes}; 4921541Srgrimes 49322521Sdyson# 49422521Sdyson#% update vp L L L 49522521Sdyson# 4961541Srgrimesvop_update { 4971541Srgrimes IN struct vnode *vp; 4981541Srgrimes IN struct timeval *access; 4991541Srgrimes IN struct timeval *modify; 5001541Srgrimes IN int waitfor; 5011541Srgrimes}; 5021541Srgrimes 50310551Sdysonvop_getpages { 50410551Sdyson IN struct vnode *vp; 50510551Sdyson IN vm_page_t *m; 50610551Sdyson IN int count; 50710551Sdyson IN int reqpage; 50812767Sdyson IN vm_ooffset_t offset; 50910551Sdyson}; 51010551Sdyson 51110551Sdysonvop_putpages { 51210551Sdyson IN struct vnode *vp; 51310551Sdyson IN vm_page_t *m; 51410551Sdyson IN int count; 51510551Sdyson IN int sync; 51610551Sdyson IN int *rtvals; 51712767Sdyson IN vm_ooffset_t offset; 51810551Sdyson}; 51911704Sdyson 52022521Sdyson# 5211541Srgrimes# Needs work: no vp? 52222521Sdyson# 5231541Srgrimes#vop_bwrite { 5241541Srgrimes# IN struct buf *bp; 5251541Srgrimes#}; 526