Home | History | Annotate | Line # | Download | only in rumpvfs
rumpvnode_if.c revision 1.10
      1 /*	$NetBSD: rumpvnode_if.c,v 1.10 2011/07/11 08:27:39 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.62 2011/07/11 08:23:00 hannken Exp
      9  * by the script:
     10  *	NetBSD: vnode_if.sh,v 1.58 2011/07/11 08:23:00 hannken 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.10 2011/07/11 08:27:39 hannken 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 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     int mode,
    141     struct kauth_cred *cred)
    142 {
    143 	int error;
    144 
    145 	rump_schedule();
    146 	error = VOP_ACCESS(vp, mode, cred);
    147 	rump_unschedule();
    148 
    149 	return error;
    150 }
    151 
    152 int
    153 RUMP_VOP_GETATTR(struct vnode *vp,
    154     struct vattr *vap,
    155     struct kauth_cred *cred)
    156 {
    157 	int error;
    158 
    159 	rump_schedule();
    160 	error = VOP_GETATTR(vp, vap, cred);
    161 	rump_unschedule();
    162 
    163 	return error;
    164 }
    165 
    166 int
    167 RUMP_VOP_SETATTR(struct vnode *vp,
    168     struct vattr *vap,
    169     struct kauth_cred *cred)
    170 {
    171 	int error;
    172 
    173 	rump_schedule();
    174 	error = VOP_SETATTR(vp, vap, cred);
    175 	rump_unschedule();
    176 
    177 	return error;
    178 }
    179 
    180 int
    181 RUMP_VOP_READ(struct vnode *vp,
    182     struct uio *uio,
    183     int ioflag,
    184     struct kauth_cred *cred)
    185 {
    186 	int error;
    187 
    188 	rump_schedule();
    189 	error = VOP_READ(vp, uio, ioflag, cred);
    190 	rump_unschedule();
    191 
    192 	return error;
    193 }
    194 
    195 int
    196 RUMP_VOP_WRITE(struct vnode *vp,
    197     struct uio *uio,
    198     int ioflag,
    199     struct kauth_cred *cred)
    200 {
    201 	int error;
    202 
    203 	rump_schedule();
    204 	error = VOP_WRITE(vp, uio, ioflag, cred);
    205 	rump_unschedule();
    206 
    207 	return error;
    208 }
    209 
    210 int
    211 RUMP_VOP_IOCTL(struct vnode *vp,
    212     u_long command,
    213     void *data,
    214     int fflag,
    215     struct kauth_cred *cred)
    216 {
    217 	int error;
    218 
    219 	rump_schedule();
    220 	error = VOP_IOCTL(vp, command, data, fflag, cred);
    221 	rump_unschedule();
    222 
    223 	return error;
    224 }
    225 
    226 int
    227 RUMP_VOP_FCNTL(struct vnode *vp,
    228     u_int command,
    229     void *data,
    230     int fflag,
    231     struct kauth_cred *cred)
    232 {
    233 	int error;
    234 
    235 	rump_schedule();
    236 	error = VOP_FCNTL(vp, command, data, fflag, cred);
    237 	rump_unschedule();
    238 
    239 	return error;
    240 }
    241 
    242 int
    243 RUMP_VOP_POLL(struct vnode *vp,
    244     int events)
    245 {
    246 	int error;
    247 
    248 	rump_schedule();
    249 	error = VOP_POLL(vp, events);
    250 	rump_unschedule();
    251 
    252 	return error;
    253 }
    254 
    255 int
    256 RUMP_VOP_KQFILTER(struct vnode *vp,
    257     struct knote *kn)
    258 {
    259 	int error;
    260 
    261 	rump_schedule();
    262 	error = VOP_KQFILTER(vp, kn);
    263 	rump_unschedule();
    264 
    265 	return error;
    266 }
    267 
    268 int
    269 RUMP_VOP_REVOKE(struct vnode *vp,
    270     int flags)
    271 {
    272 	int error;
    273 
    274 	rump_schedule();
    275 	error = VOP_REVOKE(vp, flags);
    276 	rump_unschedule();
    277 
    278 	return error;
    279 }
    280 
    281 int
    282 RUMP_VOP_MMAP(struct vnode *vp,
    283     int prot,
    284     struct kauth_cred *cred)
    285 {
    286 	int error;
    287 
    288 	rump_schedule();
    289 	error = VOP_MMAP(vp, prot, cred);
    290 	rump_unschedule();
    291 
    292 	return error;
    293 }
    294 
    295 int
    296 RUMP_VOP_FSYNC(struct vnode *vp,
    297     struct kauth_cred *cred,
    298     int flags,
    299     off_t offlo,
    300     off_t offhi)
    301 {
    302 	int error;
    303 
    304 	rump_schedule();
    305 	error = VOP_FSYNC(vp, cred, flags, offlo, offhi);
    306 	rump_unschedule();
    307 
    308 	return error;
    309 }
    310 
    311 int
    312 RUMP_VOP_SEEK(struct vnode *vp,
    313     off_t oldoff,
    314     off_t newoff,
    315     struct kauth_cred *cred)
    316 {
    317 	int error;
    318 
    319 	rump_schedule();
    320 	error = VOP_SEEK(vp, oldoff, newoff, cred);
    321 	rump_unschedule();
    322 
    323 	return error;
    324 }
    325 
    326 int
    327 RUMP_VOP_REMOVE(struct vnode *dvp,
    328     struct vnode *vp,
    329     struct componentname *cnp)
    330 {
    331 	int error;
    332 
    333 	rump_schedule();
    334 	error = VOP_REMOVE(dvp, vp, cnp);
    335 	rump_unschedule();
    336 
    337 	return error;
    338 }
    339 
    340 int
    341 RUMP_VOP_LINK(struct vnode *dvp,
    342     struct vnode *vp,
    343     struct componentname *cnp)
    344 {
    345 	int error;
    346 
    347 	rump_schedule();
    348 	error = VOP_LINK(dvp, vp, cnp);
    349 	rump_unschedule();
    350 
    351 	return error;
    352 }
    353 
    354 int
    355 RUMP_VOP_RENAME(struct vnode *fdvp,
    356     struct vnode *fvp,
    357     struct componentname *fcnp,
    358     struct vnode *tdvp,
    359     struct vnode *tvp,
    360     struct componentname *tcnp)
    361 {
    362 	int error;
    363 
    364 	rump_schedule();
    365 	error = VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp);
    366 	rump_unschedule();
    367 
    368 	return error;
    369 }
    370 
    371 int
    372 RUMP_VOP_MKDIR(struct vnode *dvp,
    373     struct vnode **vpp,
    374     struct componentname *cnp,
    375     struct vattr *vap)
    376 {
    377 	int error;
    378 
    379 	rump_schedule();
    380 	error = VOP_MKDIR(dvp, vpp, cnp, vap);
    381 	rump_unschedule();
    382 
    383 	return error;
    384 }
    385 
    386 int
    387 RUMP_VOP_RMDIR(struct vnode *dvp,
    388     struct vnode *vp,
    389     struct componentname *cnp)
    390 {
    391 	int error;
    392 
    393 	rump_schedule();
    394 	error = VOP_RMDIR(dvp, vp, cnp);
    395 	rump_unschedule();
    396 
    397 	return error;
    398 }
    399 
    400 int
    401 RUMP_VOP_SYMLINK(struct vnode *dvp,
    402     struct vnode **vpp,
    403     struct componentname *cnp,
    404     struct vattr *vap,
    405     char *target)
    406 {
    407 	int error;
    408 
    409 	rump_schedule();
    410 	error = VOP_SYMLINK(dvp, vpp, cnp, vap, target);
    411 	rump_unschedule();
    412 
    413 	return error;
    414 }
    415 
    416 int
    417 RUMP_VOP_READDIR(struct vnode *vp,
    418     struct uio *uio,
    419     struct kauth_cred *cred,
    420     int *eofflag,
    421     off_t **cookies,
    422     int *ncookies)
    423 {
    424 	int error;
    425 
    426 	rump_schedule();
    427 	error = VOP_READDIR(vp, uio, cred, eofflag, cookies, ncookies);
    428 	rump_unschedule();
    429 
    430 	return error;
    431 }
    432 
    433 int
    434 RUMP_VOP_READLINK(struct vnode *vp,
    435     struct uio *uio,
    436     struct kauth_cred *cred)
    437 {
    438 	int error;
    439 
    440 	rump_schedule();
    441 	error = VOP_READLINK(vp, uio, cred);
    442 	rump_unschedule();
    443 
    444 	return error;
    445 }
    446 
    447 int
    448 RUMP_VOP_ABORTOP(struct vnode *dvp,
    449     struct componentname *cnp)
    450 {
    451 	int error;
    452 
    453 	rump_schedule();
    454 	error = VOP_ABORTOP(dvp, cnp);
    455 	rump_unschedule();
    456 
    457 	return error;
    458 }
    459 
    460 int
    461 RUMP_VOP_INACTIVE(struct vnode *vp,
    462     bool *recycle)
    463 {
    464 	int error;
    465 
    466 	rump_schedule();
    467 	error = VOP_INACTIVE(vp, recycle);
    468 	rump_unschedule();
    469 
    470 	return error;
    471 }
    472 
    473 int
    474 RUMP_VOP_RECLAIM(struct vnode *vp)
    475 {
    476 	int error;
    477 
    478 	rump_schedule();
    479 	error = VOP_RECLAIM(vp);
    480 	rump_unschedule();
    481 
    482 	return error;
    483 }
    484 
    485 int
    486 RUMP_VOP_LOCK(struct vnode *vp,
    487     int flags)
    488 {
    489 	int error;
    490 
    491 	rump_schedule();
    492 	error = VOP_LOCK(vp, flags);
    493 	rump_unschedule();
    494 
    495 	return error;
    496 }
    497 
    498 int
    499 RUMP_VOP_UNLOCK(struct vnode *vp)
    500 {
    501 	int error;
    502 
    503 	rump_schedule();
    504 	error = VOP_UNLOCK(vp);
    505 	rump_unschedule();
    506 
    507 	return error;
    508 }
    509 
    510 int
    511 RUMP_VOP_BMAP(struct vnode *vp,
    512     daddr_t bn,
    513     struct vnode **vpp,
    514     daddr_t *bnp,
    515     int *runp)
    516 {
    517 	int error;
    518 
    519 	rump_schedule();
    520 	error = VOP_BMAP(vp, bn, vpp, bnp, runp);
    521 	rump_unschedule();
    522 
    523 	return error;
    524 }
    525 
    526 int
    527 RUMP_VOP_STRATEGY(struct vnode *vp,
    528     struct buf *bp)
    529 {
    530 	int error;
    531 
    532 	rump_schedule();
    533 	error = VOP_STRATEGY(vp, bp);
    534 	rump_unschedule();
    535 
    536 	return error;
    537 }
    538 
    539 int
    540 RUMP_VOP_PRINT(struct vnode *vp)
    541 {
    542 	int error;
    543 
    544 	rump_schedule();
    545 	error = VOP_PRINT(vp);
    546 	rump_unschedule();
    547 
    548 	return error;
    549 }
    550 
    551 int
    552 RUMP_VOP_ISLOCKED(struct vnode *vp)
    553 {
    554 	int error;
    555 
    556 	rump_schedule();
    557 	error = VOP_ISLOCKED(vp);
    558 	rump_unschedule();
    559 
    560 	return error;
    561 }
    562 
    563 int
    564 RUMP_VOP_PATHCONF(struct vnode *vp,
    565     int name,
    566     register_t *retval)
    567 {
    568 	int error;
    569 
    570 	rump_schedule();
    571 	error = VOP_PATHCONF(vp, name, retval);
    572 	rump_unschedule();
    573 
    574 	return error;
    575 }
    576 
    577 int
    578 RUMP_VOP_ADVLOCK(struct vnode *vp,
    579     void *id,
    580     int op,
    581     struct flock *fl,
    582     int flags)
    583 {
    584 	int error;
    585 
    586 	rump_schedule();
    587 	error = VOP_ADVLOCK(vp, id, op, fl, flags);
    588 	rump_unschedule();
    589 
    590 	return error;
    591 }
    592 
    593 int
    594 RUMP_VOP_WHITEOUT(struct vnode *dvp,
    595     struct componentname *cnp,
    596     int flags)
    597 {
    598 	int error;
    599 
    600 	rump_schedule();
    601 	error = VOP_WHITEOUT(dvp, cnp, flags);
    602 	rump_unschedule();
    603 
    604 	return error;
    605 }
    606 
    607 int
    608 RUMP_VOP_GETPAGES(struct vnode *vp,
    609     off_t offset,
    610     struct vm_page **m,
    611     int *count,
    612     int centeridx,
    613     int access_type,
    614     int advice,
    615     int flags)
    616 {
    617 	int error;
    618 
    619 	rump_schedule();
    620 	error = VOP_GETPAGES(vp, offset, m, count, centeridx, access_type, advice, flags);
    621 	rump_unschedule();
    622 
    623 	return error;
    624 }
    625 
    626 int
    627 RUMP_VOP_PUTPAGES(struct vnode *vp,
    628     off_t offlo,
    629     off_t offhi,
    630     int flags)
    631 {
    632 	int error;
    633 
    634 	rump_schedule();
    635 	error = VOP_PUTPAGES(vp, offlo, offhi, flags);
    636 	rump_unschedule();
    637 
    638 	return error;
    639 }
    640 
    641 int
    642 RUMP_VOP_CLOSEEXTATTR(struct vnode *vp,
    643     int commit,
    644     struct kauth_cred *cred)
    645 {
    646 	int error;
    647 
    648 	rump_schedule();
    649 	error = VOP_CLOSEEXTATTR(vp, commit, cred);
    650 	rump_unschedule();
    651 
    652 	return error;
    653 }
    654 
    655 int
    656 RUMP_VOP_GETEXTATTR(struct vnode *vp,
    657     int attrnamespace,
    658     const char *name,
    659     struct uio *uio,
    660     size_t *size,
    661     struct kauth_cred *cred)
    662 {
    663 	int error;
    664 
    665 	rump_schedule();
    666 	error = VOP_GETEXTATTR(vp, attrnamespace, name, uio, size, cred);
    667 	rump_unschedule();
    668 
    669 	return error;
    670 }
    671 
    672 int
    673 RUMP_VOP_LISTEXTATTR(struct vnode *vp,
    674     int attrnamespace,
    675     struct uio *uio,
    676     size_t *size,
    677     int flag,
    678     struct kauth_cred *cred)
    679 {
    680 	int error;
    681 
    682 	rump_schedule();
    683 	error = VOP_LISTEXTATTR(vp, attrnamespace, uio, size, flag, cred);
    684 	rump_unschedule();
    685 
    686 	return error;
    687 }
    688 
    689 int
    690 RUMP_VOP_OPENEXTATTR(struct vnode *vp,
    691     struct kauth_cred *cred)
    692 {
    693 	int error;
    694 
    695 	rump_schedule();
    696 	error = VOP_OPENEXTATTR(vp, cred);
    697 	rump_unschedule();
    698 
    699 	return error;
    700 }
    701 
    702 int
    703 RUMP_VOP_DELETEEXTATTR(struct vnode *vp,
    704     int attrnamespace,
    705     const char *name,
    706     struct kauth_cred *cred)
    707 {
    708 	int error;
    709 
    710 	rump_schedule();
    711 	error = VOP_DELETEEXTATTR(vp, attrnamespace, name, cred);
    712 	rump_unschedule();
    713 
    714 	return error;
    715 }
    716 
    717 int
    718 RUMP_VOP_SETEXTATTR(struct vnode *vp,
    719     int attrnamespace,
    720     const char *name,
    721     struct uio *uio,
    722     struct kauth_cred *cred)
    723 {
    724 	int error;
    725 
    726 	rump_schedule();
    727 	error = VOP_SETEXTATTR(vp, attrnamespace, name, uio, cred);
    728 	rump_unschedule();
    729 
    730 	return error;
    731 }
    732