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.20 1999/03/27 03:08:07 eivind 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 L L 81#% create vpp - L - 82# 83vop_create { 84 IN 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# 93vop_whiteout { 94 IN struct vnode *dvp; 95 IN struct componentname *cnp; 96 IN int flags; 97}; 98 99# 100#% mknod dvp L L L 101#% mknod vpp - X - 102# 103vop_mknod { 104 IN struct vnode *dvp; 105 OUT WILLRELE struct vnode **vpp; 106 IN struct componentname *cnp; 107 IN struct vattr *vap; 108}; 109 110# 111#% open vp L L L 112# 113vop_open { 114 IN struct vnode *vp; 115 IN int mode; 116 IN struct ucred *cred; 117 IN struct proc *p; 118}; 119 120# 121#% close vp U U U 122# 123vop_close { 124 IN struct vnode *vp; 125 IN int fflag; 126 IN struct ucred *cred; 127 IN struct proc *p; 128}; 129 130# 131#% access vp L L L 132# 133vop_access { 134 IN struct vnode *vp; 135 IN int mode; 136 IN struct ucred *cred; 137 IN struct proc *p; 138}; 139 140# 141#% getattr vp = = = 142# 143vop_getattr { 144 IN struct vnode *vp; 145 IN struct vattr *vap; 146 IN struct ucred *cred; 147 IN struct proc *p; 148}; 149 150# 151#% setattr vp L L L 152# 153vop_setattr { 154 IN struct vnode *vp; 155 IN struct vattr *vap; 156 IN struct ucred *cred; 157 IN struct proc *p; 158}; 159 160# 161#% read vp L L L 162# 163vop_read { 164 IN struct vnode *vp; 165 INOUT struct uio *uio; 166 IN int ioflag; 167 IN struct ucred *cred; 168}; 169 170# 171#% write vp L L L 172# 173vop_write { 174 IN struct vnode *vp; 175 INOUT struct uio *uio; 176 IN int ioflag; 177 IN struct ucred *cred; 178}; 179 180# 181#% lease vp = = = 182# 183vop_lease { 184 IN struct vnode *vp; 185 IN struct proc *p; 186 IN struct ucred *cred; 187 IN int flag; 188}; 189 190# 191#% ioctl vp U U U 192# 193vop_ioctl { 194 IN struct vnode *vp; 195 IN u_long command; 196 IN caddr_t data; 197 IN int fflag; 198 IN struct ucred *cred; 199 IN struct proc *p; 200}; 201 202# 203#% poll vp U U U 204# 205vop_poll { 206 IN struct vnode *vp; 207 IN int events; 208 IN struct ucred *cred; 209 IN struct proc *p; 210}; 211 212# 213#% revoke vp U U U 214# 215vop_revoke { 216 IN struct vnode *vp; 217 IN int flags; 218}; 219 220# 221# XXX - not used 222# 223vop_mmap { 224 IN struct vnode *vp; 225 IN int fflags; 226 IN struct ucred *cred; 227 IN struct proc *p; 228}; 229 230# 231#% fsync vp L L L 232# 233vop_fsync { 234 IN struct vnode *vp; 235 IN struct ucred *cred; 236 IN int waitfor; 237 IN struct proc *p; 238}; 239 240# 241#% remove dvp L L L 242#% remove vp L L L 243# 244vop_remove { 245 IN struct vnode *dvp; 246 IN struct vnode *vp; 247 IN struct componentname *cnp; 248}; 249 250# 251#% link tdvp L L L 252#% link vp U U U 253# 254vop_link { 255 IN struct vnode *tdvp; 256 IN struct vnode *vp; 257 IN struct componentname *cnp; 258}; 259 260# 261#% rename fdvp U U U 262#% rename fvp U U U 263#% rename tdvp L U U 264#% rename tvp X U U 265# 266vop_rename { 267 IN WILLRELE struct vnode *fdvp; 268 IN WILLRELE struct vnode *fvp; 269 IN struct componentname *fcnp; 270 IN WILLRELE struct vnode *tdvp; 271 IN WILLRELE struct vnode *tvp; 272 IN struct componentname *tcnp; 273}; 274 275# 276#% mkdir dvp L L L 277#% mkdir vpp - L - 278# 279vop_mkdir { 280 IN struct vnode *dvp; 281 OUT struct vnode **vpp; 282 IN struct componentname *cnp; 283 IN struct vattr *vap; 284}; 285 286# 287#% rmdir dvp L L L 288#% rmdir vp L L L 289# 290vop_rmdir { 291 IN struct vnode *dvp; 292 IN struct vnode *vp; 293 IN struct componentname *cnp; 294}; 295 296# 297#% symlink dvp L L L 298#% symlink vpp - U - 299# 300# XXX - note that the return vnode has already been VRELE'ed 301# by the filesystem layer. To use it you must use vget, 302# possibly with a further namei. 303# 304vop_symlink { 305 IN struct vnode *dvp; 306 OUT WILLRELE struct vnode **vpp; 307 IN struct componentname *cnp; 308 IN struct vattr *vap; 309 IN char *target; 310}; 311 312# 313#% readdir vp L L L 314# 315vop_readdir { 316 IN struct vnode *vp; 317 INOUT struct uio *uio; 318 IN struct ucred *cred; 319 INOUT int *eofflag; 320 OUT int *ncookies; 321 INOUT u_long **cookies; 322}; 323 324# 325#% readlink vp L L L 326# 327vop_readlink { 328 IN struct vnode *vp; 329 INOUT struct uio *uio; 330 IN struct ucred *cred; 331}; 332 333# 334#% abortop dvp = = = 335# 336vop_abortop { 337 IN struct vnode *dvp; 338 IN struct componentname *cnp; 339}; 340 341# 342#% inactive vp L U U 343# 344vop_inactive { 345 IN struct vnode *vp; 346 IN struct proc *p; 347}; 348 349# 350#% reclaim vp U U U 351# 352vop_reclaim { 353 IN struct vnode *vp; 354 IN struct proc *p; 355}; 356 357# 358#% lock vp U L U 359# 360vop_lock { 361 IN struct vnode *vp; 362 IN int flags; 363 IN struct proc *p; 364}; 365 366# 367#% unlock vp L U L 368# 369vop_unlock { 370 IN struct vnode *vp; 371 IN int flags; 372 IN struct proc *p; 373}; 374 375# 376#% bmap vp L L L 377#% bmap vpp - U - 378# 379vop_bmap { 380 IN struct vnode *vp; 381 IN daddr_t bn; 382 OUT struct vnode **vpp; 383 IN daddr_t *bnp; 384 OUT int *runp; 385 OUT int *runb; 386}; 387 388# 389#% strategy vp L L L 390# 391vop_strategy { 392 IN struct vnode *vp; 393 IN struct buf *bp; 394}; 395 396# 397#% print vp = = = 398# 399vop_print { 400 IN struct vnode *vp; 401}; 402 403# 404#% islocked vp = = = 405# 406vop_islocked { 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