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