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.7 (Berkeley) 08/10/94 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 - - - 55vop_whiteout { 56 IN WILLRELE struct vnode *dvp; 57 IN struct componentname *cnp; 58 IN int flags; 59}; 60 61# 62#% mknod dvp L U U 63#% mknod vpp - X - 64# 65vop_mknod { 66 IN WILLRELE struct vnode *dvp; 67 OUT WILLRELE struct vnode **vpp; 68 IN struct componentname *cnp; 69 IN struct vattr *vap; 70}; 71 72# 73#% open vp L L L 74# 75vop_open { 76 IN struct vnode *vp; 77 IN int mode; 78 IN struct ucred *cred; 79 IN struct proc *p; 80}; 81 82# 83#% close vp U U U 84# 85vop_close { 86 IN struct vnode *vp; 87 IN int fflag; 88 IN struct ucred *cred; 89 IN struct proc *p; 90}; 91 92# 93#% access vp L L L 94# 95vop_access { 96 IN struct vnode *vp; 97 IN int mode; 98 IN struct ucred *cred; 99 IN struct proc *p; 100}; 101 102# 103#% getattr vp = = = 104# 105vop_getattr { 106 IN struct vnode *vp; 107 IN struct vattr *vap; 108 IN struct ucred *cred; 109 IN struct proc *p; 110}; 111 112# 113#% setattr vp L L L 114# 115vop_setattr { 116 IN struct vnode *vp; 117 IN struct vattr *vap; 118 IN struct ucred *cred; 119 IN struct proc *p; 120}; 121 122# 123#% read vp L L L 124# 125vop_read { 126 IN struct vnode *vp; 127 INOUT struct uio *uio; 128 IN int ioflag; 129 IN struct ucred *cred; 130}; 131 132# 133#% write vp L L L 134# 135vop_write { 136 IN struct vnode *vp; 137 INOUT struct uio *uio; 138 IN int ioflag; 139 IN struct ucred *cred; 140}; 141 142# 143#% lease vp = = = 144# 145vop_lease { 146 IN struct vnode *vp; 147 IN struct proc *p; 148 IN struct ucred *cred; 149 IN int flag; 150}; 151 152# 153#% ioctl vp U U U 154# 155vop_ioctl { 156 IN struct vnode *vp; 157 IN int command; 158 IN caddr_t data; 159 IN int fflag; 160 IN struct ucred *cred; 161 IN struct proc *p; 162}; 163 164# 165#% select vp U U U 166# 167# Needs work? (fflags) 168vop_select { 169 IN struct vnode *vp; 170 IN int which; 171 IN int fflags; 172 IN struct ucred *cred; 173 IN struct proc *p; 174}; 175 176# XXX - not used 177vop_mmap { 178 IN struct vnode *vp; 179 IN int fflags; 180 IN struct ucred *cred; 181 IN struct proc *p; 182}; 183 184# 185#% fsync vp L L L 186# 187vop_fsync { 188 IN struct vnode *vp; 189 IN struct ucred *cred; 190 IN int waitfor; 191 IN struct proc *p; 192}; 193 194# XXX - not used 195# Needs word: Is newoff right? What's it mean? 196vop_seek { 197 IN struct vnode *vp; 198 IN off_t oldoff; 199 IN off_t newoff; 200 IN struct ucred *cred; 201}; 202 203# 204#% remove dvp L U U 205#% remove vp L U U 206# 207vop_remove { 208 IN WILLRELE struct vnode *dvp; 209 IN WILLRELE struct vnode *vp; 210 IN struct componentname *cnp; 211}; 212 213# 214#% link vp L U U 215#% link tdvp U U U 216# 217vop_link { 218 IN WILLRELE struct vnode *vp; 219 IN struct vnode *tdvp; 220 IN struct componentname *cnp; 221}; 222 223# 224#% rename fdvp U U U 225#% rename fvp U U U 226#% rename tdvp L U U 227#% rename tvp X U U 228# 229vop_rename { 230 IN WILLRELE struct vnode *fdvp; 231 IN WILLRELE struct vnode *fvp; 232 IN struct componentname *fcnp; 233 IN WILLRELE struct vnode *tdvp; 234 IN WILLRELE struct vnode *tvp; 235 IN struct componentname *tcnp; 236}; 237 238# 239#% mkdir dvp L U U 240#% mkdir vpp - L - 241# 242vop_mkdir { 243 IN WILLRELE struct vnode *dvp; 244 OUT struct vnode **vpp; 245 IN struct componentname *cnp; 246 IN struct vattr *vap; 247}; 248 249# 250#% rmdir dvp L U U 251#% rmdir vp L U U 252# 253vop_rmdir { 254 IN WILLRELE struct vnode *dvp; 255 IN WILLRELE struct vnode *vp; 256 IN struct componentname *cnp; 257}; 258 259# 260#% symlink dvp L U U 261#% symlink vpp - U - 262# XXX - note that the return vnode has already been VRELE'ed 263# by the filesystem layer. To use it you must use vget, 264# possibly with a further namei. 265# 266vop_symlink { 267 IN WILLRELE struct vnode *dvp; 268 OUT WILLRELE struct vnode **vpp; 269 IN struct componentname *cnp; 270 IN struct vattr *vap; 271 IN char *target; 272}; 273 274# 275#% readdir vp L L L 276# 277vop_readdir { 278 IN struct vnode *vp; 279 INOUT struct uio *uio; 280 IN struct ucred *cred; 281 INOUT int *eofflag; 282 OUT u_long *cookies; 283 IN int ncookies; 284}; 285 286# 287#% readlink vp L L L 288# 289vop_readlink { 290 IN struct vnode *vp; 291 INOUT struct uio *uio; 292 IN struct ucred *cred; 293}; 294 295# 296#% abortop dvp = = = 297# 298vop_abortop { 299 IN struct vnode *dvp; 300 IN struct componentname *cnp; 301}; 302 303# 304#% inactive vp U U U 305# 306vop_inactive { 307 IN struct vnode *vp; 308}; 309 310# 311#% reclaim vp U U U 312# 313vop_reclaim { 314 IN struct vnode *vp; 315}; 316 317# 318#% lock vp U L U 319# 320vop_lock { 321 IN struct vnode *vp; 322}; 323 324# 325#% unlock vp L U L 326# 327vop_unlock { 328 IN struct vnode *vp; 329}; 330 331# 332#% bmap vp L L L 333#% bmap vpp - U - 334# 335vop_bmap { 336 IN struct vnode *vp; 337 IN daddr_t bn; 338 OUT struct vnode **vpp; 339 IN daddr_t *bnp; 340 OUT int *runp; 341}; 342 343#vop_strategy { 344# IN struct buf *bp; 345#}; 346 347# 348#% print vp = = = 349# 350vop_print { 351 IN struct vnode *vp; 352}; 353 354# 355#% islocked vp = = = 356# 357vop_islocked { 358 IN struct vnode *vp; 359}; 360 361# 362#% pathconf vp L L L 363# 364vop_pathconf { 365 IN struct vnode *vp; 366 IN int name; 367 OUT int *retval; 368}; 369 370# 371#% advlock vp U U U 372# 373vop_advlock { 374 IN struct vnode *vp; 375 IN caddr_t id; 376 IN int op; 377 IN struct flock *fl; 378 IN int flags; 379}; 380 381# 382#% blkatoff vp L L L 383# 384vop_blkatoff { 385 IN struct vnode *vp; 386 IN off_t offset; 387 OUT char **res; 388 OUT struct buf **bpp; 389}; 390 391# 392#% valloc pvp L L L 393# 394vop_valloc { 395 IN struct vnode *pvp; 396 IN int mode; 397 IN struct ucred *cred; 398 OUT struct vnode **vpp; 399}; 400 401# 402#% reallocblks vp L L L 403# 404vop_reallocblks { 405 IN struct vnode *vp; 406 IN struct cluster_save *buflist; 407}; 408 409# 410#% vfree pvp L L L 411# 412vop_vfree { 413 IN struct vnode *pvp; 414 IN ino_t ino; 415 IN int mode; 416}; 417 418# 419#% truncate vp L L L 420# 421vop_truncate { 422 IN struct vnode *vp; 423 IN off_t length; 424 IN int flags; 425 IN struct ucred *cred; 426 IN struct proc *p; 427}; 428 429# 430#% update vp L L L 431# 432vop_update { 433 IN struct vnode *vp; 434 IN struct timeval *access; 435 IN struct timeval *modify; 436 IN int waitfor; 437}; 438 439# Needs work: no vp? 440#vop_bwrite { 441# IN struct buf *bp; 442#}; 443