Annotation of kernel/bsd/vfs/vnode_if.src, revision 1.1.1.1

1.1       root        1: #
                      2: # Copyright (c) 1995, 1997-1998 Apple Computer, Inc. All Rights Reserved.
                      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: #
                     34: #      @(#)vnode_if.src        8.12 (Berkeley) 5/14/95
                     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: #
                     61: vop_lookup {
                     62:        IN struct vnode *dvp;
                     63:        INOUT struct vnode **vpp;
                     64:        IN struct componentname *cnp;
                     65: };
                     66: 
                     67: #
                     68: #% create      dvp     L U U
                     69: #% create      vpp     - L -
                     70: #
                     71: vop_create {
                     72:        IN WILLRELE struct vnode *dvp;
                     73:        OUT struct vnode **vpp;
                     74:        IN struct componentname *cnp;
                     75:        IN struct vattr *vap;
                     76: };
                     77: 
                     78: #
                     79: #% whiteout    dvp     L L L
                     80: #% whiteout    cnp     - - -
                     81: #% whiteout    flag    - - -
                     82: #
                     83: vop_whiteout {
                     84:        IN WILLRELE struct vnode *dvp;
                     85:        IN struct componentname *cnp;
                     86:        IN int flags;
                     87: };
                     88: 
                     89: #
                     90: #% mknod       dvp     L U U
                     91: #% mknod       vpp     - X -
                     92: #
                     93: vop_mknod {
                     94:        IN WILLRELE struct vnode *dvp;
                     95:        OUT WILLRELE struct vnode **vpp;
                     96:        IN struct componentname *cnp;
                     97:        IN struct vattr *vap;
                     98: };
                     99: 
                    100: #
                    101: #% mkcomplex   dvp     L U U
                    102: #% mkcomplex   vpp     - X -
                    103: #
                    104: vop_mkcomplex {
                    105:        IN WILLRELE struct vnode *dvp;
                    106:        OUT WILLRELE struct vnode **vpp;
                    107:        IN struct componentname *cnp;
                    108:        IN struct vattr *vap;
                    109:        IN u_long type;
                    110: };
                    111: 
                    112: #
                    113: #% open                vp      L L L
                    114: #
                    115: vop_open {
                    116:        IN struct vnode *vp;
                    117:        IN int mode;
                    118:        IN struct ucred *cred;
                    119:        IN struct proc *p;
                    120: };
                    121: 
                    122: #
                    123: #% close       vp      U U U
                    124: #
                    125: vop_close {
                    126:        IN struct vnode *vp;
                    127:        IN int fflag;
                    128:        IN struct ucred *cred;
                    129:        IN struct proc *p;
                    130: };
                    131: 
                    132: #
                    133: #% access      vp      L L L
                    134: #
                    135: vop_access {
                    136:        IN struct vnode *vp;
                    137:        IN int mode;
                    138:        IN struct ucred *cred;
                    139:        IN struct proc *p;
                    140: };
                    141: 
                    142: #
                    143: #% getattr     vp      = = =
                    144: #
                    145: vop_getattr {
                    146:        IN struct vnode *vp;
                    147:        IN struct vattr *vap;
                    148:        IN struct ucred *cred;
                    149:        IN struct proc *p;
                    150: };
                    151: 
                    152: #
                    153: #% setattr     vp      L L L
                    154: #
                    155: vop_setattr {
                    156:        IN struct vnode *vp;
                    157:        IN struct vattr *vap;
                    158:        IN struct ucred *cred;
                    159:        IN struct proc *p;
                    160: };
                    161: 
                    162: #
                    163: #% getattrlist vp      = = =
                    164: #
                    165: vop_getattrlist {
                    166:        IN struct vnode *vp;
                    167:        IN struct attrlist *alist;
                    168:        INOUT struct uio *uio;
                    169:        IN struct ucred *cred;
                    170:        IN struct proc *p;
                    171: };
                    172: 
                    173: #
                    174: #% setattrlist vp      L L L
                    175: #
                    176: vop_setattrlist {
                    177:        IN struct vnode *vp;
                    178:        IN struct attrlist *alist;
                    179:        INOUT struct uio *uio;
                    180:        IN struct ucred *cred;
                    181:        IN struct proc *p;
                    182: };
                    183: 
                    184: #
                    185: #% read                vp      L L L
                    186: #
                    187: vop_read {
                    188:        IN struct vnode *vp;
                    189:        INOUT struct uio *uio;
                    190:        IN int ioflag;
                    191:        IN struct ucred *cred;
                    192: };
                    193: 
                    194: #
                    195: #% write       vp      L L L
                    196: #
                    197: vop_write {
                    198:        IN struct vnode *vp;
                    199:        INOUT struct uio *uio;
                    200:        IN int ioflag;
                    201:        IN struct ucred *cred;
                    202: };
                    203: 
                    204: #
                    205: #% lease       vp      = = =
                    206: #
                    207: vop_lease {
                    208:        IN struct vnode *vp;
                    209:        IN struct proc *p;
                    210:        IN struct ucred *cred;
                    211:        IN int flag;
                    212: };
                    213: 
                    214: #
                    215: #% ioctl       vp      U U U
                    216: #
                    217: vop_ioctl {
                    218:        IN struct vnode *vp;
                    219:        IN u_long command;
                    220:        IN caddr_t data;
                    221:        IN int fflag;
                    222:        IN struct ucred *cred;
                    223:        IN struct proc *p;
                    224: };
                    225: 
                    226: #
                    227: #% select      vp      U U U
                    228: #
                    229: # Needs work?  (fflags)
                    230: #
                    231: vop_select {
                    232:        IN struct vnode *vp;
                    233:        IN int which;
                    234:        IN int fflags;
                    235:        IN struct ucred *cred;
                    236:        IN struct proc *p;
                    237: };
                    238: 
                    239: #
                    240: #% exchange fvp                L L L
                    241: #% exchange tvp                L L L
                    242: #
                    243: vop_exchange {
                    244:        IN struct vnode *fvp;
                    245:        IN struct vnode *tvp;
                    246:        IN struct ucred *cred;
                    247:        IN struct proc *p;
                    248: };
                    249: 
                    250: #
                    251: #% revoke      vp      U U U
                    252: #
                    253: vop_revoke {
                    254:        IN struct vnode *vp;
                    255:        IN int flags;
                    256: };
                    257: 
                    258: #
                    259: # XXX - not used
                    260: #
                    261: vop_mmap {
                    262:        IN struct vnode *vp;
                    263:        IN int fflags;
                    264:        IN struct ucred *cred;
                    265:        IN struct proc *p;
                    266: };
                    267: 
                    268: #
                    269: #% fsync       vp      L L L
                    270: #
                    271: vop_fsync {
                    272:        IN struct vnode *vp;
                    273:        IN struct ucred *cred;
                    274:        IN int waitfor;
                    275:        IN struct proc *p;
                    276: };
                    277: 
                    278: #
                    279: # XXX - not used
                    280: # Needs work: Is newoff right?  What's it mean?
                    281: #
                    282: vop_seek {
                    283:        IN struct vnode *vp;
                    284:        IN off_t oldoff;
                    285:        IN off_t newoff;
                    286:        IN struct ucred *cred;
                    287: };
                    288: 
                    289: #
                    290: #% remove      dvp     L U U
                    291: #% remove      vp      L U U
                    292: #
                    293: vop_remove {
                    294:        IN WILLRELE struct vnode *dvp;
                    295:        IN WILLRELE struct vnode *vp;
                    296:        IN struct componentname *cnp;
                    297: };
                    298: 
                    299: #
                    300: #% link                vp      U U U
                    301: #% link                tdvp    L U U
                    302: #
                    303: vop_link {
                    304:        IN WILLRELE struct vnode *vp;
                    305:        IN struct vnode *tdvp;
                    306:        IN struct componentname *cnp;
                    307: };
                    308: 
                    309: #
                    310: #% rename      fdvp    U U U
                    311: #% rename      fvp     U U U
                    312: #% rename      tdvp    L U U
                    313: #% rename      tvp     X U U
                    314: #
                    315: vop_rename {
                    316:        IN WILLRELE struct vnode *fdvp;
                    317:        IN WILLRELE struct vnode *fvp;
                    318:        IN struct componentname *fcnp;
                    319:        IN WILLRELE struct vnode *tdvp;
                    320:        IN WILLRELE struct vnode *tvp;
                    321:        IN struct componentname *tcnp;
                    322: };
                    323: 
                    324: #
                    325: #% mkdir       dvp     L U U
                    326: #% mkdir       vpp     - L -
                    327: #
                    328: vop_mkdir {
                    329:        IN WILLRELE struct vnode *dvp;
                    330:        OUT struct vnode **vpp;
                    331:        IN struct componentname *cnp;
                    332:        IN struct vattr *vap;
                    333: };
                    334: 
                    335: #
                    336: #% rmdir       dvp     L U U
                    337: #% rmdir       vp      L U U
                    338: #
                    339: vop_rmdir {
                    340:        IN WILLRELE struct vnode *dvp;
                    341:        IN WILLRELE struct vnode *vp;
                    342:        IN struct componentname *cnp;
                    343: };
                    344: 
                    345: #
                    346: #% symlink     dvp     L U U
                    347: #% symlink     vpp     - U -
                    348: #
                    349: # XXX - note that the return vnode has already been VRELE'ed
                    350: #      by the filesystem layer.  To use it you must use vget,
                    351: #      possibly with a further namei.
                    352: #
                    353: vop_symlink {
                    354:        IN WILLRELE struct vnode *dvp;
                    355:        OUT WILLRELE struct vnode **vpp;
                    356:        IN struct componentname *cnp;
                    357:        IN struct vattr *vap;
                    358:        IN char *target;
                    359: };
                    360: 
                    361: #
                    362: #% readdir     vp      L L L
                    363: #
                    364: vop_readdir {
                    365:        IN struct vnode *vp;
                    366:        INOUT struct uio *uio;
                    367:        IN struct ucred *cred;
                    368:        INOUT int *eofflag;
                    369:        OUT int *ncookies;
                    370:        INOUT u_long **cookies;
                    371: };
                    372: 
                    373: #
                    374: #% readdirattr vp      L L L
                    375: #
                    376: vop_readdirattr {
                    377:        IN struct vnode *vp;
                    378:        IN struct attrlist *alist;
                    379:        INOUT struct uio *uio;
                    380:        INOUT int index;
                    381:        INOUT int *eofflag;
                    382:        OUT u_long *ncookies;
                    383:        INOUT u_long **cookies;
                    384:        IN struct ucred *cred;
                    385: };
                    386: 
                    387: #
                    388: #% readlink    vp      L L L
                    389: #
                    390: vop_readlink {
                    391:        IN struct vnode *vp;
                    392:        INOUT struct uio *uio;
                    393:        IN struct ucred *cred;
                    394: };
                    395: 
                    396: #
                    397: #% abortop     dvp     = = =
                    398: #
                    399: vop_abortop {
                    400:        IN struct vnode *dvp;
                    401:        IN struct componentname *cnp;
                    402: };
                    403: 
                    404: #
                    405: #% inactive    vp      L U U
                    406: #
                    407: vop_inactive {
                    408:        IN struct vnode *vp;
                    409:        IN struct proc *p;
                    410: };
                    411: 
                    412: #
                    413: #% reclaim     vp      U U U
                    414: #
                    415: vop_reclaim {
                    416:        IN struct vnode *vp;
                    417:        IN struct proc *p;
                    418: };
                    419: 
                    420: #
                    421: #% lock                vp      U L U
                    422: #
                    423: vop_lock {
                    424:        IN struct vnode *vp;
                    425:        IN int flags;
                    426:        IN struct proc *p;
                    427: };
                    428: 
                    429: #
                    430: #% unlock      vp      L U L
                    431: #
                    432: vop_unlock {
                    433:        IN struct vnode *vp;
                    434:        IN int flags;
                    435:        IN struct proc *p;
                    436: };
                    437: 
                    438: #
                    439: #% bmap                vp      L L L
                    440: #% bmap                vpp     - U -
                    441: #
                    442: vop_bmap {
                    443:        IN struct vnode *vp;
                    444:        IN daddr_t bn;
                    445:        OUT struct vnode **vpp;
                    446:        IN daddr_t *bnp;
                    447:        OUT int *runp;
                    448: };
                    449: 
                    450: #
                    451: # Needs work: no vp?
                    452: #
                    453: #vop_strategy {
                    454: #      IN struct buf *bp;
                    455: #};
                    456: 
                    457: #
                    458: #% print       vp      = = =
                    459: #
                    460: vop_print {
                    461:        IN struct vnode *vp;
                    462: };
                    463: 
                    464: #
                    465: #% islocked    vp      = = =
                    466: #
                    467: vop_islocked {
                    468:        IN struct vnode *vp;
                    469: };
                    470: 
                    471: #
                    472: #% pathconf    vp      L L L
                    473: #
                    474: vop_pathconf {
                    475:        IN struct vnode *vp;
                    476:        IN int name;
                    477:        OUT register_t *retval;
                    478: };
                    479: 
                    480: #
                    481: #% advlock     vp      U U U
                    482: #
                    483: vop_advlock {
                    484:        IN struct vnode *vp;
                    485:        IN caddr_t id;
                    486:        IN int op;
                    487:        IN struct flock *fl;
                    488:        IN int flags;
                    489: };
                    490: 
                    491: #
                    492: #% blkatoff    vp      L L L
                    493: #
                    494: vop_blkatoff {
                    495:        IN struct vnode *vp;
                    496:        IN off_t offset;
                    497:        OUT char **res;
                    498:        OUT struct buf **bpp;
                    499: };
                    500: 
                    501: #
                    502: #% valloc      pvp     L L L
                    503: #
                    504: vop_valloc {
                    505:        IN struct vnode *pvp;
                    506:        IN int mode;
                    507:        IN struct ucred *cred;
                    508:        OUT struct vnode **vpp;
                    509: };
                    510: 
                    511: #
                    512: #% reallocblks vp      L L L
                    513: #
                    514: vop_reallocblks {
                    515:        IN struct vnode *vp;
                    516:        IN struct cluster_save *buflist;
                    517: };
                    518: 
                    519: #
                    520: #% vfree       pvp     L L L
                    521: #
                    522: vop_vfree {
                    523:        IN struct vnode *pvp;
                    524:        IN ino_t ino;
                    525:        IN int mode;
                    526: };
                    527: 
                    528: #
                    529: #% truncate    vp      L L L
                    530: #
                    531: vop_truncate {
                    532:        IN struct vnode *vp;
                    533:        IN off_t length;
                    534:        IN int flags;
                    535:        IN struct ucred *cred;
                    536:        IN struct proc *p;
                    537: };
                    538: 
                    539: #
                    540: #% allocate    vp      L L L
                    541: #
                    542: vop_allocate {
                    543:        IN struct vnode *vp;
                    544:        IN off_t length;
                    545:        IN u_int32_t flags;
                    546:        OUT off_t *bytesallocated;
                    547:        IN struct ucred *cred;
                    548:        IN struct proc *p;
                    549: };
                    550: 
                    551: #
                    552: #% update      vp      L L L
                    553: #
                    554: vop_update {
                    555:        IN struct vnode *vp;
                    556:        IN struct timeval *access;
                    557:        IN struct timeval *modify;
                    558:        IN int waitfor;
                    559: };
                    560: 
                    561: #
                    562: #% pgrd                vp      L L L
                    563: #
                    564: vop_pgrd {
                    565:        IN struct vnode *vp;
                    566:        INOUT struct uio *uio;
                    567:        IN struct ucred *cred;
                    568: };
                    569: 
                    570: #
                    571: #% pgwr                vp      L L L
                    572: #
                    573: vop_pgwr {
                    574:        IN struct vnode *vp;
                    575:        INOUT struct uio *uio;
                    576:        IN struct ucred *cred;
                    577:        IN vm_offset_t  offset;
                    578: };
                    579: 
                    580: #
                    581: # Needs work: no vp?
                    582: #
                    583: #vop_bwrite {
                    584: #      IN struct buf *bp;
                    585: #};
                    586: 
                    587: #
                    588: #% pagein      vp      L L L
                    589: #
                    590: vop_pagein {
                    591:        IN struct vnode *vp;
                    592:        INOUT struct uio *uio;
                    593:        IN int ioflag;
                    594:        IN struct ucred *cred;
                    595: };
                    596: 
                    597: #
                    598: #% pageout     vp      L L L
                    599: #
                    600: vop_pageout {
                    601:        IN struct vnode *vp;
                    602:        INOUT struct uio *uio;
                    603:        IN int ioflag;
                    604:        IN struct ucred *cred;
                    605: };
                    606: 
                    607: #
                    608: #% devblocksize        vp      = = =
                    609: #
                    610: vop_devblocksize {
                    611:        IN struct vnode *vp;
                    612:        OUT register_t *retval;
                    613: };
                    614: 
                    615: #
                    616: #% searchfs    vp      L L L
                    617: #
                    618: 
                    619: vop_searchfs {
                    620:        IN struct vnode *vp;
                    621:        IN void *searchparams1;
                    622:        IN void *searchparams2;
                    623:        IN struct attrlist *searchattrs;
                    624:        IN u_long maxmatches;
                    625:        IN struct timeval *timelimit;
                    626:        OUT struct attrlist *returnattrs;
                    627:        OUT u_long *nummatches;
                    628:        IN u_long scriptcode;
                    629:        IN u_long options;
                    630:        INOUT struct uio *uio;
                    631:        INOUT struct searchstate *searchstate;
                    632: };
                    633: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.