[BACK]Return to vnode_if.src CVS log [TXT][DIR] Up to [local] / sys / kern

Annotation of sys/kern/vnode_if.src, Revision 1.1.1.1

1.1       nbrk        1: #      $OpenBSD: vnode_if.src,v 1.32 2007/01/16 17:52:18 thib Exp $
                      2: #      $NetBSD: vnode_if.src,v 1.10 1996/05/11 18:26:27 mycroft Exp $
                      3: #
                      4: # Copyright (c) 1992, 1993
                      5: #      The Regents of the University of California.  All rights reserved.
                      6: #
                      7: # Redistribution and use in source and binary forms, with or without
                      8: # modification, are permitted provided that the following conditions
                      9: # are met:
                     10: # 1. Redistributions of source code must retain the above copyright
                     11: #    notice, this list of conditions and the following disclaimer.
                     12: # 2. Redistributions in binary form must reproduce the above copyright
                     13: #    notice, this list of conditions and the following disclaimer in the
                     14: #    documentation and/or other materials provided with the distribution.
                     15: # 3. Neither the name of the University nor the names of its contributors
                     16: #    may be used to endorse or promote products derived from this software
                     17: #    without specific prior written permission.
                     18: #
                     19: # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22: # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29: # SUCH DAMAGE.
                     30: #
                     31: #      @(#)vnode_if.src        8.3 (Berkeley) 2/3/94
                     32: #
                     33:
                     34:
                     35: #
                     36: # Above each of the vop descriptors is a specification of the locking
                     37: # protocol used by each vop call.  The first column is the name of
                     38: # the variable, the remaining three columns are in, out and error
                     39: # respectively.  The "in" column defines the lock state on input,
                     40: # the "out" column defines the state on successful return, and the
                     41: # "error" column defines the locking state on error exit.
                     42: #
                     43: # The locking value can take the following values:
                     44: # L: locked.
                     45: # U: unlocked/
                     46: # -: not applicable.  vnode does not yet (or no longer) exists.
                     47: # =: the same on input and output, may be either L or U.
                     48: # X: locked if not nil.
                     49: #
                     50:
                     51:
                     52: #
                     53: #% islocked    vp      = = =
                     54: #
                     55: vop_islocked {
                     56:        IN struct vnode *vp;
                     57: };
                     58:
                     59: #
                     60: #% lookup      dvp     L ? ?
                     61: #% lookup      vpp     - L -
                     62: #
                     63: #
                     64: # Note that EJUSTRETURN is not considered an error condition for locking
                     65: # purposes.
                     66: #
                     67: # if both ISLASTCN and LOCKPARENT are set in cnp->cn_flags then
                     68: #
                     69: #      dvp  L L L*
                     70: #
                     71: # otherwise,
                     72: #
                     73: #       dvp  L U L*
                     74: #
                     75: # * The lock state on return is indeterminate since the lookup implementations
                     76: # unlock and relock the vnode (an operation which is not guaranteed to
                     77: # succeed). However, these types of failures should be rare. Unfortunately,
                     78: # they are currently undetectable.
                     79: #
                     80:
                     81: vop_lookup {
                     82:        IN struct vnode *dvp;
                     83:        INOUT struct vnode **vpp;
                     84:        IN struct componentname *cnp;
                     85: };
                     86:
                     87: #
                     88: #% create      dvp     L U U
                     89: #% create      vpp     - L -
                     90: #
                     91:
                     92: vop_create {
                     93:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                     94:        OUT struct vnode **vpp;
                     95:        IN struct componentname *cnp;
                     96:        IN struct vattr *vap;
                     97: };
                     98:
                     99: #
                    100: #% mknod       dvp     L U U
                    101: #% mknod       vpp     - X -
                    102: #
                    103:
                    104: vop_mknod {
                    105:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    106:        OUT WILLRELE struct vnode **vpp;
                    107:        IN struct componentname *cnp;
                    108:        IN struct vattr *vap;
                    109: };
                    110:
                    111: #
                    112: #% open                vp      = = =
                    113: #
                    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      L L L
                    124: #
                    125:
                    126: vop_close {
                    127:        IN SHOULDBELOCKED struct vnode *vp;
                    128:        IN int fflag;
                    129:        IN struct ucred *cred;
                    130:        IN struct proc *p;
                    131: };
                    132:
                    133: #
                    134: #% access      vp      L L L
                    135: #
                    136:
                    137: vop_access {
                    138:        IN SHOULDBELOCKED struct vnode *vp;
                    139:        IN int mode;
                    140:        IN struct ucred *cred;
                    141:        IN struct proc *p;
                    142: };
                    143:
                    144: #
                    145: #% getattr     vp      = = =
                    146: #
                    147:
                    148: vop_getattr {
                    149:        IN struct vnode *vp;
                    150:        IN struct vattr *vap;
                    151:        IN struct ucred *cred;
                    152:        IN struct proc *p;
                    153: };
                    154:
                    155:
                    156: #
                    157: #% setattr     vp      L L L
                    158: #
                    159:
                    160: vop_setattr {
                    161:        IN SHOULDBELOCKED struct vnode *vp;
                    162:        IN struct vattr *vap;
                    163:        IN struct ucred *cred;
                    164:        IN struct proc *p;
                    165: };
                    166:
                    167: #
                    168: #% read                vp      L L L
                    169: #
                    170:
                    171: vop_read {
                    172:        IN SHOULDBELOCKED struct vnode *vp;
                    173:        INOUT struct uio *uio;
                    174:        IN int ioflag;
                    175:        IN struct ucred *cred;
                    176: };
                    177:
                    178: #
                    179: #% write       vp      L L L
                    180: #
                    181:
                    182: vop_write {
                    183:        IN SHOULDBELOCKED struct vnode *vp;
                    184:        INOUT struct uio *uio;
                    185:        IN int ioflag;
                    186:        IN struct ucred *cred;
                    187: };
                    188:
                    189: #
                    190: #% ioctl       vp      U U U
                    191: #
                    192:
                    193: vop_ioctl {
                    194:        IN struct vnode *vp;
                    195:        IN u_long command;
                    196:        IN void *data;
                    197:        IN int fflag;
                    198:        IN struct ucred *cred;
                    199:        IN struct proc *p;
                    200: };
                    201:
                    202: #
                    203: #% poll        vp      U U U
                    204: #
                    205: vop_poll {
                    206:        IN struct vnode *vp;
                    207:        IN int events;
                    208:        IN struct proc *p;
                    209: };
                    210:
                    211: #
                    212: #% kqfilter    vp      U U U
                    213: #
                    214: vop_kqfilter {
                    215:        IN struct vnode *vp;
                    216:        IN struct knote *kn;
                    217: };
                    218:
                    219: #
                    220: #% revoke      vp      U U U
                    221: #
                    222: vop_revoke {
                    223:        IN struct vnode *vp;
                    224:        IN int flags;
                    225: };
                    226:
                    227: #
                    228: #% fsync       vp      L L L
                    229: #
                    230: vop_fsync {
                    231:        IN SHOULDBELOCKED struct vnode *vp;
                    232:        IN struct ucred *cred;
                    233:        IN int waitfor;
                    234:        IN struct proc *p;
                    235: };
                    236:
                    237: #
                    238: #% remove      dvp     L U U
                    239: #% remove      vp      L U U
                    240: #
                    241:
                    242: vop_remove {
                    243:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    244:        IN SHOULDBELOCKED WILLPUT struct vnode *vp;
                    245:        IN struct componentname *cnp;
                    246: };
                    247:
                    248: #
                    249: #% link                dvp     L U U
                    250: #% link                vp      U U U
                    251: #
                    252: vop_link {
                    253:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    254:        IN struct vnode *vp;
                    255:        IN struct componentname *cnp;
                    256: };
                    257:
                    258: #
                    259: #% rename      fdvp    U U U
                    260: #% rename      fvp     U U U
                    261: #% rename      tdvp    L U U
                    262: #% rename      tvp     X U U
                    263: #
                    264:
                    265: vop_rename {
                    266:        IN WILLRELE struct vnode *fdvp;
                    267:        IN WILLRELE struct vnode *fvp;
                    268:        IN struct componentname *fcnp;
                    269:        IN SHOULDBELOCKED WILLPUT struct vnode *tdvp;
                    270:        IN WILLRELE struct vnode *tvp;
                    271:        IN struct componentname *tcnp;
                    272: };
                    273:
                    274: #
                    275: #% mkdir       dvp     L U U
                    276: #% mkdir       vpp     - L -
                    277: #
                    278:
                    279: vop_mkdir {
                    280:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    281:        OUT struct vnode **vpp;
                    282:        IN struct componentname *cnp;
                    283:        IN struct vattr *vap;
                    284: };
                    285:
                    286: #
                    287: #% rmdir       dvp     L U U
                    288: #% rmdir       vp      L U U
                    289: #
                    290:
                    291: vop_rmdir {
                    292:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    293:        IN SHOULDBELOCKED WILLPUT struct vnode *vp;
                    294:        IN struct componentname *cnp;
                    295: };
                    296:
                    297: #
                    298: #% symlink     dvp     L U U
                    299: #% symlink     vpp     - U -
                    300: #
                    301: # XXX - note that the return vnode has already been VRELE'ed
                    302: #      by the filesystem layer.  To use it you must use vget,
                    303: #      possibly with a further namei.
                    304: #
                    305:
                    306: vop_symlink {
                    307:        IN SHOULDBELOCKED WILLPUT struct vnode *dvp;
                    308:        OUT WILLRELE struct vnode **vpp;
                    309:        IN struct componentname *cnp;
                    310:        IN struct vattr *vap;
                    311:        IN char *target;
                    312: };
                    313:
                    314: #
                    315: #% readdir     vp      L L L
                    316: #
                    317:
                    318: vop_readdir {
                    319:        IN SHOULDBELOCKED struct vnode *vp;
                    320:        INOUT struct uio *uio;
                    321:        IN struct ucred *cred;
                    322:        INOUT int *eofflag;
                    323:        OUT int *ncookies;
                    324:        INOUT u_long **cookies;
                    325: };
                    326:
                    327: #
                    328: #% readlink    vp      L L L
                    329: #
                    330: vop_readlink {
                    331:        IN SHOULDBELOCKED struct vnode *vp;
                    332:        INOUT struct uio *uio;
                    333:        IN struct ucred *cred;
                    334: };
                    335:
                    336: #
                    337: #% abortop     dvp     = = =
                    338: #
                    339: vop_abortop {
                    340:        IN struct vnode *dvp;
                    341:        IN struct componentname *cnp;
                    342: };
                    343:
                    344:
                    345: #
                    346: #% inactive    vp      L U U
                    347: #
                    348: vop_inactive {
                    349:        IN SHOULDBELOCKED WILLUNLOCK struct vnode *vp;
                    350:        IN struct proc *p;
                    351: };
                    352:
                    353: #
                    354: #% reclaim     vp      U U U
                    355: #
                    356:
                    357: vop_reclaim {
                    358:        IN struct vnode *vp;
                    359:        IN struct proc *p;
                    360: };
                    361:
                    362: #
                    363: #% lock                vp      U L U
                    364: #
                    365:
                    366: vop_lock {
                    367:        IN struct vnode *vp;
                    368:        IN int flags;
                    369:        IN struct proc *p;
                    370: };
                    371:
                    372: #
                    373: #% unlock      vp      L U L
                    374: #
                    375:
                    376: vop_unlock {
                    377:        IN struct vnode *vp;
                    378:        IN int flags;
                    379:        IN struct proc *p;
                    380: };
                    381:
                    382: #
                    383: #% bmap                vp      L L L
                    384: #% bmap                vpp     - U -
                    385: #
                    386:
                    387: vop_bmap {
                    388:        IN SHOULDBELOCKED struct vnode *vp;
                    389:        IN daddr64_t bn;
                    390:        OUT struct vnode **vpp;
                    391:        IN daddr64_t *bnp;
                    392:        OUT int *runp;
                    393: };
                    394:
                    395: #
                    396: # Needs work: no vp?
                    397: #
                    398: #vop_strategy {
                    399: #      IN struct buf *bp;
                    400: #};
                    401:
                    402: #
                    403: #% print       vp      = = =
                    404: #
                    405: vop_print {
                    406:        IN struct vnode *vp;
                    407: };
                    408: #
                    409: #% pathconf    vp      L L L
                    410: #
                    411: vop_pathconf {
                    412:        IN SHOULDBELOCKED struct vnode *vp;
                    413:        IN int name;
                    414:        OUT register_t *retval;
                    415: };
                    416:
                    417: #
                    418: #% advlock     vp      U U U
                    419: #
                    420: vop_advlock {
                    421:        IN struct vnode *vp;
                    422:        IN void *id;
                    423:        IN int op;
                    424:        IN struct flock *fl;
                    425:        IN int flags;
                    426: };
                    427:
                    428: #
                    429: #% reallocblks vp      L L L
                    430: #
                    431: vop_reallocblks {
                    432:        IN SHOULDBELOCKED struct vnode *vp;
                    433:        IN struct cluster_save *buflist;
                    434: };
                    435:
                    436: # Needs work: no vp?
                    437: #vop_bwrite {
                    438: #      IN struct buf *bp;
                    439: #};

CVSweb