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