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.8 (Berkeley) 02/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# XXX - not used 180# 181vop_mmap { 182 IN struct vnode *vp; 183 IN int fflags; 184 IN struct ucred *cred; 185 IN struct proc *p; 186}; 187 188# 189#% fsync vp L L L 190# 191vop_fsync { 192 IN struct vnode *vp; 193 IN struct ucred *cred; 194 IN int waitfor; 195 IN struct proc *p; 196}; 197 198# 199# XXX - not used 200# Needs work: Is newoff right? What's it mean? 201# 202vop_seek { 203 IN struct vnode *vp; 204 IN off_t oldoff; 205 IN off_t newoff; 206 IN struct ucred *cred; 207}; 208 209# 210#% remove dvp L U U 211#% remove vp L U U 212# 213vop_remove { 214 IN WILLRELE struct vnode *dvp; 215 IN WILLRELE struct vnode *vp; 216 IN struct componentname *cnp; 217}; 218 219# 220#% link vp U U U 221#% link tdvp L U U 222# 223vop_link { 224 IN WILLRELE struct vnode *vp; 225 IN struct vnode *tdvp; 226 IN struct componentname *cnp; 227}; 228 229# 230#% rename fdvp U U U 231#% rename fvp U U U 232#% rename tdvp L U U 233#% rename tvp X U U 234# 235vop_rename { 236 IN WILLRELE struct vnode *fdvp; 237 IN WILLRELE struct vnode *fvp; 238 IN struct componentname *fcnp; 239 IN WILLRELE struct vnode *tdvp; 240 IN WILLRELE struct vnode *tvp; 241 IN struct componentname *tcnp; 242}; 243 244# 245#% mkdir dvp L U U 246#% mkdir vpp - L - 247# 248vop_mkdir { 249 IN WILLRELE struct vnode *dvp; 250 OUT struct vnode **vpp; 251 IN struct componentname *cnp; 252 IN struct vattr *vap; 253}; 254 255# 256#% rmdir dvp L U U 257#% rmdir vp L U U 258# 259vop_rmdir { 260 IN WILLRELE struct vnode *dvp; 261 IN WILLRELE struct vnode *vp; 262 IN struct componentname *cnp; 263}; 264 265# 266#% symlink dvp L U U 267#% symlink vpp - U - 268# 269# XXX - note that the return vnode has already been VRELE'ed 270# by the filesystem layer. To use it you must use vget, 271# possibly with a further namei. 272# 273vop_symlink { 274 IN WILLRELE struct vnode *dvp; 275 OUT WILLRELE struct vnode **vpp; 276 IN struct componentname *cnp; 277 IN struct vattr *vap; 278 IN char *target; 279}; 280 281# 282#% readdir vp L L L 283# 284vop_readdir { 285 IN struct vnode *vp; 286 INOUT struct uio *uio; 287 IN struct ucred *cred; 288 INOUT int *eofflag; 289 OUT u_long *cookies; 290 IN int ncookies; 291}; 292 293# 294#% readlink vp L L L 295# 296vop_readlink { 297 IN struct vnode *vp; 298 INOUT struct uio *uio; 299 IN struct ucred *cred; 300}; 301 302# 303#% abortop dvp = = = 304# 305vop_abortop { 306 IN struct vnode *dvp; 307 IN struct componentname *cnp; 308}; 309 310# 311#% inactive vp U U U 312# 313vop_inactive { 314 IN struct vnode *vp; 315}; 316 317# 318#% reclaim vp U U U 319# 320vop_reclaim { 321 IN struct vnode *vp; 322}; 323 324# 325#% lock vp U L U 326# 327vop_lock { 328 IN struct vnode *vp; 329}; 330 331# 332#% unlock vp L U L 333# 334vop_unlock { 335 IN struct vnode *vp; 336}; 337 338# 339#% bmap vp L L L 340#% bmap vpp - U - 341# 342vop_bmap { 343 IN struct vnode *vp; 344 IN daddr_t bn; 345 OUT struct vnode **vpp; 346 IN daddr_t *bnp; 347 OUT int *runp; 348}; 349 350# 351# Needs work: no vp? 352# 353#vop_strategy { 354# IN struct buf *bp; 355#}; 356 357# 358#% print vp = = = 359# 360vop_print { 361 IN struct vnode *vp; 362}; 363 364# 365#% islocked vp = = = 366# 367vop_islocked { 368 IN struct vnode *vp; 369}; 370 371# 372#% pathconf vp L L L 373# 374vop_pathconf { 375 IN struct vnode *vp; 376 IN int name; 377 OUT register_t *retval; 378}; 379 380# 381#% advlock vp U U U 382# 383vop_advlock { 384 IN struct vnode *vp; 385 IN caddr_t id; 386 IN int op; 387 IN struct flock *fl; 388 IN int flags; 389}; 390 391# 392#% blkatoff vp L L L 393# 394vop_blkatoff { 395 IN struct vnode *vp; 396 IN off_t offset; 397 OUT char **res; 398 OUT struct buf **bpp; 399}; 400 401# 402#% valloc pvp L L L 403# 404vop_valloc { 405 IN struct vnode *pvp; 406 IN int mode; 407 IN struct ucred *cred; 408 OUT struct vnode **vpp; 409}; 410 411# 412#% reallocblks vp L L L 413# 414vop_reallocblks { 415 IN struct vnode *vp; 416 IN struct cluster_save *buflist; 417}; 418 419# 420#% vfree pvp L L L 421# 422vop_vfree { 423 IN struct vnode *pvp; 424 IN ino_t ino; 425 IN int mode; 426}; 427 428# 429#% truncate vp L L L 430# 431vop_truncate { 432 IN struct vnode *vp; 433 IN off_t length; 434 IN int flags; 435 IN struct ucred *cred; 436 IN struct proc *p; 437}; 438 439# 440#% update vp L L L 441# 442vop_update { 443 IN struct vnode *vp; 444 IN struct timeval *access; 445 IN struct timeval *modify; 446 IN int waitfor; 447}; 448 449# 450# Needs work: no vp? 451# 452#vop_bwrite { 453# IN struct buf *bp; 454#}; 455