vnode_if.src revision 51679
1# 2# Copyright (c) 1992, 1993 3# The Regents of the University of California. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright 9# notice, this list of conditions and the following disclaimer. 10# 2. Redistributions in binary form must reproduce the above copyright 11# notice, this list of conditions and the following disclaimer in the 12# documentation and/or other materials provided with the distribution. 13# 3. All advertising materials mentioning features or use of this software 14# must display the following acknowledgement: 15# This product includes software developed by the University of 16# California, Berkeley and its contributors. 17# 4. Neither the name of the University nor the names of its contributors 18# may be used to endorse or promote products derived from this software 19# without specific prior written permission. 20# 21# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31# SUCH DAMAGE. 32# 33# @(#)vnode_if.src 8.12 (Berkeley) 5/14/95 34# $FreeBSD: head/sys/kern/vnode_if.src 51679 1999-09-26 18:10:59Z eivind $ 35# 36 37# 38# Above each of the vop descriptors is a specification of the locking 39# protocol used by each vop call. The first column is the name of 40# the variable, the remaining three columns are in, out and error 41# respectively. The "in" column defines the lock state on input, 42# the "out" column defines the state on succesful return, and the 43# "error" column defines the locking state on error exit. 44# 45# The locking value can take the following values: 46# L: locked. 47# U: unlocked. 48# -: not applicable. vnode does not yet (or no longer) exists. 49# =: the same on input and output, may be either L or U. 50# X: locked if not nil. 51# 52 53# 54#% islocked vp = = = 55# 56vop_islocked { 57 IN struct vnode *vp; 58}; 59 60# 61#% lookup dvp L ? ? 62#% lookup vpp - L - 63# 64# XXX - the lookup locking protocol defies simple description and depends 65# on the flags and operation fields in the (cnp) structure. Note 66# especially that *vpp may equal dvp and both may be locked. 67# 68vop_lookup { 69 IN struct vnode *dvp; 70 INOUT struct vnode **vpp; 71 IN struct componentname *cnp; 72}; 73 74# 75#% cachedlookup dvp L ? ? 76#% cachedlookup vpp - L - 77# 78# This must be an exact copy of lookup. See kern/vfs_cache.c for details. 79# 80vop_cachedlookup { 81 IN struct vnode *dvp; 82 INOUT struct vnode **vpp; 83 IN struct componentname *cnp; 84}; 85 86# 87#% create dvp L L L 88#% create vpp - L - 89# 90vop_create { 91 IN struct vnode *dvp; 92 OUT struct vnode **vpp; 93 IN struct componentname *cnp; 94 IN struct vattr *vap; 95}; 96 97# 98#% whiteout dvp L L L 99# 100vop_whiteout { 101 IN struct vnode *dvp; 102 IN struct componentname *cnp; 103 IN int flags; 104}; 105 106# 107#% mknod dvp L L L 108#% mknod vpp - X - 109# 110vop_mknod { 111 IN struct vnode *dvp; 112 OUT WILLRELE struct vnode **vpp; 113 IN struct componentname *cnp; 114 IN struct vattr *vap; 115}; 116 117# 118#% open vp L L L 119# 120vop_open { 121 IN struct vnode *vp; 122 IN int mode; 123 IN struct ucred *cred; 124 IN struct proc *p; 125}; 126 127# 128#% close vp U U U 129# 130vop_close { 131 IN struct vnode *vp; 132 IN int fflag; 133 IN struct ucred *cred; 134 IN struct proc *p; 135}; 136 137# 138#% access vp L L L 139# 140vop_access { 141 IN struct vnode *vp; 142 IN int mode; 143 IN struct ucred *cred; 144 IN struct proc *p; 145}; 146 147# 148#% getattr vp = = = 149# 150vop_getattr { 151 IN struct vnode *vp; 152 IN struct vattr *vap; 153 IN struct ucred *cred; 154 IN struct proc *p; 155}; 156 157# 158#% setattr vp L L L 159# 160vop_setattr { 161 IN struct vnode *vp; 162 IN struct vattr *vap; 163 IN struct ucred *cred; 164 IN struct proc *p; 165}; 166 167# 168#% read vp L L L 169# 170vop_read { 171 IN struct vnode *vp; 172 INOUT struct uio *uio; 173 IN int ioflag; 174 IN struct ucred *cred; 175}; 176 177# 178#% write vp L L L 179# 180vop_write { 181 IN struct vnode *vp; 182 INOUT struct uio *uio; 183 IN int ioflag; 184 IN struct ucred *cred; 185}; 186 187# 188#% lease vp = = = 189# 190vop_lease { 191 IN struct vnode *vp; 192 IN struct proc *p; 193 IN struct ucred *cred; 194 IN int flag; 195}; 196 197# 198#% ioctl vp U U U 199# 200vop_ioctl { 201 IN struct vnode *vp; 202 IN u_long command; 203 IN caddr_t data; 204 IN int fflag; 205 IN struct ucred *cred; 206 IN struct proc *p; 207}; 208 209# 210#% poll vp U U U 211# 212vop_poll { 213 IN struct vnode *vp; 214 IN int events; 215 IN struct ucred *cred; 216 IN struct proc *p; 217}; 218 219# 220#% revoke vp U U U 221# 222vop_revoke { 223 IN struct vnode *vp; 224 IN int flags; 225}; 226 227# 228# XXX - not used 229# 230vop_mmap { 231 IN struct vnode *vp; 232 IN int fflags; 233 IN struct ucred *cred; 234 IN struct proc *p; 235}; 236 237# 238#% fsync vp L L L 239# 240vop_fsync { 241 IN struct vnode *vp; 242 IN struct ucred *cred; 243 IN int waitfor; 244 IN struct proc *p; 245}; 246 247# 248#% remove dvp L L L 249#% remove vp L L L 250# 251vop_remove { 252 IN struct vnode *dvp; 253 IN struct vnode *vp; 254 IN struct componentname *cnp; 255}; 256 257# 258#% link tdvp L L L 259#% link vp U U U 260# 261vop_link { 262 IN struct vnode *tdvp; 263 IN struct vnode *vp; 264 IN struct componentname *cnp; 265}; 266 267# 268#% rename fdvp U U U 269#% rename fvp U U U 270#% rename tdvp L U U 271#% rename tvp X U U 272# 273vop_rename { 274 IN WILLRELE struct vnode *fdvp; 275 IN WILLRELE struct vnode *fvp; 276 IN struct componentname *fcnp; 277 IN WILLRELE struct vnode *tdvp; 278 IN WILLRELE struct vnode *tvp; 279 IN struct componentname *tcnp; 280}; 281 282# 283#% mkdir dvp L L L 284#% mkdir vpp - L - 285# 286vop_mkdir { 287 IN struct vnode *dvp; 288 OUT struct vnode **vpp; 289 IN struct componentname *cnp; 290 IN struct vattr *vap; 291}; 292 293# 294#% rmdir dvp L L L 295#% rmdir vp L L L 296# 297vop_rmdir { 298 IN struct vnode *dvp; 299 IN struct vnode *vp; 300 IN struct componentname *cnp; 301}; 302 303# 304#% symlink dvp L L L 305#% symlink vpp - U - 306# 307# XXX - note that the return vnode has already been VRELE'ed 308# by the filesystem layer. To use it you must use vget, 309# possibly with a further namei. 310# 311vop_symlink { 312 IN struct vnode *dvp; 313 OUT WILLRELE struct vnode **vpp; 314 IN struct componentname *cnp; 315 IN struct vattr *vap; 316 IN char *target; 317}; 318 319# 320#% readdir vp L L L 321# 322vop_readdir { 323 IN struct vnode *vp; 324 INOUT struct uio *uio; 325 IN struct ucred *cred; 326 INOUT int *eofflag; 327 OUT int *ncookies; 328 INOUT u_long **cookies; 329}; 330 331# 332#% readlink vp L L L 333# 334vop_readlink { 335 IN struct vnode *vp; 336 INOUT struct uio *uio; 337 IN struct ucred *cred; 338}; 339 340# 341#% abortop dvp = = = 342# 343vop_abortop { 344 IN struct vnode *dvp; 345 IN struct componentname *cnp; 346}; 347 348# 349#% inactive vp L U U 350# 351vop_inactive { 352 IN struct vnode *vp; 353 IN struct proc *p; 354}; 355 356# 357#% reclaim vp U U U 358# 359vop_reclaim { 360 IN struct vnode *vp; 361 IN struct proc *p; 362}; 363 364# 365#% lock vp U L U 366# 367vop_lock { 368 IN struct vnode *vp; 369 IN int flags; 370 IN struct proc *p; 371}; 372 373# 374#% unlock vp L U L 375# 376vop_unlock { 377 IN struct vnode *vp; 378 IN int flags; 379 IN struct proc *p; 380}; 381 382# 383#% bmap vp L L L 384#% bmap vpp - U - 385# 386vop_bmap { 387 IN struct vnode *vp; 388 IN daddr_t bn; 389 OUT struct vnode **vpp; 390 IN daddr_t *bnp; 391 OUT int *runp; 392 OUT int *runb; 393}; 394 395# 396#% strategy vp L L L 397# 398vop_strategy { 399 IN struct vnode *vp; 400 IN struct buf *bp; 401}; 402 403# 404#% print vp = = = 405# 406vop_print { 407 IN struct vnode *vp; 408}; 409 410# 411#% pathconf vp L L L 412# 413vop_pathconf { 414 IN struct vnode *vp; 415 IN int name; 416 OUT register_t *retval; 417}; 418 419# 420#% advlock vp U U U 421# 422vop_advlock { 423 IN struct vnode *vp; 424 IN caddr_t id; 425 IN int op; 426 IN struct flock *fl; 427 IN int flags; 428}; 429 430# 431#% balloc vp L L L 432# 433vop_balloc { 434 IN struct vnode *vp; 435 IN off_t startoffset; 436 IN int size; 437 IN struct ucred *cred; 438 IN int flags; 439 OUT struct buf **bpp; 440}; 441 442# 443#% reallocblks vp L L L 444# 445vop_reallocblks { 446 IN struct vnode *vp; 447 IN struct cluster_save *buflist; 448}; 449 450# 451#% getpages vp L L L 452# 453vop_getpages { 454 IN struct vnode *vp; 455 IN vm_page_t *m; 456 IN int count; 457 IN int reqpage; 458 IN vm_ooffset_t offset; 459}; 460 461# 462#% putpages vp L L L 463# 464vop_putpages { 465 IN struct vnode *vp; 466 IN vm_page_t *m; 467 IN int count; 468 IN int sync; 469 IN int *rtvals; 470 IN vm_ooffset_t offset; 471}; 472 473# 474#% freeblks vp - - - 475# 476# This call is used by the filesystem to release blocks back to 477# device-driver. This is useful if the driver has a lengthy 478# erase handling or similar. 479# 480 481vop_freeblks { 482 IN struct vnode *vp; 483 IN daddr_t addr; 484 IN daddr_t length; 485}; 486 487# 488#% bwrite vp L L L 489# 490vop_bwrite { 491 IN struct vnode *vp; 492 IN struct buf *bp; 493}; 494