Home | History | Annotate | Line # | Download | only in rumpvfs
rumpvnode_if.c revision 1.3.4.1
      1 /*	$NetBSD: rumpvnode_if.c,v 1.3.4.1 2010/05/30 05:18:07 rmind Exp $	*/
      2 
      3 /*
      4  * Warning: DO NOT EDIT! This file is automatically generated!
      5  * (Modifications made here may easily be lost!)
      6  *
      7  * Created from the file:
      8  *	NetBSD: vnode_if.src,v 1.58 2008/11/15 19:08:12 pooka Exp
      9  * by the script:
     10  *	NetBSD: vnode_if.sh,v 1.55 2010/04/14 12:19:50 pooka Exp
     11  */
     12 
     13 /*
     14  * Copyright (c) 1992, 1993, 1994, 1995
     15  *	The Regents of the University of California.  All rights reserved.
     16  *
     17  * Redistribution and use in source and binary forms, with or without
     18  * modification, are permitted provided that the following conditions
     19  * are met:
     20  * 1. Redistributions of source code must retain the above copyright
     21  *    notice, this list of conditions and the following disclaimer.
     22  * 2. Redistributions in binary form must reproduce the above copyright
     23  *    notice, this list of conditions and the following disclaimer in the
     24  *    documentation and/or other materials provided with the distribution.
     25  * 3. Neither the name of the University nor the names of its contributors
     26  *    may be used to endorse or promote products derived from this software
     27  *    without specific prior written permission.
     28  *
     29  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     30  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     31  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     32  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     33  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     34  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     35  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     39  * SUCH DAMAGE.
     40  */
     41 
     42 #include <sys/cdefs.h>
     43 __KERNEL_RCSID(0, "$NetBSD: rumpvnode_if.c,v 1.3.4.1 2010/05/30 05:18:07 rmind Exp $");
     44 
     45 #include <sys/param.h>
     46 #include <sys/mount.h>
     47 #include <sys/buf.h>
     48 #include <sys/vnode.h>
     49 #include <sys/lock.h>
     50 #include <rump/rumpvnode_if.h>
     51 #include "rump_private.h"
     52 
     53 /* Special cases: */
     54 
     55 int
     56 RUMP_VOP_BWRITE(struct buf *bp)
     57 {
     58 	int error;
     59 
     60 	rump_schedule();
     61 	error = VOP_BWRITE(bp);
     62 	rump_unschedule();
     63 
     64 	return error;
     65 }
     66 
     67 /* End of special cases */
     68 
     69 int
     70 RUMP_VOP_LOOKUP(struct vnode *dvp,
     71     struct vnode **vpp,
     72     struct componentname *cnp)
     73 {
     74 	int error;
     75 
     76 	rump_schedule();
     77 	error = VOP_LOOKUP(dvp, vpp, cnp);
     78 	rump_unschedule();
     79 
     80 	return error;
     81 }
     82 
     83 int
     84 RUMP_VOP_CREATE(struct vnode *dvp,
     85     struct vnode **vpp,
     86     struct componentname *cnp,
     87     struct vattr *vap)
     88 {
     89 	int error;
     90 
     91 	rump_schedule();
     92 	error = VOP_CREATE(dvp, vpp, cnp, vap);
     93 	rump_unschedule();
     94 
     95 	return error;
     96 }
     97 
     98 int
     99 RUMP_VOP_MKNOD(struct vnode *dvp,
    100     struct vnode **vpp,
    101     struct componentname *cnp,
    102     struct vattr *vap)
    103 {
    104 	int error;
    105 
    106 	rump_schedule();
    107 	error = VOP_MKNOD(dvp, vpp, cnp, vap);
    108 	rump_unschedule();
    109 
    110 	return error;
    111 }
    112 
    113 int
    114 RUMP_VOP_OPEN(struct vnode *vp,
    115     int mode,
    116     struct kauth_cred *cred)
    117 {
    118 	int error;
    119 
    120 	rump_schedule();
    121 	error = VOP_OPEN(vp, mode, cred);
    122 	rump_unschedule();
    123 
    124 	return error;
    125 }
    126 
    127 int
    128 RUMP_VOP_CLOSE(struct vnode *vp,
    129     int fflag,
    130     struct kauth_cred *cred)
    131 {
    132 	int error;
    133 
    134 	rump_schedule();
    135 	error = VOP_CLOSE(vp, fflag, cred);
    136 	rump_unschedule();
    137 
    138 	return error;
    139 }
    140 
    141 int
    142 RUMP_VOP_ACCESS(struct vnode *vp,
    143     int mode,
    144     struct kauth_cred *cred)
    145 {
    146 	int error;
    147 
    148 	rump_schedule();
    149 	error = VOP_ACCESS(vp, mode, cred);
    150 	rump_unschedule();
    151 
    152 	return error;
    153 }
    154 
    155 int
    156 RUMP_VOP_GETATTR(struct vnode *vp,
    157     struct vattr *vap,
    158     struct kauth_cred *cred)
    159 {
    160 	int error;
    161 
    162 	rump_schedule();
    163 	error = VOP_GETATTR(vp, vap, cred);
    164 	rump_unschedule();
    165 
    166 	return error;
    167 }
    168 
    169 int
    170 RUMP_VOP_SETATTR(struct vnode *vp,
    171     struct vattr *vap,
    172     struct kauth_cred *cred)
    173 {
    174 	int error;
    175 
    176 	rump_schedule();
    177 	error = VOP_SETATTR(vp, vap, cred);
    178 	rump_unschedule();
    179 
    180 	return error;
    181 }
    182 
    183 int
    184 RUMP_VOP_READ(struct vnode *vp,
    185     struct uio *uio,
    186     int ioflag,
    187     struct kauth_cred *cred)
    188 {
    189 	int error;
    190 
    191 	rump_schedule();
    192 	error = VOP_READ(vp, uio, ioflag, cred);
    193 	rump_unschedule();
    194 
    195 	return error;
    196 }
    197 
    198 int
    199 RUMP_VOP_WRITE(struct vnode *vp,
    200     struct uio *uio,
    201     int ioflag,
    202     struct kauth_cred *cred)
    203 {
    204 	int error;
    205 
    206 	rump_schedule();
    207 	error = VOP_WRITE(vp, uio, ioflag, cred);
    208 	rump_unschedule();
    209 
    210 	return error;
    211 }
    212 
    213 int
    214 RUMP_VOP_IOCTL(struct vnode *vp,
    215     u_long command,
    216     void *data,
    217     int fflag,
    218     struct kauth_cred *cred)
    219 {
    220 	int error;
    221 
    222 	rump_schedule();
    223 	error = VOP_IOCTL(vp, command, data, fflag, cred);
    224 	rump_unschedule();
    225 
    226 	return error;
    227 }
    228 
    229 int
    230 RUMP_VOP_FCNTL(struct vnode *vp,
    231     u_int command,
    232     void *data,
    233     int fflag,
    234     struct kauth_cred *cred)
    235 {
    236 	int error;
    237 
    238 	rump_schedule();
    239 	error = VOP_FCNTL(vp, command, data, fflag, cred);
    240 	rump_unschedule();
    241 
    242 	return error;
    243 }
    244 
    245 int
    246 RUMP_VOP_POLL(struct vnode *vp,
    247     int events)
    248 {
    249 	int error;
    250 
    251 	rump_schedule();
    252 	error = VOP_POLL(vp, events);
    253 	rump_unschedule();
    254 
    255 	return error;
    256 }
    257 
    258 int
    259 RUMP_VOP_KQFILTER(struct vnode *vp,
    260     struct knote *kn)
    261 {
    262 	int error;
    263 
    264 	rump_schedule();
    265 	error = VOP_KQFILTER(vp, kn);
    266 	rump_unschedule();
    267 
    268 	return error;
    269 }
    270 
    271 int
    272 RUMP_VOP_REVOKE(struct vnode *vp,
    273     int flags)
    274 {
    275 	int error;
    276 
    277 	rump_schedule();
    278 	error = VOP_REVOKE(vp, flags);
    279 	rump_unschedule();
    280 
    281 	return error;
    282 }
    283 
    284 int
    285 RUMP_VOP_MMAP(struct vnode *vp,
    286     int prot,
    287     struct kauth_cred *cred)
    288 {
    289 	int error;
    290 
    291 	rump_schedule();
    292 	error = VOP_MMAP(vp, prot, cred);
    293 	rump_unschedule();
    294 
    295 	return error;
    296 }
    297 
    298 int
    299 RUMP_VOP_FSYNC(struct vnode *vp,
    300     struct kauth_cred *cred,
    301     int flags,
    302     off_t offlo,
    303     off_t offhi)
    304 {
    305 	int error;
    306 
    307 	rump_schedule();
    308 	error = VOP_FSYNC(vp, cred, flags, offlo, offhi);
    309 	rump_unschedule();
    310 
    311 	return error;
    312 }
    313 
    314 int
    315 RUMP_VOP_SEEK(struct vnode *vp,
    316     off_t oldoff,
    317     off_t newoff,
    318     struct kauth_cred *cred)
    319 {
    320 	int error;
    321 
    322 	rump_schedule();
    323 	error = VOP_SEEK(vp, oldoff, newoff, cred);
    324 	rump_unschedule();
    325 
    326 	return error;
    327 }
    328 
    329 int
    330 RUMP_VOP_REMOVE(struct vnode *dvp,
    331     struct vnode *vp,
    332     struct componentname *cnp)
    333 {
    334 	int error;
    335 
    336 	rump_schedule();
    337 	error = VOP_REMOVE(dvp, vp, cnp);
    338 	rump_unschedule();
    339 
    340 	return error;
    341 }
    342 
    343 int
    344 RUMP_VOP_LINK(struct vnode *dvp,
    345     struct vnode *vp,
    346     struct componentname *cnp)
    347 {
    348 	int error;
    349 
    350 	rump_schedule();
    351 	error = VOP_LINK(dvp, vp, cnp);
    352 	rump_unschedule();
    353 
    354 	return error;
    355 }
    356 
    357 int
    358 RUMP_VOP_RENAME(struct vnode *fdvp,
    359     struct vnode *fvp,
    360     struct componentname *fcnp,
    361     struct vnode *tdvp,
    362     struct vnode *tvp,
    363     struct componentname *tcnp)
    364 {
    365 	int error;
    366 
    367 	rump_schedule();
    368 	error = VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp);
    369 	rump_unschedule();
    370 
    371 	return error;
    372 }
    373 
    374 int
    375 RUMP_VOP_MKDIR(struct vnode *dvp,
    376     struct vnode **vpp,
    377     struct componentname *cnp,
    378     struct vattr *vap)
    379 {
    380 	int error;
    381 
    382 	rump_schedule();
    383 	error = VOP_MKDIR(dvp, vpp, cnp, vap);
    384 	rump_unschedule();
    385 
    386 	return error;
    387 }
    388 
    389 int
    390 RUMP_VOP_RMDIR(struct vnode *dvp,
    391     struct vnode *vp,
    392     struct componentname *cnp)
    393 {
    394 	int error;
    395 
    396 	rump_schedule();
    397 	error = VOP_RMDIR(dvp, vp, cnp);
    398 	rump_unschedule();
    399 
    400 	return error;
    401 }
    402 
    403 int
    404 RUMP_VOP_SYMLINK(struct vnode *dvp,
    405     struct vnode **vpp,
    406     struct componentname *cnp,
    407     struct vattr *vap,
    408     char *target)
    409 {
    410 	int error;
    411 
    412 	rump_schedule();
    413 	error = VOP_SYMLINK(dvp, vpp, cnp, vap, target);
    414 	rump_unschedule();
    415 
    416 	return error;
    417 }
    418 
    419 int
    420 RUMP_VOP_READDIR(struct vnode *vp,
    421     struct uio *uio,
    422     struct kauth_cred *cred,
    423     int *eofflag,
    424     off_t **cookies,
    425     int *ncookies)
    426 {
    427 	int error;
    428 
    429 	rump_schedule();
    430 	error = VOP_READDIR(vp, uio, cred, eofflag, cookies, ncookies);
    431 	rump_unschedule();
    432 
    433 	return error;
    434 }
    435 
    436 int
    437 RUMP_VOP_READLINK(struct vnode *vp,
    438     struct uio *uio,
    439     struct kauth_cred *cred)
    440 {
    441 	int error;
    442 
    443 	rump_schedule();
    444 	error = VOP_READLINK(vp, uio, cred);
    445 	rump_unschedule();
    446 
    447 	return error;
    448 }
    449 
    450 int
    451 RUMP_VOP_ABORTOP(struct vnode *dvp,
    452     struct componentname *cnp)
    453 {
    454 	int error;
    455 
    456 	rump_schedule();
    457 	error = VOP_ABORTOP(dvp, cnp);
    458 	rump_unschedule();
    459 
    460 	return error;
    461 }
    462 
    463 int
    464 RUMP_VOP_INACTIVE(struct vnode *vp,
    465     bool *recycle)
    466 {
    467 	int error;
    468 
    469 	rump_schedule();
    470 	error = VOP_INACTIVE(vp, recycle);
    471 	rump_unschedule();
    472 
    473 	return error;
    474 }
    475 
    476 int
    477 RUMP_VOP_RECLAIM(struct vnode *vp)
    478 {
    479 	int error;
    480 
    481 	rump_schedule();
    482 	error = VOP_RECLAIM(vp);
    483 	rump_unschedule();
    484 
    485 	return error;
    486 }
    487 
    488 int
    489 RUMP_VOP_LOCK(struct vnode *vp,
    490     int flags)
    491 {
    492 	int error;
    493 
    494 	rump_schedule();
    495 	error = VOP_LOCK(vp, flags);
    496 	rump_unschedule();
    497 
    498 	return error;
    499 }
    500 
    501 int
    502 RUMP_VOP_UNLOCK(struct vnode *vp,
    503     int flags)
    504 {
    505 	int error;
    506 
    507 	rump_schedule();
    508 	error = VOP_UNLOCK(vp, flags);
    509 	rump_unschedule();
    510 
    511 	return error;
    512 }
    513 
    514 int
    515 RUMP_VOP_BMAP(struct vnode *vp,
    516     daddr_t bn,
    517     struct vnode **vpp,
    518     daddr_t *bnp,
    519     int *runp)
    520 {
    521 	int error;
    522 
    523 	rump_schedule();
    524 	error = VOP_BMAP(vp, bn, vpp, bnp, runp);
    525 	rump_unschedule();
    526 
    527 	return error;
    528 }
    529 
    530 int
    531 RUMP_VOP_STRATEGY(struct vnode *vp,
    532     struct buf *bp)
    533 {
    534 	int error;
    535 
    536 	rump_schedule();
    537 	error = VOP_STRATEGY(vp, bp);
    538 	rump_unschedule();
    539 
    540 	return error;
    541 }
    542 
    543 int
    544 RUMP_VOP_PRINT(struct vnode *vp)
    545 {
    546 	int error;
    547 
    548 	rump_schedule();
    549 	error = VOP_PRINT(vp);
    550 	rump_unschedule();
    551 
    552 	return error;
    553 }
    554 
    555 int
    556 RUMP_VOP_ISLOCKED(struct vnode *vp)
    557 {
    558 	int error;
    559 
    560 	rump_schedule();
    561 	error = VOP_ISLOCKED(vp);
    562 	rump_unschedule();
    563 
    564 	return error;
    565 }
    566 
    567 int
    568 RUMP_VOP_PATHCONF(struct vnode *vp,
    569     int name,
    570     register_t *retval)
    571 {
    572 	int error;
    573 
    574 	rump_schedule();
    575 	error = VOP_PATHCONF(vp, name, retval);
    576 	rump_unschedule();
    577 
    578 	return error;
    579 }
    580 
    581 int
    582 RUMP_VOP_ADVLOCK(struct vnode *vp,
    583     void *id,
    584     int op,
    585     struct flock *fl,
    586     int flags)
    587 {
    588 	int error;
    589 
    590 	rump_schedule();
    591 	error = VOP_ADVLOCK(vp, id, op, fl, flags);
    592 	rump_unschedule();
    593 
    594 	return error;
    595 }
    596 
    597 int
    598 RUMP_VOP_WHITEOUT(struct vnode *dvp,
    599     struct componentname *cnp,
    600     int flags)
    601 {
    602 	int error;
    603 
    604 	rump_schedule();
    605 	error = VOP_WHITEOUT(dvp, cnp, flags);
    606 	rump_unschedule();
    607 
    608 	return error;
    609 }
    610 
    611 int
    612 RUMP_VOP_GETPAGES(struct vnode *vp,
    613     off_t offset,
    614     struct vm_page **m,
    615     int *count,
    616     int centeridx,
    617     int access_type,
    618     int advice,
    619     int flags)
    620 {
    621 	int error;
    622 
    623 	rump_schedule();
    624 	error = VOP_GETPAGES(vp, offset, m, count, centeridx, access_type, advice, flags);
    625 	rump_unschedule();
    626 
    627 	return error;
    628 }
    629 
    630 int
    631 RUMP_VOP_PUTPAGES(struct vnode *vp,
    632     off_t offlo,
    633     off_t offhi,
    634     int flags)
    635 {
    636 	int error;
    637 
    638 	rump_schedule();
    639 	error = VOP_PUTPAGES(vp, offlo, offhi, flags);
    640 	rump_unschedule();
    641 
    642 	return error;
    643 }
    644 
    645 int
    646 RUMP_VOP_CLOSEEXTATTR(struct vnode *vp,
    647     int commit,
    648     struct kauth_cred *cred)
    649 {
    650 	int error;
    651 
    652 	rump_schedule();
    653 	error = VOP_CLOSEEXTATTR(vp, commit, cred);
    654 	rump_unschedule();
    655 
    656 	return error;
    657 }
    658 
    659 int
    660 RUMP_VOP_GETEXTATTR(struct vnode *vp,
    661     int attrnamespace,
    662     const char *name,
    663     struct uio *uio,
    664     size_t *size,
    665     struct kauth_cred *cred)
    666 {
    667 	int error;
    668 
    669 	rump_schedule();
    670 	error = VOP_GETEXTATTR(vp, attrnamespace, name, uio, size, cred);
    671 	rump_unschedule();
    672 
    673 	return error;
    674 }
    675 
    676 int
    677 RUMP_VOP_LISTEXTATTR(struct vnode *vp,
    678     int attrnamespace,
    679     struct uio *uio,
    680     size_t *size,
    681     struct kauth_cred *cred)
    682 {
    683 	int error;
    684 
    685 	rump_schedule();
    686 	error = VOP_LISTEXTATTR(vp, attrnamespace, uio, size, cred);
    687 	rump_unschedule();
    688 
    689 	return error;
    690 }
    691 
    692 int
    693 RUMP_VOP_OPENEXTATTR(struct vnode *vp,
    694     struct kauth_cred *cred)
    695 {
    696 	int error;
    697 
    698 	rump_schedule();
    699 	error = VOP_OPENEXTATTR(vp, cred);
    700 	rump_unschedule();
    701 
    702 	return error;
    703 }
    704 
    705 int
    706 RUMP_VOP_DELETEEXTATTR(struct vnode *vp,
    707     int attrnamespace,
    708     const char *name,
    709     struct kauth_cred *cred)
    710 {
    711 	int error;
    712 
    713 	rump_schedule();
    714 	error = VOP_DELETEEXTATTR(vp, attrnamespace, name, cred);
    715 	rump_unschedule();
    716 
    717 	return error;
    718 }
    719 
    720 int
    721 RUMP_VOP_SETEXTATTR(struct vnode *vp,
    722     int attrnamespace,
    723     const char *name,
    724     struct uio *uio,
    725     struct kauth_cred *cred)
    726 {
    727 	int error;
    728 
    729 	rump_schedule();
    730 	error = VOP_SETEXTATTR(vp, attrnamespace, name, uio, cred);
    731 	rump_unschedule();
    732 
    733 	return error;
    734 }
    735