vnode_if.src revision 184413
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# 4. Neither the name of the University nor the names of its contributors 14# may be used to endorse or promote products derived from this software 15# without specific prior written permission. 16# 17# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27# SUCH DAMAGE. 28# 29# @(#)vnode_if.src 8.12 (Berkeley) 5/14/95 30# $FreeBSD: head/sys/kern/vnode_if.src 184413 2008-10-28 13:44:11Z trasz $ 31# 32 33# 34# Above each of the vop descriptors in lines starting with %% 35# is a specification of the locking protocol used by each vop call. 36# The first column is the name of the variable, the remaining three 37# columns are in, out and error respectively. The "in" column defines 38# the lock state on input, the "out" column defines the state on succesful 39# return, and the "error" column defines the locking state on error exit. 40# 41# The locking value can take the following values: 42# L: locked; not converted to type of lock. 43# A: any lock type. 44# S: locked with shared lock. 45# E: locked with exclusive lock for this process. 46# O: locked with exclusive lock for other process. 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# The paramater named "vpp" is assumed to be always used with double 53# indirection (**vpp) and that name is hard-codeed in vnode_if.awk ! 54# 55# Lines starting with %! specify a pre or post-condition function 56# to call before/after the vop call. 57# 58# If other such parameters are introduced, they have to be added to 59# the AWK script at the head of the definition of "add_debug_code()". 60# 61 62vop_islocked { 63 IN struct vnode *vp; 64}; 65 66%% lookup dvp L ? ? 67%% lookup vpp - L - 68%! lookup pre vop_lookup_pre 69%! lookup post vop_lookup_post 70 71# XXX - the lookup locking protocol defies simple description and depends 72# on the flags and operation fields in the (cnp) structure. Note 73# especially that *vpp may equal dvp and both may be locked. 74 75vop_lookup { 76 IN struct vnode *dvp; 77 INOUT struct vnode **vpp; 78 IN struct componentname *cnp; 79}; 80 81%% cachedlookup dvp L ? ? 82%% cachedlookup vpp - L - 83 84# This must be an exact copy of lookup. See kern/vfs_cache.c for details. 85 86vop_cachedlookup { 87 IN struct vnode *dvp; 88 INOUT struct vnode **vpp; 89 IN struct componentname *cnp; 90}; 91 92%% create dvp E E E 93%% create vpp - L - 94%! create post vop_create_post 95 96vop_create { 97 IN struct vnode *dvp; 98 OUT struct vnode **vpp; 99 IN struct componentname *cnp; 100 IN struct vattr *vap; 101}; 102 103 104%% whiteout dvp E E E 105 106vop_whiteout { 107 IN struct vnode *dvp; 108 IN struct componentname *cnp; 109 IN int flags; 110}; 111 112 113%% mknod dvp E E E 114%% mknod vpp - L - 115%! mknod post vop_mknod_post 116 117vop_mknod { 118 IN struct vnode *dvp; 119 OUT struct vnode **vpp; 120 IN struct componentname *cnp; 121 IN struct vattr *vap; 122}; 123 124 125%% open vp L L L 126 127vop_open { 128 IN struct vnode *vp; 129 IN int mode; 130 IN struct ucred *cred; 131 IN struct thread *td; 132 IN struct file *fp; 133}; 134 135 136%% close vp E E E 137 138vop_close { 139 IN struct vnode *vp; 140 IN int fflag; 141 IN struct ucred *cred; 142 IN struct thread *td; 143}; 144 145 146%% access vp L L L 147 148vop_access { 149 IN struct vnode *vp; 150 IN accmode_t accmode; 151 IN struct ucred *cred; 152 IN struct thread *td; 153}; 154 155 156%% getattr vp L L L 157 158vop_getattr { 159 IN struct vnode *vp; 160 OUT struct vattr *vap; 161 IN struct ucred *cred; 162}; 163 164 165%% setattr vp E E E 166%! setattr post vop_setattr_post 167 168vop_setattr { 169 IN struct vnode *vp; 170 IN struct vattr *vap; 171 IN struct ucred *cred; 172}; 173 174 175%% read vp L L L 176 177vop_read { 178 IN struct vnode *vp; 179 INOUT struct uio *uio; 180 IN int ioflag; 181 IN struct ucred *cred; 182}; 183 184 185%% write vp E E E 186%! write pre VOP_WRITE_PRE 187%! write post VOP_WRITE_POST 188 189vop_write { 190 IN struct vnode *vp; 191 INOUT struct uio *uio; 192 IN int ioflag; 193 IN struct ucred *cred; 194}; 195 196 197%% lease vp = = = 198 199vop_lease { 200 IN struct vnode *vp; 201 IN struct thread *td; 202 IN struct ucred *cred; 203 IN int flag; 204}; 205 206 207%% ioctl vp U U U 208 209vop_ioctl { 210 IN struct vnode *vp; 211 IN u_long command; 212 IN void *data; 213 IN int fflag; 214 IN struct ucred *cred; 215 IN struct thread *td; 216}; 217 218 219%% poll vp U U U 220 221vop_poll { 222 IN struct vnode *vp; 223 IN int events; 224 IN struct ucred *cred; 225 IN struct thread *td; 226}; 227 228 229%% kqfilter vp U U U 230 231vop_kqfilter { 232 IN struct vnode *vp; 233 IN struct knote *kn; 234}; 235 236 237%% revoke vp L L L 238 239vop_revoke { 240 IN struct vnode *vp; 241 IN int flags; 242}; 243 244 245%% fsync vp E E E 246 247vop_fsync { 248 IN struct vnode *vp; 249 IN int waitfor; 250 IN struct thread *td; 251}; 252 253 254%% remove dvp E E E 255%% remove vp E E E 256%! remove post vop_remove_post 257 258vop_remove { 259 IN struct vnode *dvp; 260 IN struct vnode *vp; 261 IN struct componentname *cnp; 262}; 263 264 265%% link tdvp E E E 266%% link vp E E E 267%! link post vop_link_post 268 269vop_link { 270 IN struct vnode *tdvp; 271 IN struct vnode *vp; 272 IN struct componentname *cnp; 273}; 274 275 276%! rename pre vop_rename_pre 277%! rename post vop_rename_post 278 279vop_rename { 280 IN WILLRELE struct vnode *fdvp; 281 IN WILLRELE struct vnode *fvp; 282 IN struct componentname *fcnp; 283 IN WILLRELE struct vnode *tdvp; 284 IN WILLRELE struct vnode *tvp; 285 IN struct componentname *tcnp; 286}; 287 288 289%% mkdir dvp E E E 290%% mkdir vpp - E - 291%! mkdir post vop_mkdir_post 292 293vop_mkdir { 294 IN struct vnode *dvp; 295 OUT struct vnode **vpp; 296 IN struct componentname *cnp; 297 IN struct vattr *vap; 298}; 299 300 301%% rmdir dvp E E E 302%% rmdir vp E E E 303%! rmdir post vop_rmdir_post 304 305vop_rmdir { 306 IN struct vnode *dvp; 307 IN struct vnode *vp; 308 IN struct componentname *cnp; 309}; 310 311 312%% symlink dvp E E E 313%% symlink vpp - E - 314%! symlink post vop_symlink_post 315 316vop_symlink { 317 IN struct vnode *dvp; 318 OUT struct vnode **vpp; 319 IN struct componentname *cnp; 320 IN struct vattr *vap; 321 IN char *target; 322}; 323 324 325%% readdir vp L L L 326 327vop_readdir { 328 IN struct vnode *vp; 329 INOUT struct uio *uio; 330 IN struct ucred *cred; 331 INOUT int *eofflag; 332 OUT int *ncookies; 333 INOUT u_long **cookies; 334}; 335 336 337%% readlink vp L L L 338 339vop_readlink { 340 IN struct vnode *vp; 341 INOUT struct uio *uio; 342 IN struct ucred *cred; 343}; 344 345 346%% inactive vp E E E 347 348vop_inactive { 349 IN struct vnode *vp; 350 IN struct thread *td; 351}; 352 353 354%% reclaim vp E E E 355 356vop_reclaim { 357 IN struct vnode *vp; 358 IN struct thread *td; 359}; 360 361 362%! lock1 pre vop_lock_pre 363%! lock1 post vop_lock_post 364 365vop_lock1 { 366 IN struct vnode *vp; 367 IN int flags; 368 IN char *file; 369 IN int line; 370}; 371 372 373%! unlock pre vop_unlock_pre 374%! unlock post vop_unlock_post 375 376vop_unlock { 377 IN struct vnode *vp; 378 IN int flags; 379}; 380 381 382%% bmap vp L L L 383 384vop_bmap { 385 IN struct vnode *vp; 386 IN daddr_t bn; 387 OUT struct bufobj **bop; 388 IN daddr_t *bnp; 389 OUT int *runp; 390 OUT int *runb; 391}; 392 393 394%% strategy vp L L L 395%! strategy pre vop_strategy_pre 396 397vop_strategy { 398 IN struct vnode *vp; 399 IN struct buf *bp; 400}; 401 402 403%% getwritemount vp = = = 404 405vop_getwritemount { 406 IN struct vnode *vp; 407 OUT struct mount **mpp; 408}; 409 410 411%% print vp - - - 412 413vop_print { 414 IN struct vnode *vp; 415}; 416 417 418%% pathconf vp L L L 419 420vop_pathconf { 421 IN struct vnode *vp; 422 IN int name; 423 OUT register_t *retval; 424}; 425 426 427%% advlock vp U U U 428 429vop_advlock { 430 IN struct vnode *vp; 431 IN void *id; 432 IN int op; 433 IN struct flock *fl; 434 IN int flags; 435}; 436 437 438%% advlockasync vp U U U 439 440vop_advlockasync { 441 IN struct vnode *vp; 442 IN void *id; 443 IN int op; 444 IN struct flock *fl; 445 IN int flags; 446 IN struct task *task; 447 INOUT void **cookiep; 448}; 449 450 451%% reallocblks vp E E E 452 453vop_reallocblks { 454 IN struct vnode *vp; 455 IN struct cluster_save *buflist; 456}; 457 458 459%% getpages vp L L L 460 461vop_getpages { 462 IN struct vnode *vp; 463 IN vm_page_t *m; 464 IN int count; 465 IN int reqpage; 466 IN vm_ooffset_t offset; 467}; 468 469 470%% putpages vp E E E 471 472vop_putpages { 473 IN struct vnode *vp; 474 IN vm_page_t *m; 475 IN int count; 476 IN int sync; 477 IN int *rtvals; 478 IN vm_ooffset_t offset; 479}; 480 481 482%% getacl vp L L L 483 484vop_getacl { 485 IN struct vnode *vp; 486 IN acl_type_t type; 487 OUT struct acl *aclp; 488 IN struct ucred *cred; 489 IN struct thread *td; 490}; 491 492 493%% setacl vp E E E 494 495vop_setacl { 496 IN struct vnode *vp; 497 IN acl_type_t type; 498 IN struct acl *aclp; 499 IN struct ucred *cred; 500 IN struct thread *td; 501}; 502 503 504%% aclcheck vp = = = 505 506vop_aclcheck { 507 IN struct vnode *vp; 508 IN acl_type_t type; 509 IN struct acl *aclp; 510 IN struct ucred *cred; 511 IN struct thread *td; 512}; 513 514 515%% closeextattr vp L L L 516 517vop_closeextattr { 518 IN struct vnode *vp; 519 IN int commit; 520 IN struct ucred *cred; 521 IN struct thread *td; 522}; 523 524 525%% getextattr vp L L L 526 527vop_getextattr { 528 IN struct vnode *vp; 529 IN int attrnamespace; 530 IN const char *name; 531 INOUT struct uio *uio; 532 OUT size_t *size; 533 IN struct ucred *cred; 534 IN struct thread *td; 535}; 536 537 538%% listextattr vp L L L 539 540vop_listextattr { 541 IN struct vnode *vp; 542 IN int attrnamespace; 543 INOUT struct uio *uio; 544 OUT size_t *size; 545 IN struct ucred *cred; 546 IN struct thread *td; 547}; 548 549 550%% openextattr vp L L L 551 552vop_openextattr { 553 IN struct vnode *vp; 554 IN struct ucred *cred; 555 IN struct thread *td; 556}; 557 558 559%% deleteextattr vp E E E 560 561vop_deleteextattr { 562 IN struct vnode *vp; 563 IN int attrnamespace; 564 IN const char *name; 565 IN struct ucred *cred; 566 IN struct thread *td; 567}; 568 569 570%% setextattr vp E E E 571 572vop_setextattr { 573 IN struct vnode *vp; 574 IN int attrnamespace; 575 IN const char *name; 576 INOUT struct uio *uio; 577 IN struct ucred *cred; 578 IN struct thread *td; 579}; 580 581 582%% setlabel vp E E E 583 584vop_setlabel { 585 IN struct vnode *vp; 586 IN struct label *label; 587 IN struct ucred *cred; 588 IN struct thread *td; 589}; 590 591 592%% vptofh vp = = = 593 594vop_vptofh { 595 IN struct vnode *vp; 596 IN struct fid *fhp; 597}; 598