1# 2# Copyright (c) 1992, 1993 3# The Regents of the University of California. All rights reserved. 4# 5# %sccs.include.redist.sh% 6# 7# @(#)vnode_if.src 8.12 (Berkeley) 05/14/95 8# 9 10# 11# Above each of the vop descriptors is a specification of the locking 12# protocol used by each vop call. The first column is the name of 13# the variable, the remaining three columns are in, out and error 14# respectively. The "in" column defines the lock state on input, 15# the "out" column defines the state on succesful return, and the 16# "error" column defines the locking state on error exit. 17# 18# The locking value can take the following values: 19# L: locked. 20# U: unlocked/ 21# -: not applicable. vnode does not yet (or no longer) exists. 22# =: the same on input and output, may be either L or U. 23# X: locked if not nil. 24# 25 26# 27#% lookup dvp L ? ? 28#% lookup vpp - L - 29# 30# XXX - the lookup locking protocol defies simple description and depends 31# on the flags and operation fields in the (cnp) structure. Note 32# especially that *vpp may equal dvp and both may be locked. 33# 34vop_lookup { 35 IN struct vnode *dvp; 36 INOUT struct vnode **vpp; 37 IN struct componentname *cnp; 38}; 39 40# 41#% create dvp L U U 42#% create vpp - L - 43# 44vop_create { 45 IN WILLRELE struct vnode *dvp; 46 OUT struct vnode **vpp; 47 IN struct componentname *cnp; 48 IN struct vattr *vap; 49}; 50 51# 52#% whiteout dvp L L L 53#% whiteout cnp - - - 54#% whiteout flag - - - 55# 56vop_whiteout { 57 IN WILLRELE struct vnode *dvp; 58 IN struct componentname *cnp; 59 IN int flags; 60}; 61 62# 63#% mknod dvp L U U 64#% mknod vpp - X - 65# 66vop_mknod { 67 IN WILLRELE struct vnode *dvp; 68 OUT WILLRELE struct vnode **vpp; 69 IN struct componentname *cnp; 70 IN struct vattr *vap; 71}; 72 73# 74#% open vp L L L 75# 76vop_open { 77 IN struct vnode *vp; 78 IN int mode; 79 IN struct ucred *cred; 80 IN struct proc *p; 81}; 82 83# 84#% close vp U U U 85# 86vop_close { 87 IN struct vnode *vp; 88 IN int fflag; 89 IN struct ucred *cred; 90 IN struct proc *p; 91}; 92 93# 94#% access vp L L L 95# 96vop_access { 97 IN struct vnode *vp; 98 IN int mode; 99 IN struct ucred *cred; 100 IN struct proc *p; 101}; 102 103# 104#% getattr vp = = = 105# 106vop_getattr { 107 IN struct vnode *vp; 108 IN struct vattr *vap; 109 IN struct ucred *cred; 110 IN struct proc *p; 111}; 112 113# 114#% setattr vp L L L 115# 116vop_setattr { 117 IN struct vnode *vp; 118 IN struct vattr *vap; 119 IN struct ucred *cred; 120 IN struct proc *p; 121}; 122 123# 124#% read vp L L L 125# 126vop_read { 127 IN struct vnode *vp; 128 INOUT struct uio *uio; 129 IN int ioflag; 130 IN struct ucred *cred; 131}; 132 133# 134#% write vp L L L 135# 136vop_write { 137 IN struct vnode *vp; 138 INOUT struct uio *uio; 139 IN int ioflag; 140 IN struct ucred *cred; 141}; 142 143# 144#% lease vp = = = 145# 146vop_lease { 147 IN struct vnode *vp; 148 IN struct proc *p; 149 IN struct ucred *cred; 150 IN int flag; 151}; 152 153# 154#% ioctl vp U U U 155# 156vop_ioctl { 157 IN struct vnode *vp; 158 IN u_long command; 159 IN caddr_t data; 160 IN int fflag; 161 IN struct ucred *cred; 162 IN struct proc *p; 163}; 164 165# 166#% select vp U U U 167# 168# Needs work? (fflags) 169# 170vop_select { 171 IN struct vnode *vp; 172 IN int which; 173 IN int fflags; 174 IN struct ucred *cred; 175 IN struct proc *p; 176}; 177 178# 179#% revoke vp U U U 180# 181vop_revoke { 182 IN struct vnode *vp; 183 IN int flags; 184}; 185 186# 187# XXX - not used 188# 189vop_mmap { 190 IN struct vnode *vp; 191 IN int fflags; 192 IN struct ucred *cred; 193 IN struct proc *p; 194}; 195 196# 197#% fsync vp L L L 198# 199vop_fsync { 200 IN struct vnode *vp; 201 IN struct ucred *cred; 202 IN int waitfor; 203 IN struct proc *p; 204}; 205 206# 207# XXX - not used 208# Needs work: Is newoff right? What's it mean? 209# 210vop_seek { 211 IN struct vnode *vp; 212 IN off_t oldoff; 213 IN off_t newoff; 214 IN struct ucred *cred; 215}; 216 217# 218#% remove dvp L U U 219#% remove vp L U U 220# 221vop_remove { 222 IN WILLRELE struct vnode *dvp; 223 IN WILLRELE struct vnode *vp; 224 IN struct componentname *cnp; 225}; 226 227# 228#% link vp U U U 229#% link tdvp L U U 230# 231vop_link { 232 IN WILLRELE struct vnode *vp; 233 IN struct vnode *tdvp; 234 IN struct componentname *cnp; 235}; 236 237# 238#% rename fdvp U U U 239#% rename fvp U U U 240#% rename tdvp L U U 241#% rename tvp X U U 242# 243vop_rename { 244 IN WILLRELE struct vnode *fdvp; 245 IN WILLRELE struct vnode *fvp; 246 IN struct componentname *fcnp; 247 IN WILLRELE struct vnode *tdvp; 248 IN WILLRELE struct vnode *tvp; 249 IN struct componentname *tcnp; 250}; 251 252# 253#% mkdir dvp L U U 254#% mkdir vpp - L - 255# 256vop_mkdir { 257 IN WILLRELE struct vnode *dvp; 258 OUT struct vnode **vpp; 259 IN struct componentname *cnp; 260 IN struct vattr *vap; 261}; 262 263# 264#% rmdir dvp L U U 265#% rmdir vp L U U 266# 267vop_rmdir { 268 IN WILLRELE struct vnode *dvp; 269 IN WILLRELE struct vnode *vp; 270 IN struct componentname *cnp; 271}; 272 273# 274#% symlink dvp L U U 275#% symlink vpp - U - 276# 277# XXX - note that the return vnode has already been VRELE'ed 278# by the filesystem layer. To use it you must use vget, 279# possibly with a further namei. 280# 281vop_symlink { 282 IN WILLRELE struct vnode *dvp; 283 OUT WILLRELE struct vnode **vpp; 284 IN struct componentname *cnp; 285 IN struct vattr *vap; 286 IN char *target; 287}; 288 289# 290#% readdir vp L L L 291# 292vop_readdir { 293 IN struct vnode *vp; 294 INOUT struct uio *uio; 295 IN struct ucred *cred; 296 INOUT int *eofflag; 297 OUT int *ncookies; 298 INOUT u_long **cookies; 299}; 300 301# 302#% readlink vp L L L 303# 304vop_readlink { 305 IN struct vnode *vp; 306 INOUT struct uio *uio; 307 IN struct ucred *cred; 308}; 309 310# 311#% abortop dvp = = = 312# 313vop_abortop { 314 IN struct vnode *dvp; 315 IN struct componentname *cnp; 316}; 317 318# 319#% inactive vp L U U 320# 321vop_inactive { 322 IN struct vnode *vp; 323 IN struct proc *p; 324}; 325 326# 327#% reclaim vp U U U 328# 329vop_reclaim { 330 IN struct vnode *vp; 331 IN struct proc *p; 332}; 333 334# 335#% lock vp U L U 336# 337vop_lock { 338 IN struct vnode *vp; 339 IN int flags; 340 IN struct proc *p; 341}; 342 343# 344#% unlock vp L U L 345# 346vop_unlock { 347 IN struct vnode *vp; 348 IN int flags; 349 IN struct proc *p; 350}; 351 352# 353#% bmap vp L L L 354#% bmap vpp - U - 355# 356vop_bmap { 357 IN struct vnode *vp; 358 IN daddr_t bn; 359 OUT struct vnode **vpp; 360 IN daddr_t *bnp; 361 OUT int *runp; 362}; 363 364# 365# Needs work: no vp? 366# 367#vop_strategy { 368# IN struct buf *bp; 369#}; 370 371# 372#% print vp = = = 373# 374vop_print { 375 IN struct vnode *vp; 376}; 377 378# 379#% islocked vp = = = 380# 381vop_islocked { 382 IN struct vnode *vp; 383}; 384 385# 386#% pathconf vp L L L 387# 388vop_pathconf { 389 IN struct vnode *vp; 390 IN int name; 391 OUT register_t *retval; 392}; 393 394# 395#% advlock vp U U U 396# 397vop_advlock { 398 IN struct vnode *vp; 399 IN caddr_t id; 400 IN int op; 401 IN struct flock *fl; 402 IN int flags; 403}; 404 405# 406#% blkatoff vp L L L 407# 408vop_blkatoff { 409 IN struct vnode *vp; 410 IN off_t offset; 411 OUT char **res; 412 OUT struct buf **bpp; 413}; 414 415# 416#% valloc pvp L L L 417# 418vop_valloc { 419 IN struct vnode *pvp; 420 IN int mode; 421 IN struct ucred *cred; 422 OUT struct vnode **vpp; 423}; 424 425# 426#% reallocblks vp L L L 427# 428vop_reallocblks { 429 IN struct vnode *vp; 430 IN struct cluster_save *buflist; 431}; 432 433# 434#% vfree pvp L L L 435# 436vop_vfree { 437 IN struct vnode *pvp; 438 IN ino_t ino; 439 IN int mode; 440}; 441 442# 443#% truncate vp L L L 444# 445vop_truncate { 446 IN struct vnode *vp; 447 IN off_t length; 448 IN int flags; 449 IN struct ucred *cred; 450 IN struct proc *p; 451}; 452 453# 454#% update vp L L L 455# 456vop_update { 457 IN struct vnode *vp; 458 IN struct timeval *access; 459 IN struct timeval *modify; 460 IN int waitfor; 461}; 462 463# 464# Needs work: no vp? 465# 466#vop_bwrite { 467# IN struct buf *bp; 468#}; 469