vnode_if.src revision 35823
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 3435823Smsmith# $Id: vnode_if.src,v 1.16 1998/03/08 09:57:26 julian 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# 8035823Smsmith#% create dvp L L L 8122521Sdyson#% create vpp - L - 8222521Sdyson# 831541Srgrimesvop_create { 8435823Smsmith IN 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 { 9635823Smsmith IN struct vnode *dvp; 9722521Sdyson IN struct componentname *cnp; 9822521Sdyson IN int flags; 9922521Sdyson}; 10022521Sdyson 10122521Sdyson# 10235823Smsmith#% mknod dvp L L L 10322521Sdyson#% mknod vpp - X - 10422521Sdyson# 1051541Srgrimesvop_mknod { 10635823Smsmith IN 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# 20529353Speter#% poll vp U U U 20622521Sdyson# 20729353Spetervop_poll { 2081541Srgrimes IN struct vnode *vp; 20929353Speter IN int events; 2101541Srgrimes IN struct ucred *cred; 2111541Srgrimes IN struct proc *p; 2121541Srgrimes}; 2131541Srgrimes 21422521Sdyson# 21522521Sdyson#% revoke vp U U U 21622521Sdyson# 21722521Sdysonvop_revoke { 21822521Sdyson IN struct vnode *vp; 21922521Sdyson IN int flags; 22022521Sdyson}; 22122521Sdyson 22222521Sdyson# 22322521Sdyson# XXX - not used 22422521Sdyson# 2251541Srgrimesvop_mmap { 2261541Srgrimes IN struct vnode *vp; 2271541Srgrimes IN int fflags; 2281541Srgrimes IN struct ucred *cred; 2291541Srgrimes IN struct proc *p; 2301541Srgrimes}; 2311541Srgrimes 23222521Sdyson# 23322521Sdyson#% fsync vp L L L 23422521Sdyson# 2351541Srgrimesvop_fsync { 2361541Srgrimes IN struct vnode *vp; 2371541Srgrimes IN struct ucred *cred; 2381541Srgrimes IN int waitfor; 2391541Srgrimes IN struct proc *p; 2401541Srgrimes}; 2411541Srgrimes 24222521Sdyson# 24335823Smsmith#% remove dvp L L L 24435823Smsmith#% remove vp L L L 24522521Sdyson# 2461541Srgrimesvop_remove { 24735823Smsmith IN struct vnode *dvp; 24835823Smsmith IN struct vnode *vp; 2491541Srgrimes IN struct componentname *cnp; 2501541Srgrimes}; 2511541Srgrimes 25222521Sdyson# 25335823Smsmith#% link tdvp L L L 25422521Sdyson#% link vp U U U 25522521Sdyson# 2569842Sdgvop_link { 25735823Smsmith IN struct vnode *tdvp; 2589842Sdg IN struct vnode *vp; 2599842Sdg IN struct componentname *cnp; 2609842Sdg}; 2611541Srgrimes 26222521Sdyson# 26322521Sdyson#% rename fdvp U U U 26422521Sdyson#% rename fvp U U U 26522521Sdyson#% rename tdvp L U U 26622521Sdyson#% rename tvp X U U 26722521Sdyson# 2681541Srgrimesvop_rename { 2691541Srgrimes IN WILLRELE struct vnode *fdvp; 2701541Srgrimes IN WILLRELE struct vnode *fvp; 2711541Srgrimes IN struct componentname *fcnp; 2721541Srgrimes IN WILLRELE struct vnode *tdvp; 2731541Srgrimes IN WILLRELE struct vnode *tvp; 2741541Srgrimes IN struct componentname *tcnp; 2751541Srgrimes}; 2761541Srgrimes 27722521Sdyson# 27835823Smsmith#% mkdir dvp L L L 27922521Sdyson#% mkdir vpp - L - 28022521Sdyson# 2811541Srgrimesvop_mkdir { 28235823Smsmith IN struct vnode *dvp; 2831541Srgrimes OUT struct vnode **vpp; 2841541Srgrimes IN struct componentname *cnp; 2851541Srgrimes IN struct vattr *vap; 2861541Srgrimes}; 2871541Srgrimes 28822521Sdyson# 28935823Smsmith#% rmdir dvp L L L 29035823Smsmith#% rmdir vp L L L 29122521Sdyson# 2921541Srgrimesvop_rmdir { 29335823Smsmith IN struct vnode *dvp; 29435823Smsmith IN struct vnode *vp; 2951541Srgrimes IN struct componentname *cnp; 2961541Srgrimes}; 2971541Srgrimes 29822521Sdyson# 29935823Smsmith#% symlink dvp L L L 30022521Sdyson#% symlink vpp - U - 30122521Sdyson# 30222521Sdyson# XXX - note that the return vnode has already been VRELE'ed 30322521Sdyson# by the filesystem layer. To use it you must use vget, 30422521Sdyson# possibly with a further namei. 30522521Sdyson# 3061541Srgrimesvop_symlink { 30735823Smsmith IN struct vnode *dvp; 3081541Srgrimes OUT WILLRELE struct vnode **vpp; 3091541Srgrimes IN struct componentname *cnp; 3101541Srgrimes IN struct vattr *vap; 3111541Srgrimes IN char *target; 3121541Srgrimes}; 3131541Srgrimes 31422521Sdyson# 31522521Sdyson#% readdir vp L L L 31622521Sdyson# 3171541Srgrimesvop_readdir { 3181541Srgrimes IN struct vnode *vp; 3191541Srgrimes INOUT struct uio *uio; 3201541Srgrimes IN struct ucred *cred; 3213167Sdfr INOUT int *eofflag; 32222521Sdyson OUT int *ncookies; 32322521Sdyson INOUT u_long **cookies; 3241541Srgrimes}; 3251541Srgrimes 32622521Sdyson# 32722521Sdyson#% readlink vp L L L 32822521Sdyson# 3291541Srgrimesvop_readlink { 3301541Srgrimes IN struct vnode *vp; 3311541Srgrimes INOUT struct uio *uio; 3321541Srgrimes IN struct ucred *cred; 3331541Srgrimes}; 3341541Srgrimes 33522521Sdyson# 33622521Sdyson#% abortop dvp = = = 33722521Sdyson# 3381541Srgrimesvop_abortop { 3391541Srgrimes IN struct vnode *dvp; 3401541Srgrimes IN struct componentname *cnp; 3411541Srgrimes}; 3421541Srgrimes 34322521Sdyson# 34422521Sdyson#% inactive vp L U U 34522521Sdyson# 3461541Srgrimesvop_inactive { 3471541Srgrimes IN struct vnode *vp; 34822521Sdyson IN struct proc *p; 3491541Srgrimes}; 3501541Srgrimes 35122521Sdyson# 35222521Sdyson#% reclaim vp U U U 35322521Sdyson# 3541541Srgrimesvop_reclaim { 3551541Srgrimes IN struct vnode *vp; 35622521Sdyson IN struct proc *p; 3571541Srgrimes}; 3581541Srgrimes 35922521Sdyson# 36022521Sdyson#% lock vp U L U 36122521Sdyson# 3621541Srgrimesvop_lock { 3631541Srgrimes IN struct vnode *vp; 36422521Sdyson IN int flags; 36522521Sdyson IN struct proc *p; 3661541Srgrimes}; 3671541Srgrimes 36822521Sdyson# 36922521Sdyson#% unlock vp L U L 37022521Sdyson# 3711541Srgrimesvop_unlock { 3721541Srgrimes IN struct vnode *vp; 37322521Sdyson IN int flags; 37422521Sdyson IN struct proc *p; 3751541Srgrimes}; 3761541Srgrimes 37722521Sdyson# 37822521Sdyson#% bmap vp L L L 37922521Sdyson#% bmap vpp - U - 38022521Sdyson# 3811541Srgrimesvop_bmap { 3821541Srgrimes IN struct vnode *vp; 3831541Srgrimes IN daddr_t bn; 3841541Srgrimes OUT struct vnode **vpp; 3851541Srgrimes IN daddr_t *bnp; 3861541Srgrimes OUT int *runp; 38710551Sdyson OUT int *runb; 3881541Srgrimes}; 3891541Srgrimes 39022521Sdyson# 39122521Sdyson# Needs work: no vp? 39222521Sdyson# 3931541Srgrimes#vop_strategy { 3941541Srgrimes# IN struct buf *bp; 3951541Srgrimes#}; 3961541Srgrimes 39722521Sdyson# 39822521Sdyson#% print vp = = = 39922521Sdyson# 4001541Srgrimesvop_print { 4011541Srgrimes IN struct vnode *vp; 4021541Srgrimes}; 4031541Srgrimes 40422521Sdyson# 40522521Sdyson#% islocked vp = = = 40622521Sdyson# 4071541Srgrimesvop_islocked { 4081541Srgrimes IN struct vnode *vp; 4091541Srgrimes}; 4101541Srgrimes 41122521Sdyson# 41222521Sdyson#% pathconf vp L L L 41322521Sdyson# 4141541Srgrimesvop_pathconf { 4151541Srgrimes IN struct vnode *vp; 4161541Srgrimes IN int name; 41722521Sdyson OUT register_t *retval; 4181541Srgrimes}; 4191541Srgrimes 42022521Sdyson# 42122521Sdyson#% advlock vp U U U 42222521Sdyson# 4231541Srgrimesvop_advlock { 4241541Srgrimes IN struct vnode *vp; 4251541Srgrimes IN caddr_t id; 4261541Srgrimes IN int op; 4271541Srgrimes IN struct flock *fl; 4281541Srgrimes IN int flags; 4291541Srgrimes}; 4301541Srgrimes 43122521Sdyson# 43234266Sjulian#% balloc vp L L L 43334266Sjulian# 43434266Sjulianvop_balloc { 43534266Sjulian IN struct vnode *vp; 43634266Sjulian IN off_t startoffset; 43734266Sjulian IN int size; 43834266Sjulian IN struct ucred *cred; 43934266Sjulian IN int flags; 44034266Sjulian OUT struct buf **bpp; 44134266Sjulian}; 44234266Sjulian 44334266Sjulian# 44422521Sdyson#% reallocblks vp L L L 44522521Sdyson# 4461541Srgrimesvop_reallocblks { 4471541Srgrimes IN struct vnode *vp; 4481541Srgrimes IN struct cluster_save *buflist; 4491541Srgrimes}; 4501541Srgrimes 45110551Sdysonvop_getpages { 45210551Sdyson IN struct vnode *vp; 45310551Sdyson IN vm_page_t *m; 45410551Sdyson IN int count; 45510551Sdyson IN int reqpage; 45612767Sdyson IN vm_ooffset_t offset; 45710551Sdyson}; 45810551Sdyson 45910551Sdysonvop_putpages { 46010551Sdyson IN struct vnode *vp; 46110551Sdyson IN vm_page_t *m; 46210551Sdyson IN int count; 46310551Sdyson IN int sync; 46410551Sdyson IN int *rtvals; 46512767Sdyson IN vm_ooffset_t offset; 46610551Sdyson}; 46711704Sdyson 46822521Sdyson# 4691541Srgrimes# Needs work: no vp? 47022521Sdyson# 4711541Srgrimes#vop_bwrite { 4721541Srgrimes# IN struct buf *bp; 4731541Srgrimes#}; 474