Home | History | Annotate | Line # | Download | only in rumpvfs
rumpvnode_if.c revision 1.36
      1 /*	$NetBSD: rumpvnode_if.c,v 1.36 2021/07/02 16:57:16 dholland 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.82 2021/07/02 16:56:22 dholland Exp
      9  * by the script:
     10  *	NetBSD: vnode_if.sh,v 1.70 2020/05/16 18:31:50 christos 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.36 2021/07/02 16:57:16 dholland 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-sys/kern.h>
     52 
     53 int
     54 RUMP_VOP_BWRITE(struct vnode *vp,
     55     struct buf *bp)
     56 {
     57 	int error;
     58 
     59 	rump_schedule();
     60 	error = VOP_BWRITE(vp, bp);
     61 	rump_unschedule();
     62 
     63 	return error;
     64 }
     65 
     66 int
     67 RUMP_VOP_PARSEPATH(struct vnode *dvp,
     68     const char *name,
     69     size_t *retval)
     70 {
     71 	int error;
     72 
     73 	rump_schedule();
     74 	error = VOP_PARSEPATH(dvp, name, retval);
     75 	rump_unschedule();
     76 
     77 	return error;
     78 }
     79 
     80 int
     81 RUMP_VOP_LOOKUP(struct vnode *dvp,
     82     struct vnode **vpp,
     83     struct componentname *cnp)
     84 {
     85 	int error;
     86 
     87 	rump_schedule();
     88 	error = VOP_LOOKUP(dvp, vpp, cnp);
     89 	rump_unschedule();
     90 
     91 	return error;
     92 }
     93 
     94 int
     95 RUMP_VOP_CREATE(struct vnode *dvp,
     96     struct vnode **vpp,
     97     struct componentname *cnp,
     98     struct vattr *vap)
     99 {
    100 	int error;
    101 
    102 	rump_schedule();
    103 	error = VOP_CREATE(dvp, vpp, cnp, vap);
    104 	rump_unschedule();
    105 
    106 	return error;
    107 }
    108 
    109 int
    110 RUMP_VOP_MKNOD(struct vnode *dvp,
    111     struct vnode **vpp,
    112     struct componentname *cnp,
    113     struct vattr *vap)
    114 {
    115 	int error;
    116 
    117 	rump_schedule();
    118 	error = VOP_MKNOD(dvp, vpp, cnp, vap);
    119 	rump_unschedule();
    120 
    121 	return error;
    122 }
    123 
    124 int
    125 RUMP_VOP_OPEN(struct vnode *vp,
    126     int mode,
    127     struct kauth_cred *cred)
    128 {
    129 	int error;
    130 
    131 	rump_schedule();
    132 	error = VOP_OPEN(vp, mode, cred);
    133 	rump_unschedule();
    134 
    135 	return error;
    136 }
    137 
    138 int
    139 RUMP_VOP_CLOSE(struct vnode *vp,
    140     int fflag,
    141     struct kauth_cred *cred)
    142 {
    143 	int error;
    144 
    145 	rump_schedule();
    146 	error = VOP_CLOSE(vp, fflag, cred);
    147 	rump_unschedule();
    148 
    149 	return error;
    150 }
    151 
    152 int
    153 RUMP_VOP_ACCESS(struct vnode *vp,
    154     accmode_t accmode,
    155     struct kauth_cred *cred)
    156 {
    157 	int error;
    158 
    159 	rump_schedule();
    160 	error = VOP_ACCESS(vp, accmode, cred);
    161 	rump_unschedule();
    162 
    163 	return error;
    164 }
    165 
    166 int
    167 RUMP_VOP_ACCESSX(struct vnode *vp,
    168     accmode_t accmode,
    169     struct kauth_cred *cred)
    170 {
    171 	int error;
    172 
    173 	rump_schedule();
    174 	error = VOP_ACCESSX(vp, accmode, cred);
    175 	rump_unschedule();
    176 
    177 	return error;
    178 }
    179 
    180 int
    181 RUMP_VOP_GETATTR(struct vnode *vp,
    182     struct vattr *vap,
    183     struct kauth_cred *cred)
    184 {
    185 	int error;
    186 
    187 	rump_schedule();
    188 	error = VOP_GETATTR(vp, vap, cred);
    189 	rump_unschedule();
    190 
    191 	return error;
    192 }
    193 
    194 int
    195 RUMP_VOP_SETATTR(struct vnode *vp,
    196     struct vattr *vap,
    197     struct kauth_cred *cred)
    198 {
    199 	int error;
    200 
    201 	rump_schedule();
    202 	error = VOP_SETATTR(vp, vap, cred);
    203 	rump_unschedule();
    204 
    205 	return error;
    206 }
    207 
    208 int
    209 RUMP_VOP_READ(struct vnode *vp,
    210     struct uio *uio,
    211     int ioflag,
    212     struct kauth_cred *cred)
    213 {
    214 	int error;
    215 
    216 	rump_schedule();
    217 	error = VOP_READ(vp, uio, ioflag, cred);
    218 	rump_unschedule();
    219 
    220 	return error;
    221 }
    222 
    223 int
    224 RUMP_VOP_WRITE(struct vnode *vp,
    225     struct uio *uio,
    226     int ioflag,
    227     struct kauth_cred *cred)
    228 {
    229 	int error;
    230 
    231 	rump_schedule();
    232 	error = VOP_WRITE(vp, uio, ioflag, cred);
    233 	rump_unschedule();
    234 
    235 	return error;
    236 }
    237 
    238 int
    239 RUMP_VOP_FALLOCATE(struct vnode *vp,
    240     off_t pos,
    241     off_t len)
    242 {
    243 	int error;
    244 
    245 	rump_schedule();
    246 	error = VOP_FALLOCATE(vp, pos, len);
    247 	rump_unschedule();
    248 
    249 	return error;
    250 }
    251 
    252 int
    253 RUMP_VOP_FDISCARD(struct vnode *vp,
    254     off_t pos,
    255     off_t len)
    256 {
    257 	int error;
    258 
    259 	rump_schedule();
    260 	error = VOP_FDISCARD(vp, pos, len);
    261 	rump_unschedule();
    262 
    263 	return error;
    264 }
    265 
    266 int
    267 RUMP_VOP_IOCTL(struct vnode *vp,
    268     u_long command,
    269     void *data,
    270     int fflag,
    271     struct kauth_cred *cred)
    272 {
    273 	int error;
    274 
    275 	rump_schedule();
    276 	error = VOP_IOCTL(vp, command, data, fflag, cred);
    277 	rump_unschedule();
    278 
    279 	return error;
    280 }
    281 
    282 int
    283 RUMP_VOP_FCNTL(struct vnode *vp,
    284     u_int command,
    285     void *data,
    286     int fflag,
    287     struct kauth_cred *cred)
    288 {
    289 	int error;
    290 
    291 	rump_schedule();
    292 	error = VOP_FCNTL(vp, command, data, fflag, cred);
    293 	rump_unschedule();
    294 
    295 	return error;
    296 }
    297 
    298 int
    299 RUMP_VOP_POLL(struct vnode *vp,
    300     int events)
    301 {
    302 	int error;
    303 
    304 	rump_schedule();
    305 	error = VOP_POLL(vp, events);
    306 	rump_unschedule();
    307 
    308 	return error;
    309 }
    310 
    311 int
    312 RUMP_VOP_KQFILTER(struct vnode *vp,
    313     struct knote *kn)
    314 {
    315 	int error;
    316 
    317 	rump_schedule();
    318 	error = VOP_KQFILTER(vp, kn);
    319 	rump_unschedule();
    320 
    321 	return error;
    322 }
    323 
    324 int
    325 RUMP_VOP_REVOKE(struct vnode *vp,
    326     int flags)
    327 {
    328 	int error;
    329 
    330 	rump_schedule();
    331 	error = VOP_REVOKE(vp, flags);
    332 	rump_unschedule();
    333 
    334 	return error;
    335 }
    336 
    337 int
    338 RUMP_VOP_MMAP(struct vnode *vp,
    339     int prot,
    340     struct kauth_cred *cred)
    341 {
    342 	int error;
    343 
    344 	rump_schedule();
    345 	error = VOP_MMAP(vp, prot, cred);
    346 	rump_unschedule();
    347 
    348 	return error;
    349 }
    350 
    351 int
    352 RUMP_VOP_FSYNC(struct vnode *vp,
    353     struct kauth_cred *cred,
    354     int flags,
    355     off_t offlo,
    356     off_t offhi)
    357 {
    358 	int error;
    359 
    360 	rump_schedule();
    361 	error = VOP_FSYNC(vp, cred, flags, offlo, offhi);
    362 	rump_unschedule();
    363 
    364 	return error;
    365 }
    366 
    367 int
    368 RUMP_VOP_SEEK(struct vnode *vp,
    369     off_t oldoff,
    370     off_t newoff,
    371     struct kauth_cred *cred)
    372 {
    373 	int error;
    374 
    375 	rump_schedule();
    376 	error = VOP_SEEK(vp, oldoff, newoff, cred);
    377 	rump_unschedule();
    378 
    379 	return error;
    380 }
    381 
    382 int
    383 RUMP_VOP_REMOVE(struct vnode *dvp,
    384     struct vnode *vp,
    385     struct componentname *cnp)
    386 {
    387 	int error;
    388 
    389 	rump_schedule();
    390 	error = VOP_REMOVE(dvp, vp, cnp);
    391 	rump_unschedule();
    392 
    393 	return error;
    394 }
    395 
    396 int
    397 RUMP_VOP_LINK(struct vnode *dvp,
    398     struct vnode *vp,
    399     struct componentname *cnp)
    400 {
    401 	int error;
    402 
    403 	rump_schedule();
    404 	error = VOP_LINK(dvp, vp, cnp);
    405 	rump_unschedule();
    406 
    407 	return error;
    408 }
    409 
    410 int
    411 RUMP_VOP_RENAME(struct vnode *fdvp,
    412     struct vnode *fvp,
    413     struct componentname *fcnp,
    414     struct vnode *tdvp,
    415     struct vnode *tvp,
    416     struct componentname *tcnp)
    417 {
    418 	int error;
    419 
    420 	rump_schedule();
    421 	error = VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp);
    422 	rump_unschedule();
    423 
    424 	return error;
    425 }
    426 
    427 int
    428 RUMP_VOP_MKDIR(struct vnode *dvp,
    429     struct vnode **vpp,
    430     struct componentname *cnp,
    431     struct vattr *vap)
    432 {
    433 	int error;
    434 
    435 	rump_schedule();
    436 	error = VOP_MKDIR(dvp, vpp, cnp, vap);
    437 	rump_unschedule();
    438 
    439 	return error;
    440 }
    441 
    442 int
    443 RUMP_VOP_RMDIR(struct vnode *dvp,
    444     struct vnode *vp,
    445     struct componentname *cnp)
    446 {
    447 	int error;
    448 
    449 	rump_schedule();
    450 	error = VOP_RMDIR(dvp, vp, cnp);
    451 	rump_unschedule();
    452 
    453 	return error;
    454 }
    455 
    456 int
    457 RUMP_VOP_SYMLINK(struct vnode *dvp,
    458     struct vnode **vpp,
    459     struct componentname *cnp,
    460     struct vattr *vap,
    461     char *target)
    462 {
    463 	int error;
    464 
    465 	rump_schedule();
    466 	error = VOP_SYMLINK(dvp, vpp, cnp, vap, target);
    467 	rump_unschedule();
    468 
    469 	return error;
    470 }
    471 
    472 int
    473 RUMP_VOP_READDIR(struct vnode *vp,
    474     struct uio *uio,
    475     struct kauth_cred *cred,
    476     int *eofflag,
    477     off_t **cookies,
    478     int *ncookies)
    479 {
    480 	int error;
    481 
    482 	rump_schedule();
    483 	error = VOP_READDIR(vp, uio, cred, eofflag, cookies, ncookies);
    484 	rump_unschedule();
    485 
    486 	return error;
    487 }
    488 
    489 int
    490 RUMP_VOP_READLINK(struct vnode *vp,
    491     struct uio *uio,
    492     struct kauth_cred *cred)
    493 {
    494 	int error;
    495 
    496 	rump_schedule();
    497 	error = VOP_READLINK(vp, uio, cred);
    498 	rump_unschedule();
    499 
    500 	return error;
    501 }
    502 
    503 int
    504 RUMP_VOP_ABORTOP(struct vnode *dvp,
    505     struct componentname *cnp)
    506 {
    507 	int error;
    508 
    509 	rump_schedule();
    510 	error = VOP_ABORTOP(dvp, cnp);
    511 	rump_unschedule();
    512 
    513 	return error;
    514 }
    515 
    516 int
    517 RUMP_VOP_INACTIVE(struct vnode *vp,
    518     bool *recycle)
    519 {
    520 	int error;
    521 
    522 	rump_schedule();
    523 	error = VOP_INACTIVE(vp, recycle);
    524 	rump_unschedule();
    525 
    526 	return error;
    527 }
    528 
    529 int
    530 RUMP_VOP_RECLAIM(struct vnode *vp)
    531 {
    532 	int error;
    533 
    534 	rump_schedule();
    535 	error = VOP_RECLAIM(vp);
    536 	rump_unschedule();
    537 
    538 	return error;
    539 }
    540 
    541 int
    542 RUMP_VOP_LOCK(struct vnode *vp,
    543     int flags)
    544 {
    545 	int error;
    546 
    547 	rump_schedule();
    548 	error = VOP_LOCK(vp, flags);
    549 	rump_unschedule();
    550 
    551 	return error;
    552 }
    553 
    554 int
    555 RUMP_VOP_UNLOCK(struct vnode *vp)
    556 {
    557 	int error;
    558 
    559 	rump_schedule();
    560 	error = VOP_UNLOCK(vp);
    561 	rump_unschedule();
    562 
    563 	return error;
    564 }
    565 
    566 int
    567 RUMP_VOP_BMAP(struct vnode *vp,
    568     int64_t bn,
    569     struct vnode **vpp,
    570     int64_t *bnp,
    571     int *runp)
    572 {
    573 	int error;
    574 
    575 	rump_schedule();
    576 	error = VOP_BMAP(vp, bn, vpp, bnp, runp);
    577 	rump_unschedule();
    578 
    579 	return error;
    580 }
    581 
    582 int
    583 RUMP_VOP_STRATEGY(struct vnode *vp,
    584     struct buf *bp)
    585 {
    586 	int error;
    587 
    588 	rump_schedule();
    589 	error = VOP_STRATEGY(vp, bp);
    590 	rump_unschedule();
    591 
    592 	return error;
    593 }
    594 
    595 int
    596 RUMP_VOP_PRINT(struct vnode *vp)
    597 {
    598 	int error;
    599 
    600 	rump_schedule();
    601 	error = VOP_PRINT(vp);
    602 	rump_unschedule();
    603 
    604 	return error;
    605 }
    606 
    607 int
    608 RUMP_VOP_ISLOCKED(struct vnode *vp)
    609 {
    610 	int error;
    611 
    612 	rump_schedule();
    613 	error = VOP_ISLOCKED(vp);
    614 	rump_unschedule();
    615 
    616 	return error;
    617 }
    618 
    619 int
    620 RUMP_VOP_PATHCONF(struct vnode *vp,
    621     int name,
    622     register_t *retval)
    623 {
    624 	int error;
    625 
    626 	rump_schedule();
    627 	error = VOP_PATHCONF(vp, name, retval);
    628 	rump_unschedule();
    629 
    630 	return error;
    631 }
    632 
    633 int
    634 RUMP_VOP_ADVLOCK(struct vnode *vp,
    635     void *id,
    636     int op,
    637     struct flock *fl,
    638     int flags)
    639 {
    640 	int error;
    641 
    642 	rump_schedule();
    643 	error = VOP_ADVLOCK(vp, id, op, fl, flags);
    644 	rump_unschedule();
    645 
    646 	return error;
    647 }
    648 
    649 int
    650 RUMP_VOP_WHITEOUT(struct vnode *dvp,
    651     struct componentname *cnp,
    652     int flags)
    653 {
    654 	int error;
    655 
    656 	rump_schedule();
    657 	error = VOP_WHITEOUT(dvp, cnp, flags);
    658 	rump_unschedule();
    659 
    660 	return error;
    661 }
    662 
    663 int
    664 RUMP_VOP_GETPAGES(struct vnode *vp,
    665     off_t offset,
    666     struct vm_page **m,
    667     int *count,
    668     int centeridx,
    669     int access_type,
    670     int advice,
    671     int flags)
    672 {
    673 	int error;
    674 
    675 	rump_schedule();
    676 	error = VOP_GETPAGES(vp, offset, m, count, centeridx, access_type, advice, flags);
    677 	rump_unschedule();
    678 
    679 	return error;
    680 }
    681 
    682 int
    683 RUMP_VOP_PUTPAGES(struct vnode *vp,
    684     off_t offlo,
    685     off_t offhi,
    686     int flags)
    687 {
    688 	int error;
    689 
    690 	rump_schedule();
    691 	error = VOP_PUTPAGES(vp, offlo, offhi, flags);
    692 	rump_unschedule();
    693 
    694 	return error;
    695 }
    696 
    697 int
    698 RUMP_VOP_GETACL(struct vnode *vp,
    699     acl_type_t type,
    700     struct acl *aclp,
    701     struct kauth_cred *cred)
    702 {
    703 	int error;
    704 
    705 	rump_schedule();
    706 	error = VOP_GETACL(vp, type, aclp, cred);
    707 	rump_unschedule();
    708 
    709 	return error;
    710 }
    711 
    712 int
    713 RUMP_VOP_SETACL(struct vnode *vp,
    714     acl_type_t type,
    715     struct acl *aclp,
    716     struct kauth_cred *cred)
    717 {
    718 	int error;
    719 
    720 	rump_schedule();
    721 	error = VOP_SETACL(vp, type, aclp, cred);
    722 	rump_unschedule();
    723 
    724 	return error;
    725 }
    726 
    727 int
    728 RUMP_VOP_ACLCHECK(struct vnode *vp,
    729     acl_type_t type,
    730     struct acl *aclp,
    731     struct kauth_cred *cred)
    732 {
    733 	int error;
    734 
    735 	rump_schedule();
    736 	error = VOP_ACLCHECK(vp, type, aclp, cred);
    737 	rump_unschedule();
    738 
    739 	return error;
    740 }
    741 
    742 int
    743 RUMP_VOP_CLOSEEXTATTR(struct vnode *vp,
    744     int commit,
    745     struct kauth_cred *cred)
    746 {
    747 	int error;
    748 
    749 	rump_schedule();
    750 	error = VOP_CLOSEEXTATTR(vp, commit, cred);
    751 	rump_unschedule();
    752 
    753 	return error;
    754 }
    755 
    756 int
    757 RUMP_VOP_GETEXTATTR(struct vnode *vp,
    758     int attrnamespace,
    759     const char *name,
    760     struct uio *uio,
    761     size_t *size,
    762     struct kauth_cred *cred)
    763 {
    764 	int error;
    765 
    766 	rump_schedule();
    767 	error = VOP_GETEXTATTR(vp, attrnamespace, name, uio, size, cred);
    768 	rump_unschedule();
    769 
    770 	return error;
    771 }
    772 
    773 int
    774 RUMP_VOP_LISTEXTATTR(struct vnode *vp,
    775     int attrnamespace,
    776     struct uio *uio,
    777     size_t *size,
    778     int flag,
    779     struct kauth_cred *cred)
    780 {
    781 	int error;
    782 
    783 	rump_schedule();
    784 	error = VOP_LISTEXTATTR(vp, attrnamespace, uio, size, flag, cred);
    785 	rump_unschedule();
    786 
    787 	return error;
    788 }
    789 
    790 int
    791 RUMP_VOP_OPENEXTATTR(struct vnode *vp,
    792     struct kauth_cred *cred)
    793 {
    794 	int error;
    795 
    796 	rump_schedule();
    797 	error = VOP_OPENEXTATTR(vp, cred);
    798 	rump_unschedule();
    799 
    800 	return error;
    801 }
    802 
    803 int
    804 RUMP_VOP_DELETEEXTATTR(struct vnode *vp,
    805     int attrnamespace,
    806     const char *name,
    807     struct kauth_cred *cred)
    808 {
    809 	int error;
    810 
    811 	rump_schedule();
    812 	error = VOP_DELETEEXTATTR(vp, attrnamespace, name, cred);
    813 	rump_unschedule();
    814 
    815 	return error;
    816 }
    817 
    818 int
    819 RUMP_VOP_SETEXTATTR(struct vnode *vp,
    820     int attrnamespace,
    821     const char *name,
    822     struct uio *uio,
    823     struct kauth_cred *cred)
    824 {
    825 	int error;
    826 
    827 	rump_schedule();
    828 	error = VOP_SETEXTATTR(vp, attrnamespace, name, uio, cred);
    829 	rump_unschedule();
    830 
    831 	return error;
    832 }
    833