Annotation of src/sys/kern/vnode_if.src, Revision 1.44.4.4
1.44.4.4! yamt 1: # $NetBSD: vnode_if.src,v 1.44.4.3 2007/09/03 14:41:26 yamt Exp $
1.1 mycroft 2: #
3: # Copyright (c) 1992, 1993
4: # The Regents of the University of California. All rights reserved.
5: #
6: # Redistribution and use in source and binary forms, with or without
7: # modification, are permitted provided that the following conditions
8: # are met:
9: # 1. Redistributions of source code must retain the above copyright
10: # notice, this list of conditions and the following disclaimer.
11: # 2. Redistributions in binary form must reproduce the above copyright
12: # notice, this list of conditions and the following disclaimer in the
13: # documentation and/or other materials provided with the distribution.
14: # 3. All advertising materials mentioning features or use of this software
15: # must display the following acknowledgement:
16: # This product includes software developed by the University of
17: # California, Berkeley and its contributors.
18: # 4. Neither the name of the University nor the names of its contributors
19: # may be used to endorse or promote products derived from this software
20: # without specific prior written permission.
21: #
22: # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: # SUCH DAMAGE.
33: #
1.13 fvdl 34: # @(#)vnode_if.src 8.14 (Berkeley) 8/6/95
35: #
36: #
37:
1.44 perry 38: #
1.13 fvdl 39: # Above each of the vop descriptors is a specification of the locking
40: # protocol used by each vop call. The first column is the name of
41: # the variable, the remaining three columns are in, out and error
42: # respectively. The "in" column defines the lock state on input,
1.36 wiz 43: # the "out" column defines the state on successful return, and the
1.13 fvdl 44: # "error" column defines the locking state on error exit.
1.44 perry 45: #
1.13 fvdl 46: # The locking value can take the following values:
47: # L: locked.
1.30 chs 48: # U: unlocked.
1.13 fvdl 49: # -: not applicable. vnode does not yet (or no longer) exists.
50: # =: the same on input and output, may be either L or U.
51: # X: locked if not nil.
1.22 wrstuden 52: #
53: # For operations other than VOP_LOOKUP which require a component name
54: # parameter, the flags required for the initial namei() call are listed.
55: # Additional flags may be added to the namei() call, but these are required.
1.44 perry 56: #
57:
1.13 fvdl 58: #
1.44.4.2 yamt 59: #% lookup dvp L L L
1.13 fvdl 60: #% lookup vpp - L -
61: #
1.44.4.2 yamt 62: # XXX - the lookup locking protocol defies simple description.
63: # Note especially that *vpp may equal dvp.
1.16 sommerfe 64: #
65: # More details:
1.20 wrstuden 66: # There are three types of lookups: ".", ".." (ISDOTDOT), and other.
67: # On successful lookup of ".", a reference is added to dvp, and it
68: # is returned in *vpp.
69: # To look up ISDOTDOT, dvp is unlocked, the ".." node is locked, and
1.44.4.2 yamt 70: # then dvp is relocked. This preserves the protocol of always
71: # locking nodes from root ("/") downward and prevents deadlock.
1.20 wrstuden 72: # Other lookups find the named node (creating the vnode if needed) and
73: # return it, locked, in *vpp.
1.44.4.2 yamt 74: # On failure, *vpp is NULL, and *dvp is left locked.
1.44 perry 75: #
1.16 sommerfe 76: # *vpp is always locked on return if the operation succeeds.
1.44.4.2 yamt 77: # Typically, if *vpp == dvp, you need to release twice, but
78: # unlock only once.
1.1 mycroft 79: #
1.22 wrstuden 80: # See sys/sys/namei.h for a description of the SAVENAME and SAVESTART
81: # flags.
82: #
1.1 mycroft 83: vop_lookup {
84: IN struct vnode *dvp;
1.44.4.3 yamt 85: INOUT WILLMAKE struct vnode **vpp;
1.1 mycroft 86: IN struct componentname *cnp;
87: };
88:
1.13 fvdl 89: #
90: #% create dvp L U U
91: #% create vpp - L -
92: #
1.22 wrstuden 93: #! create cnp CREATE, LOCKPARENT
94: #
1.1 mycroft 95: vop_create {
1.41 thorpej 96: IN LOCKED=YES WILLPUT struct vnode *dvp;
1.44.4.3 yamt 97: OUT WILLMAKE struct vnode **vpp;
1.1 mycroft 98: IN struct componentname *cnp;
99: IN struct vattr *vap;
100: };
101:
1.13 fvdl 102: #
103: #% mknod dvp L U U
1.29 assar 104: #% mknod vpp - L -
1.13 fvdl 105: #
1.22 wrstuden 106: #! mknod cnp CREATE, LOCKPARENT
107: #
1.1 mycroft 108: vop_mknod {
1.41 thorpej 109: IN LOCKED=YES WILLPUT struct vnode *dvp;
1.44.4.3 yamt 110: OUT WILLMAKE struct vnode **vpp;
1.1 mycroft 111: IN struct componentname *cnp;
112: IN struct vattr *vap;
113: };
114:
1.13 fvdl 115: #
116: #% open vp L L L
117: #
1.1 mycroft 118: vop_open {
1.41 thorpej 119: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 120: IN int mode;
1.44.4.1 yamt 121: IN kauth_cred_t cred;
1.1 mycroft 122: };
123:
1.13 fvdl 124: #
1.15 wrstuden 125: #% close vp L L L
1.13 fvdl 126: #
1.1 mycroft 127: vop_close {
1.41 thorpej 128: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 129: IN int fflag;
1.44.4.1 yamt 130: IN kauth_cred_t cred;
1.1 mycroft 131: };
132:
1.13 fvdl 133: #
134: #% access vp L L L
135: #
1.1 mycroft 136: vop_access {
1.41 thorpej 137: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 138: IN int mode;
1.44.4.1 yamt 139: IN kauth_cred_t cred;
1.1 mycroft 140: };
141:
1.13 fvdl 142: #
143: #% getattr vp = = =
144: #
1.1 mycroft 145: vop_getattr {
146: IN struct vnode *vp;
147: IN struct vattr *vap;
1.44.4.1 yamt 148: IN kauth_cred_t cred;
1.1 mycroft 149: };
150:
1.13 fvdl 151: #
152: #% setattr vp L L L
153: #
1.1 mycroft 154: vop_setattr {
1.41 thorpej 155: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 156: IN struct vattr *vap;
1.44.4.1 yamt 157: IN kauth_cred_t cred;
1.1 mycroft 158: };
159:
1.13 fvdl 160: #
161: #% read vp L L L
162: #
1.1 mycroft 163: vop_read {
1.41 thorpej 164: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 165: INOUT struct uio *uio;
166: IN int ioflag;
1.44.4.1 yamt 167: IN kauth_cred_t cred;
1.1 mycroft 168: };
169:
1.13 fvdl 170: #
171: #% write vp L L L
172: #
1.1 mycroft 173: vop_write {
1.41 thorpej 174: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 175: INOUT struct uio *uio;
176: IN int ioflag;
1.44.4.1 yamt 177: IN kauth_cred_t cred;
1.1 mycroft 178: };
179:
1.13 fvdl 180: #
181: #% ioctl vp U U U
182: #
1.1 mycroft 183: vop_ioctl {
1.41 thorpej 184: IN LOCKED=NO struct vnode *vp;
1.4 cgd 185: IN u_long command;
1.32 jdolecek 186: IN void *data;
1.19 wrstuden 187: IN int fflag;
1.44.4.1 yamt 188: IN kauth_cred_t cred;
1.19 wrstuden 189: };
190:
191: #
1.44.4.1 yamt 192: #% fcntl vp U U U
1.19 wrstuden 193: #
194: vop_fcntl {
1.44.4.1 yamt 195: IN LOCKED=NO struct vnode *vp;
1.19 wrstuden 196: IN u_int command;
1.32 jdolecek 197: IN void *data;
1.1 mycroft 198: IN int fflag;
1.44.4.1 yamt 199: IN kauth_cred_t cred;
1.1 mycroft 200: };
201:
1.13 fvdl 202: #
203: #% poll vp U U U
204: #
1.11 mycroft 205: vop_poll {
1.41 thorpej 206: IN LOCKED=NO struct vnode *vp;
1.11 mycroft 207: IN int events;
1.31 jdolecek 208: };
209:
210: #
211: #% kqfilter vp U U U
212: #
213: vop_kqfilter {
1.41 thorpej 214: IN LOCKED=NO struct vnode *vp;
1.31 jdolecek 215: IN struct knote *kn;
1.1 mycroft 216: };
217:
1.13 fvdl 218: #
219: #% revoke vp U U U
220: #
221: vop_revoke {
1.41 thorpej 222: IN LOCKED=NO struct vnode *vp;
1.13 fvdl 223: IN int flags;
224: };
225:
1.44 perry 226: #
1.30 chs 227: #% mmap vp = = =
1.13 fvdl 228: #
1.1 mycroft 229: vop_mmap {
230: IN struct vnode *vp;
1.44.4.3 yamt 231: IN vm_prot_t prot;
1.44.4.1 yamt 232: IN kauth_cred_t cred;
1.1 mycroft 233: };
234:
1.13 fvdl 235: #
236: #% fsync vp L L L
237: #
1.1 mycroft 238: vop_fsync {
1.41 thorpej 239: IN LOCKED=YES struct vnode *vp;
1.44.4.1 yamt 240: IN kauth_cred_t cred;
1.14 kleink 241: IN int flags;
1.37 wiz 242: IN off_t offlo;
243: IN off_t offhi;
1.1 mycroft 244: };
245:
1.13 fvdl 246: #
247: # Needs work: Is newoff right? What's it mean?
1.44.4.1 yamt 248: # XXX Locking protocol?
1.13 fvdl 249: #
1.1 mycroft 250: vop_seek {
251: IN struct vnode *vp;
252: IN off_t oldoff;
253: IN off_t newoff;
1.44.4.1 yamt 254: IN kauth_cred_t cred;
1.1 mycroft 255: };
256:
1.13 fvdl 257: #
258: #% remove dvp L U U
259: #% remove vp L U U
260: #
1.22 wrstuden 261: #! remove cnp DELETE, LOCKPARENT | LOCKLEAF
262: #
1.1 mycroft 263: vop_remove {
1.41 thorpej 264: IN LOCKED=YES WILLPUT struct vnode *dvp;
265: IN LOCKED=YES WILLPUT struct vnode *vp;
1.1 mycroft 266: IN struct componentname *cnp;
267: };
268:
1.13 fvdl 269: #
1.41 thorpej 270: #% link dvp L U U
1.44.4.3 yamt 271: #% link vp U U U
1.13 fvdl 272: #
1.22 wrstuden 273: #! link cnp CREATE, LOCKPARENT
274: #
1.1 mycroft 275: vop_link {
1.41 thorpej 276: IN LOCKED=YES WILLPUT struct vnode *dvp;
277: IN LOCKED=NO struct vnode *vp;
1.1 mycroft 278: IN struct componentname *cnp;
279: };
280:
1.13 fvdl 281: #
282: #% rename fdvp U U U
283: #% rename fvp U U U
284: #% rename tdvp L U U
285: #% rename tvp X U U
286: #
1.44.4.2 yamt 287: #! rename fcnp DELETE, LOCKPARENT | SAVESTART
1.22 wrstuden 288: #! rename tcnp RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART
289: #
290: # XXX the vop_rename routines should REALLY NOT be depending on SAVESTART!
291: #
1.1 mycroft 292: vop_rename {
1.41 thorpej 293: IN LOCKED=NO WILLRELE struct vnode *fdvp;
294: IN LOCKED=NO WILLRELE struct vnode *fvp;
1.1 mycroft 295: IN struct componentname *fcnp;
1.41 thorpej 296: IN LOCKED=YES WILLPUT struct vnode *tdvp;
1.33 jdolecek 297: IN WILLPUT struct vnode *tvp;
1.1 mycroft 298: IN struct componentname *tcnp;
299: };
300:
1.13 fvdl 301: #
302: #% mkdir dvp L U U
1.44 perry 303: #% mkdir vpp - L -
1.13 fvdl 304: #
1.22 wrstuden 305: #! mkdir cnp CREATE, LOCKPARENT
306: #
1.1 mycroft 307: vop_mkdir {
1.41 thorpej 308: IN LOCKED=YES WILLPUT struct vnode *dvp;
1.44.4.3 yamt 309: OUT WILLMAKE struct vnode **vpp;
1.1 mycroft 310: IN struct componentname *cnp;
311: IN struct vattr *vap;
312: };
313:
1.13 fvdl 314: #
315: #% rmdir dvp L U U
316: #% rmdir vp L U U
317: #
1.22 wrstuden 318: #! rmdir cnp DELETE, LOCKPARENT | LOCKLEAF
319: #
1.1 mycroft 320: vop_rmdir {
1.41 thorpej 321: IN LOCKED=YES WILLPUT struct vnode *dvp;
322: IN LOCKED=YES WILLPUT struct vnode *vp;
1.1 mycroft 323: IN struct componentname *cnp;
324: };
325:
1.13 fvdl 326: #
327: #% symlink dvp L U U
1.29 assar 328: #% symlink vpp - L -
1.13 fvdl 329: #
1.22 wrstuden 330: #! symlink cnp CREATE, LOCKPARENT
331: #
1.1 mycroft 332: vop_symlink {
1.41 thorpej 333: IN LOCKED=YES WILLPUT struct vnode *dvp;
1.44.4.3 yamt 334: OUT WILLMAKE struct vnode **vpp;
1.1 mycroft 335: IN struct componentname *cnp;
336: IN struct vattr *vap;
337: IN char *target;
338: };
339:
1.13 fvdl 340: #
1.44 perry 341: #% readdir vp L L L
1.13 fvdl 342: #
1.1 mycroft 343: vop_readdir {
1.41 thorpej 344: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 345: INOUT struct uio *uio;
1.44.4.1 yamt 346: IN kauth_cred_t cred;
1.1 mycroft 347: OUT int *eofflag;
1.13 fvdl 348: OUT off_t **cookies;
349: IN int *ncookies;
1.1 mycroft 350: };
351:
1.13 fvdl 352: #
353: #% readlink vp L L L
354: #
1.1 mycroft 355: vop_readlink {
1.41 thorpej 356: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 357: INOUT struct uio *uio;
1.44.4.1 yamt 358: IN kauth_cred_t cred;
1.1 mycroft 359: };
360:
1.13 fvdl 361: #
362: #% abortop dvp = = =
363: #
1.22 wrstuden 364: #! abortop cnp as appropriate.
365: #
1.1 mycroft 366: vop_abortop {
367: IN struct vnode *dvp;
368: IN struct componentname *cnp;
369: };
370:
1.13 fvdl 371: #
1.44 perry 372: #% inactive vp L U U
1.13 fvdl 373: #
1.1 mycroft 374: vop_inactive {
1.41 thorpej 375: IN LOCKED=YES WILLUNLOCK struct vnode *vp;
1.1 mycroft 376: };
377:
1.13 fvdl 378: #
379: #% reclaim vp U U U
380: #
1.1 mycroft 381: vop_reclaim {
1.41 thorpej 382: IN LOCKED=NO struct vnode *vp;
1.1 mycroft 383: };
384:
1.13 fvdl 385: #
386: #% lock vp U L U
387: #
1.1 mycroft 388: vop_lock {
1.41 thorpej 389: IN LOCKED=NO struct vnode *vp;
1.13 fvdl 390: IN int flags;
1.1 mycroft 391: };
392:
1.13 fvdl 393: #
394: #% unlock vp L U L
395: #
1.1 mycroft 396: vop_unlock {
1.41 thorpej 397: IN LOCKED=YES struct vnode *vp;
1.13 fvdl 398: IN int flags;
1.1 mycroft 399: };
400:
1.13 fvdl 401: #
1.40 yamt 402: #% bmap vp = = =
1.13 fvdl 403: #% bmap vpp - U -
404: #
1.1 mycroft 405: vop_bmap {
1.44.4.1 yamt 406: IN struct vnode *vp;
1.1 mycroft 407: IN daddr_t bn;
408: OUT struct vnode **vpp;
409: IN daddr_t *bnp;
410: OUT int *runp;
411: };
412:
1.13 fvdl 413: #
1.38 hannken 414: #% strategy vp = = =
1.13 fvdl 415: #
1.38 hannken 416: vop_strategy {
417: IN struct vnode *vp;
418: IN struct buf *bp;
419: };
1.1 mycroft 420:
1.13 fvdl 421: #
422: #% print vp = = =
423: #
1.1 mycroft 424: vop_print {
425: IN struct vnode *vp;
426: };
427:
1.13 fvdl 428: #
429: #% islocked vp = = =
430: #
1.1 mycroft 431: vop_islocked {
432: IN struct vnode *vp;
433: };
434:
1.13 fvdl 435: #
436: #% pathconf vp L L L
437: #
1.1 mycroft 438: vop_pathconf {
1.41 thorpej 439: IN LOCKED=YES struct vnode *vp;
1.1 mycroft 440: IN int name;
1.3 cgd 441: OUT register_t *retval;
1.1 mycroft 442: };
443:
1.13 fvdl 444: #
445: #% advlock vp U U U
446: #
1.1 mycroft 447: vop_advlock {
1.41 thorpej 448: IN LOCKED=NO struct vnode *vp;
1.32 jdolecek 449: IN void *id;
1.1 mycroft 450: IN int op;
451: IN struct flock *fl;
452: IN int flags;
453: };
454:
1.44 perry 455: #
1.13 fvdl 456: #% lease vp = = =
1.44 perry 457: #
1.6 mycroft 458: vop_lease {
459: IN struct vnode *vp;
1.44.4.1 yamt 460: IN kauth_cred_t cred;
1.6 mycroft 461: IN int flag;
1.7 mycroft 462: };
463:
1.13 fvdl 464: #
465: #% whiteout dvp L L L
466: #% whiteout cnp - - -
467: #% whiteout flag - - -
1.22 wrstuden 468: #
469: #! whiteout cnp CREATE, LOCKPARENT
1.44 perry 470: #
1.7 mycroft 471: vop_whiteout {
1.41 thorpej 472: IN LOCKED=YES struct vnode *dvp;
1.7 mycroft 473: IN struct componentname *cnp;
474: IN int flags;
1.1 mycroft 475: };
476:
1.13 fvdl 477: #
1.1 mycroft 478: # Needs work: no vp?
1.13 fvdl 479: #
1.1 mycroft 480: #vop_bwrite {
481: # IN struct buf *bp;
482: #};
1.26 chs 483:
484: #
1.39 yamt 485: #% getpages vp = = =
1.26 chs 486: #
487: vop_getpages {
488: IN struct vnode *vp;
489: IN voff_t offset;
1.27 chs 490: IN struct vm_page **m;
1.26 chs 491: IN int *count;
492: IN int centeridx;
493: IN vm_prot_t access_type;
494: IN int advice;
495: IN int flags;
496: };
497:
498: #
1.30 chs 499: #% putpages vp = = =
1.26 chs 500: #
501: vop_putpages {
502: IN struct vnode *vp;
1.30 chs 503: IN voff_t offlo;
504: IN voff_t offhi;
1.26 chs 505: IN int flags;
506: };
1.42 thorpej 507:
508: #
509: #% closeextattr vp L L L
510: #
511: vop_closeextattr {
512: IN LOCKED=YES struct vnode *vp;
513: IN int commit;
1.44.4.1 yamt 514: IN kauth_cred_t cred;
1.42 thorpej 515: };
516:
517: #
518: #% getextattr vp L L L
519: #
520: vop_getextattr {
521: IN LOCKED=YES struct vnode *vp;
522: IN int attrnamespace;
523: IN const char *name;
524: INOUT struct uio *uio;
525: OUT size_t *size;
1.44.4.1 yamt 526: IN kauth_cred_t cred;
1.42 thorpej 527: };
528:
529: #
530: #% listextattr vp L L L
531: #
532: vop_listextattr {
533: IN LOCKED=YES struct vnode *vp;
534: IN int attrnamespace;
535: INOUT struct uio *uio;
536: OUT size_t *size;
1.44.4.1 yamt 537: IN kauth_cred_t cred;
1.42 thorpej 538: };
539:
540: #
541: #% openextattr vp L L L
542: #
543: vop_openextattr {
544: IN LOCKED=YES struct vnode *vp;
1.44.4.1 yamt 545: IN kauth_cred_t cred;
1.42 thorpej 546: };
547:
548: #
549: #% deleteextattr vp L L L
550: #
551: vop_deleteextattr {
552: IN LOCKED=YES struct vnode *vp;
553: IN int attrnamespace;
554: IN const char *name;
1.44.4.1 yamt 555: IN kauth_cred_t cred;
1.42 thorpej 556: };
557:
558: #
559: #% setextattr vp L L L
560: #
561: vop_setextattr {
562: IN LOCKED=YES struct vnode *vp;
563: IN int attrnamespace;
564: IN const char *name;
565: INOUT struct uio *uio;
1.44.4.1 yamt 566: IN kauth_cred_t cred;
1.42 thorpej 567: };
CVSweb <webmaster@jp.NetBSD.org>