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

unix.superglobalmegacorp.com

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