vnode_if.src revision 28732
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# $Id: vnode_if.src,v 1.11 1997/02/10 02:11:11 dyson Exp $ 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#% lookup dvp L ? ? 55#% lookup vpp - L - 56# 57# XXX - the lookup locking protocol defies simple description and depends 58# on the flags and operation fields in the (cnp) structure. Note 59# especially that *vpp may equal dvp and both may be locked. 60# 61vop_lookup { 62 IN struct vnode *dvp; 63 INOUT struct vnode **vpp; 64 IN struct componentname *cnp; 65}; 66 67# 68#% cachedlookup dvp L ? ? 69#% cachedlookup vpp - L - 70# 71# This must be an exact copy of lookup. See kern/vfs_cache.c for details. 72# 73vop_cachedlookup { 74 IN struct vnode *dvp; 75 INOUT struct vnode **vpp; 76 IN struct componentname *cnp; 77}; 78 79# 80#% create dvp L U U 81#% create vpp - L - 82# 83vop_create { 84 IN WILLRELE struct vnode *dvp; 85 OUT struct vnode **vpp; 86 IN struct componentname *cnp; 87 IN struct vattr *vap; 88}; 89 90# 91#% whiteout dvp L L L 92#% whiteout cnp - - - 93#% whiteout flag - - - 94# 95vop_whiteout { 96 IN WILLRELE struct vnode *dvp; 97 IN struct componentname *cnp; 98 IN int flags; 99}; 100 101# 102#% mknod dvp L U U 103#% mknod vpp - X - 104# 105vop_mknod { 106 IN WILLRELE struct vnode *dvp; 107 OUT WILLRELE struct vnode **vpp; 108 IN struct componentname *cnp; 109 IN struct vattr *vap; 110}; 111 112# 113#% open vp L L L 114# 115vop_open { 116 IN struct vnode *vp; 117 IN int mode; 118 IN struct ucred *cred; 119 IN struct proc *p; 120}; 121 122# 123#% close vp U U U 124# 125vop_close { 126 IN struct vnode *vp; 127 IN int fflag; 128 IN struct ucred *cred; 129 IN struct proc *p; 130}; 131 132# 133#% access vp L L L 134# 135vop_access { 136 IN struct vnode *vp; 137 IN int mode; 138 IN struct ucred *cred; 139 IN struct proc *p; 140}; 141 142# 143#% getattr vp = = = 144# 145vop_getattr { 146 IN struct vnode *vp; 147 IN struct vattr *vap; 148 IN struct ucred *cred; 149 IN struct proc *p; 150}; 151 152# 153#% setattr vp L L L 154# 155vop_setattr { 156 IN struct vnode *vp; 157 IN struct vattr *vap; 158 IN struct ucred *cred; 159 IN struct proc *p; 160}; 161 162# 163#% read vp L L L 164# 165vop_read { 166 IN struct vnode *vp; 167 INOUT struct uio *uio; 168 IN int ioflag; 169 IN struct ucred *cred; 170}; 171 172# 173#% write vp L L L 174# 175vop_write { 176 IN struct vnode *vp; 177 INOUT struct uio *uio; 178 IN int ioflag; 179 IN struct ucred *cred; 180}; 181 182# 183#% lease vp = = = 184# 185vop_lease { 186 IN struct vnode *vp; 187 IN struct proc *p; 188 IN struct ucred *cred; 189 IN int flag; 190}; 191 192# 193#% ioctl vp U U U 194# 195vop_ioctl { 196 IN struct vnode *vp; 197 IN u_long command; 198 IN caddr_t data; 199 IN int fflag; 200 IN struct ucred *cred; 201 IN struct proc *p; 202}; 203 204# 205#% select vp U U U 206# 207# Needs work? (fflags) 208# 209vop_select { 210 IN struct vnode *vp; 211 IN int which; 212 IN int fflags; 213 IN struct ucred *cred; 214 IN struct proc *p; 215}; 216 217# 218#% revoke vp U U U 219# 220vop_revoke { 221 IN struct vnode *vp; 222 IN int flags; 223}; 224 225# 226# XXX - not used 227# 228vop_mmap { 229 IN struct vnode *vp; 230 IN int fflags; 231 IN struct ucred *cred; 232 IN struct proc *p; 233}; 234 235# 236#% fsync vp L L L 237# 238vop_fsync { 239 IN struct vnode *vp; 240 IN struct ucred *cred; 241 IN int waitfor; 242 IN struct proc *p; 243}; 244 245# 246# XXX - not used 247# Needs work: Is newoff right? What's it mean? 248# 249vop_seek { 250 IN struct vnode *vp; 251 IN off_t oldoff; 252 IN off_t newoff; 253 IN struct ucred *cred; 254}; 255 256# 257#% remove dvp L U U 258#% remove vp L U U 259# 260vop_remove { 261 IN WILLRELE struct vnode *dvp; 262 IN WILLRELE struct vnode *vp; 263 IN struct componentname *cnp; 264}; 265 266# 267#% link vp U U U 268#% link tdvp L U U 269# 270vop_link { 271 IN WILLRELE struct vnode *tdvp; 272 IN struct vnode *vp; 273 IN struct componentname *cnp; 274}; 275 276# 277#% rename fdvp U U U 278#% rename fvp U U U 279#% rename tdvp L U U 280#% rename tvp X U U 281# 282vop_rename { 283 IN WILLRELE struct vnode *fdvp; 284 IN WILLRELE struct vnode *fvp; 285 IN struct componentname *fcnp; 286 IN WILLRELE struct vnode *tdvp; 287 IN WILLRELE struct vnode *tvp; 288 IN struct componentname *tcnp; 289}; 290 291# 292#% mkdir dvp L U U 293#% mkdir vpp - L - 294# 295vop_mkdir { 296 IN WILLRELE struct vnode *dvp; 297 OUT struct vnode **vpp; 298 IN struct componentname *cnp; 299 IN struct vattr *vap; 300}; 301 302# 303#% rmdir dvp L U U 304#% rmdir vp L U U 305# 306vop_rmdir { 307 IN WILLRELE struct vnode *dvp; 308 IN WILLRELE struct vnode *vp; 309 IN struct componentname *cnp; 310}; 311 312# 313#% symlink dvp L U U 314#% symlink vpp - U - 315# 316# XXX - note that the return vnode has already been VRELE'ed 317# by the filesystem layer. To use it you must use vget, 318# possibly with a further namei. 319# 320vop_symlink { 321 IN WILLRELE struct vnode *dvp; 322 OUT WILLRELE struct vnode **vpp; 323 IN struct componentname *cnp; 324 IN struct vattr *vap; 325 IN char *target; 326}; 327 328# 329#% readdir vp L L L 330# 331vop_readdir { 332 IN struct vnode *vp; 333 INOUT struct uio *uio; 334 IN struct ucred *cred; 335 INOUT int *eofflag; 336 OUT int *ncookies; 337 INOUT u_long **cookies; 338}; 339 340# 341#% readlink vp L L L 342# 343vop_readlink { 344 IN struct vnode *vp; 345 INOUT struct uio *uio; 346 IN struct ucred *cred; 347}; 348 349# 350#% abortop dvp = = = 351# 352vop_abortop { 353 IN struct vnode *dvp; 354 IN struct componentname *cnp; 355}; 356 357# 358#% inactive vp L U U 359# 360vop_inactive { 361 IN struct vnode *vp; 362 IN struct proc *p; 363}; 364 365# 366#% reclaim vp U U U 367# 368vop_reclaim { 369 IN struct vnode *vp; 370 IN struct proc *p; 371}; 372 373# 374#% lock vp U L U 375# 376vop_lock { 377 IN struct vnode *vp; 378 IN int flags; 379 IN struct proc *p; 380}; 381 382# 383#% unlock vp L U L 384# 385vop_unlock { 386 IN struct vnode *vp; 387 IN int flags; 388 IN struct proc *p; 389}; 390 391# 392#% bmap vp L L L 393#% bmap vpp - U - 394# 395vop_bmap { 396 IN struct vnode *vp; 397 IN daddr_t bn; 398 OUT struct vnode **vpp; 399 IN daddr_t *bnp; 400 OUT int *runp; 401 OUT int *runb; 402}; 403 404# 405# Needs work: no vp? 406# 407#vop_strategy { 408# IN struct buf *bp; 409#}; 410 411# 412#% print vp = = = 413# 414vop_print { 415 IN struct vnode *vp; 416}; 417 418# 419#% islocked vp = = = 420# 421vop_islocked { 422 IN struct vnode *vp; 423}; 424 425# 426#% pathconf vp L L L 427# 428vop_pathconf { 429 IN struct vnode *vp; 430 IN int name; 431 OUT register_t *retval; 432}; 433 434# 435#% advlock vp U U U 436# 437vop_advlock { 438 IN struct vnode *vp; 439 IN caddr_t id; 440 IN int op; 441 IN struct flock *fl; 442 IN int flags; 443}; 444 445# 446#% blkatoff vp L L L 447# 448vop_blkatoff { 449 IN struct vnode *vp; 450 IN off_t offset; 451 OUT char **res; 452 OUT struct buf **bpp; 453}; 454 455# 456#% valloc pvp L L L 457# 458vop_valloc { 459 IN struct vnode *pvp; 460 IN int mode; 461 IN struct ucred *cred; 462 OUT struct vnode **vpp; 463}; 464 465# 466#% reallocblks vp L L L 467# 468vop_reallocblks { 469 IN struct vnode *vp; 470 IN struct cluster_save *buflist; 471}; 472 473# 474#% vfree pvp L L L 475# 476vop_vfree { 477 IN struct vnode *pvp; 478 IN ino_t ino; 479 IN int mode; 480}; 481 482# 483#% truncate vp L L L 484# 485vop_truncate { 486 IN struct vnode *vp; 487 IN off_t length; 488 IN int flags; 489 IN struct ucred *cred; 490 IN struct proc *p; 491}; 492 493# 494#% update vp L L L 495# 496vop_update { 497 IN struct vnode *vp; 498 IN struct timeval *access; 499 IN struct timeval *modify; 500 IN int waitfor; 501}; 502 503vop_getpages { 504 IN struct vnode *vp; 505 IN vm_page_t *m; 506 IN int count; 507 IN int reqpage; 508 IN vm_ooffset_t offset; 509}; 510 511vop_putpages { 512 IN struct vnode *vp; 513 IN vm_page_t *m; 514 IN int count; 515 IN int sync; 516 IN int *rtvals; 517 IN vm_ooffset_t offset; 518}; 519 520# 521# Needs work: no vp? 522# 523#vop_bwrite { 524# IN struct buf *bp; 525#}; 526