Home | History | Annotate | Line # | Download | only in kern
vnode_if.c revision 1.98
      1 /*	$NetBSD: vnode_if.c,v 1.98 2017/04/11 14:26:13 riastradh 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.71 2017/04/11 14:25:00 riastradh Exp
      9  * by the script:
     10  *	NetBSD: vnode_if.sh,v 1.62 2017/02/22 09:45:51 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: vnode_if.c,v 1.98 2017/04/11 14:26:13 riastradh 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 <sys/fstrans.h>
     51 
     52 const struct vnodeop_desc vop_default_desc = {
     53 	0,
     54 	"default",
     55 	0,
     56 	NULL,
     57 	VDESC_NO_OFFSET,
     58 	VDESC_NO_OFFSET,
     59 	VDESC_NO_OFFSET,
     60 };
     61 
     62 
     63 const int vop_bwrite_vp_offsets[] = {
     64 	VOPARG_OFFSETOF(struct vop_bwrite_args,a_vp),
     65 	VDESC_NO_OFFSET
     66 };
     67 const struct vnodeop_desc vop_bwrite_desc = {
     68 	VOP_BWRITE_DESCOFFSET,
     69 	"vop_bwrite",
     70 	0,
     71 	vop_bwrite_vp_offsets,
     72 	VDESC_NO_OFFSET,
     73 	VDESC_NO_OFFSET,
     74 	VDESC_NO_OFFSET,
     75 };
     76 int
     77 VOP_BWRITE(struct vnode *vp,
     78     struct buf *bp)
     79 {
     80 	int error;
     81 	bool mpsafe;
     82 	struct vop_bwrite_args a;
     83 	struct mount *mp = vp->v_mount;
     84 	a.a_desc = VDESC(vop_bwrite);
     85 	a.a_vp = vp;
     86 	a.a_bp = bp;
     87 	mpsafe = (vp->v_vflag & VV_MPSAFE);
     88 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
     89 	fstrans_start(mp, FSTRANS_SHARED);
     90 	error = (VCALL(vp, VOFFSET(vop_bwrite), &a));
     91 	fstrans_done(mp);
     92 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
     93 	return error;
     94 }
     95 
     96 const int vop_lookup_vp_offsets[] = {
     97 	VOPARG_OFFSETOF(struct vop_lookup_v2_args,a_dvp),
     98 	VDESC_NO_OFFSET
     99 };
    100 const struct vnodeop_desc vop_lookup_desc = {
    101 	VOP_LOOKUP_DESCOFFSET,
    102 	"vop_lookup",
    103 	0,
    104 	vop_lookup_vp_offsets,
    105 	VOPARG_OFFSETOF(struct vop_lookup_v2_args, a_vpp),
    106 	VDESC_NO_OFFSET,
    107 	VOPARG_OFFSETOF(struct vop_lookup_v2_args, a_cnp),
    108 };
    109 int
    110 VOP_LOOKUP(struct vnode *dvp,
    111     struct vnode **vpp,
    112     struct componentname *cnp)
    113 {
    114 	int error;
    115 	bool mpsafe;
    116 	struct vop_lookup_v2_args a;
    117 	a.a_desc = VDESC(vop_lookup);
    118 	a.a_dvp = dvp;
    119 	a.a_vpp = vpp;
    120 	a.a_cnp = cnp;
    121 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    122 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    123 	error = (VCALL(dvp, VOFFSET(vop_lookup), &a));
    124 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    125 #ifdef DIAGNOSTIC
    126 	if (error == 0)
    127 		KASSERT((*vpp)->v_size != VSIZENOTSET
    128 		    && (*vpp)->v_writesize != VSIZENOTSET);
    129 #endif /* DIAGNOSTIC */
    130 	return error;
    131 }
    132 
    133 const int vop_create_vp_offsets[] = {
    134 	VOPARG_OFFSETOF(struct vop_create_v3_args,a_dvp),
    135 	VDESC_NO_OFFSET
    136 };
    137 const struct vnodeop_desc vop_create_desc = {
    138 	VOP_CREATE_DESCOFFSET,
    139 	"vop_create",
    140 	0,
    141 	vop_create_vp_offsets,
    142 	VOPARG_OFFSETOF(struct vop_create_v3_args, a_vpp),
    143 	VDESC_NO_OFFSET,
    144 	VOPARG_OFFSETOF(struct vop_create_v3_args, a_cnp),
    145 };
    146 int
    147 VOP_CREATE(struct vnode *dvp,
    148     struct vnode **vpp,
    149     struct componentname *cnp,
    150     struct vattr *vap)
    151 {
    152 	int error;
    153 	bool mpsafe;
    154 	struct vop_create_v3_args a;
    155 	a.a_desc = VDESC(vop_create);
    156 	a.a_dvp = dvp;
    157 	a.a_vpp = vpp;
    158 	a.a_cnp = cnp;
    159 	a.a_vap = vap;
    160 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    161 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    162 	error = (VCALL(dvp, VOFFSET(vop_create), &a));
    163 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    164 #ifdef DIAGNOSTIC
    165 	if (error == 0)
    166 		KASSERT((*vpp)->v_size != VSIZENOTSET
    167 		    && (*vpp)->v_writesize != VSIZENOTSET);
    168 #endif /* DIAGNOSTIC */
    169 	return error;
    170 }
    171 
    172 const int vop_mknod_vp_offsets[] = {
    173 	VOPARG_OFFSETOF(struct vop_mknod_v3_args,a_dvp),
    174 	VDESC_NO_OFFSET
    175 };
    176 const struct vnodeop_desc vop_mknod_desc = {
    177 	VOP_MKNOD_DESCOFFSET,
    178 	"vop_mknod",
    179 	0,
    180 	vop_mknod_vp_offsets,
    181 	VOPARG_OFFSETOF(struct vop_mknod_v3_args, a_vpp),
    182 	VDESC_NO_OFFSET,
    183 	VOPARG_OFFSETOF(struct vop_mknod_v3_args, a_cnp),
    184 };
    185 int
    186 VOP_MKNOD(struct vnode *dvp,
    187     struct vnode **vpp,
    188     struct componentname *cnp,
    189     struct vattr *vap)
    190 {
    191 	int error;
    192 	bool mpsafe;
    193 	struct vop_mknod_v3_args a;
    194 	a.a_desc = VDESC(vop_mknod);
    195 	a.a_dvp = dvp;
    196 	a.a_vpp = vpp;
    197 	a.a_cnp = cnp;
    198 	a.a_vap = vap;
    199 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    200 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    201 	error = (VCALL(dvp, VOFFSET(vop_mknod), &a));
    202 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    203 #ifdef DIAGNOSTIC
    204 	if (error == 0)
    205 		KASSERT((*vpp)->v_size != VSIZENOTSET
    206 		    && (*vpp)->v_writesize != VSIZENOTSET);
    207 #endif /* DIAGNOSTIC */
    208 	return error;
    209 }
    210 
    211 const int vop_open_vp_offsets[] = {
    212 	VOPARG_OFFSETOF(struct vop_open_args,a_vp),
    213 	VDESC_NO_OFFSET
    214 };
    215 const struct vnodeop_desc vop_open_desc = {
    216 	VOP_OPEN_DESCOFFSET,
    217 	"vop_open",
    218 	0,
    219 	vop_open_vp_offsets,
    220 	VDESC_NO_OFFSET,
    221 	VOPARG_OFFSETOF(struct vop_open_args, a_cred),
    222 	VDESC_NO_OFFSET,
    223 };
    224 int
    225 VOP_OPEN(struct vnode *vp,
    226     int mode,
    227     kauth_cred_t cred)
    228 {
    229 	int error;
    230 	bool mpsafe;
    231 	struct vop_open_args a;
    232 	a.a_desc = VDESC(vop_open);
    233 	a.a_vp = vp;
    234 	a.a_mode = mode;
    235 	a.a_cred = cred;
    236 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    237 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    238 	error = (VCALL(vp, VOFFSET(vop_open), &a));
    239 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    240 	return error;
    241 }
    242 
    243 const int vop_close_vp_offsets[] = {
    244 	VOPARG_OFFSETOF(struct vop_close_args,a_vp),
    245 	VDESC_NO_OFFSET
    246 };
    247 const struct vnodeop_desc vop_close_desc = {
    248 	VOP_CLOSE_DESCOFFSET,
    249 	"vop_close",
    250 	0,
    251 	vop_close_vp_offsets,
    252 	VDESC_NO_OFFSET,
    253 	VOPARG_OFFSETOF(struct vop_close_args, a_cred),
    254 	VDESC_NO_OFFSET,
    255 };
    256 int
    257 VOP_CLOSE(struct vnode *vp,
    258     int fflag,
    259     kauth_cred_t cred)
    260 {
    261 	int error;
    262 	bool mpsafe;
    263 	struct vop_close_args a;
    264 	a.a_desc = VDESC(vop_close);
    265 	a.a_vp = vp;
    266 	a.a_fflag = fflag;
    267 	a.a_cred = cred;
    268 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    269 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    270 	error = (VCALL(vp, VOFFSET(vop_close), &a));
    271 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    272 	return error;
    273 }
    274 
    275 const int vop_access_vp_offsets[] = {
    276 	VOPARG_OFFSETOF(struct vop_access_args,a_vp),
    277 	VDESC_NO_OFFSET
    278 };
    279 const struct vnodeop_desc vop_access_desc = {
    280 	VOP_ACCESS_DESCOFFSET,
    281 	"vop_access",
    282 	0,
    283 	vop_access_vp_offsets,
    284 	VDESC_NO_OFFSET,
    285 	VOPARG_OFFSETOF(struct vop_access_args, a_cred),
    286 	VDESC_NO_OFFSET,
    287 };
    288 int
    289 VOP_ACCESS(struct vnode *vp,
    290     int mode,
    291     kauth_cred_t cred)
    292 {
    293 	int error;
    294 	bool mpsafe;
    295 	struct vop_access_args a;
    296 	a.a_desc = VDESC(vop_access);
    297 	a.a_vp = vp;
    298 	a.a_mode = mode;
    299 	a.a_cred = cred;
    300 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    301 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    302 	error = (VCALL(vp, VOFFSET(vop_access), &a));
    303 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    304 	return error;
    305 }
    306 
    307 const int vop_getattr_vp_offsets[] = {
    308 	VOPARG_OFFSETOF(struct vop_getattr_args,a_vp),
    309 	VDESC_NO_OFFSET
    310 };
    311 const struct vnodeop_desc vop_getattr_desc = {
    312 	VOP_GETATTR_DESCOFFSET,
    313 	"vop_getattr",
    314 	0,
    315 	vop_getattr_vp_offsets,
    316 	VDESC_NO_OFFSET,
    317 	VOPARG_OFFSETOF(struct vop_getattr_args, a_cred),
    318 	VDESC_NO_OFFSET,
    319 };
    320 int
    321 VOP_GETATTR(struct vnode *vp,
    322     struct vattr *vap,
    323     kauth_cred_t cred)
    324 {
    325 	int error;
    326 	bool mpsafe;
    327 	struct vop_getattr_args a;
    328 	a.a_desc = VDESC(vop_getattr);
    329 	a.a_vp = vp;
    330 	a.a_vap = vap;
    331 	a.a_cred = cred;
    332 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    333 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    334 	error = (VCALL(vp, VOFFSET(vop_getattr), &a));
    335 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    336 	return error;
    337 }
    338 
    339 const int vop_setattr_vp_offsets[] = {
    340 	VOPARG_OFFSETOF(struct vop_setattr_args,a_vp),
    341 	VDESC_NO_OFFSET
    342 };
    343 const struct vnodeop_desc vop_setattr_desc = {
    344 	VOP_SETATTR_DESCOFFSET,
    345 	"vop_setattr",
    346 	0,
    347 	vop_setattr_vp_offsets,
    348 	VDESC_NO_OFFSET,
    349 	VOPARG_OFFSETOF(struct vop_setattr_args, a_cred),
    350 	VDESC_NO_OFFSET,
    351 };
    352 int
    353 VOP_SETATTR(struct vnode *vp,
    354     struct vattr *vap,
    355     kauth_cred_t cred)
    356 {
    357 	int error;
    358 	bool mpsafe;
    359 	struct vop_setattr_args a;
    360 	a.a_desc = VDESC(vop_setattr);
    361 	a.a_vp = vp;
    362 	a.a_vap = vap;
    363 	a.a_cred = cred;
    364 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    365 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    366 	error = (VCALL(vp, VOFFSET(vop_setattr), &a));
    367 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    368 	return error;
    369 }
    370 
    371 const int vop_read_vp_offsets[] = {
    372 	VOPARG_OFFSETOF(struct vop_read_args,a_vp),
    373 	VDESC_NO_OFFSET
    374 };
    375 const struct vnodeop_desc vop_read_desc = {
    376 	VOP_READ_DESCOFFSET,
    377 	"vop_read",
    378 	0,
    379 	vop_read_vp_offsets,
    380 	VDESC_NO_OFFSET,
    381 	VOPARG_OFFSETOF(struct vop_read_args, a_cred),
    382 	VDESC_NO_OFFSET,
    383 };
    384 int
    385 VOP_READ(struct vnode *vp,
    386     struct uio *uio,
    387     int ioflag,
    388     kauth_cred_t cred)
    389 {
    390 	int error;
    391 	bool mpsafe;
    392 	struct vop_read_args a;
    393 	a.a_desc = VDESC(vop_read);
    394 	a.a_vp = vp;
    395 	a.a_uio = uio;
    396 	a.a_ioflag = ioflag;
    397 	a.a_cred = cred;
    398 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    399 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    400 	error = (VCALL(vp, VOFFSET(vop_read), &a));
    401 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    402 	return error;
    403 }
    404 
    405 const int vop_write_vp_offsets[] = {
    406 	VOPARG_OFFSETOF(struct vop_write_args,a_vp),
    407 	VDESC_NO_OFFSET
    408 };
    409 const struct vnodeop_desc vop_write_desc = {
    410 	VOP_WRITE_DESCOFFSET,
    411 	"vop_write",
    412 	0,
    413 	vop_write_vp_offsets,
    414 	VDESC_NO_OFFSET,
    415 	VOPARG_OFFSETOF(struct vop_write_args, a_cred),
    416 	VDESC_NO_OFFSET,
    417 };
    418 int
    419 VOP_WRITE(struct vnode *vp,
    420     struct uio *uio,
    421     int ioflag,
    422     kauth_cred_t cred)
    423 {
    424 	int error;
    425 	bool mpsafe;
    426 	struct vop_write_args a;
    427 	a.a_desc = VDESC(vop_write);
    428 	a.a_vp = vp;
    429 	a.a_uio = uio;
    430 	a.a_ioflag = ioflag;
    431 	a.a_cred = cred;
    432 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    433 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    434 	error = (VCALL(vp, VOFFSET(vop_write), &a));
    435 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    436 	return error;
    437 }
    438 
    439 const int vop_fallocate_vp_offsets[] = {
    440 	VOPARG_OFFSETOF(struct vop_fallocate_args,a_vp),
    441 	VDESC_NO_OFFSET
    442 };
    443 const struct vnodeop_desc vop_fallocate_desc = {
    444 	VOP_FALLOCATE_DESCOFFSET,
    445 	"vop_fallocate",
    446 	0,
    447 	vop_fallocate_vp_offsets,
    448 	VDESC_NO_OFFSET,
    449 	VDESC_NO_OFFSET,
    450 	VDESC_NO_OFFSET,
    451 };
    452 int
    453 VOP_FALLOCATE(struct vnode *vp,
    454     off_t pos,
    455     off_t len)
    456 {
    457 	int error;
    458 	bool mpsafe;
    459 	struct vop_fallocate_args a;
    460 	a.a_desc = VDESC(vop_fallocate);
    461 	a.a_vp = vp;
    462 	a.a_pos = pos;
    463 	a.a_len = len;
    464 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    465 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    466 	error = (VCALL(vp, VOFFSET(vop_fallocate), &a));
    467 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    468 	return error;
    469 }
    470 
    471 const int vop_fdiscard_vp_offsets[] = {
    472 	VOPARG_OFFSETOF(struct vop_fdiscard_args,a_vp),
    473 	VDESC_NO_OFFSET
    474 };
    475 const struct vnodeop_desc vop_fdiscard_desc = {
    476 	VOP_FDISCARD_DESCOFFSET,
    477 	"vop_fdiscard",
    478 	0,
    479 	vop_fdiscard_vp_offsets,
    480 	VDESC_NO_OFFSET,
    481 	VDESC_NO_OFFSET,
    482 	VDESC_NO_OFFSET,
    483 };
    484 int
    485 VOP_FDISCARD(struct vnode *vp,
    486     off_t pos,
    487     off_t len)
    488 {
    489 	int error;
    490 	bool mpsafe;
    491 	struct vop_fdiscard_args a;
    492 	a.a_desc = VDESC(vop_fdiscard);
    493 	a.a_vp = vp;
    494 	a.a_pos = pos;
    495 	a.a_len = len;
    496 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    497 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    498 	error = (VCALL(vp, VOFFSET(vop_fdiscard), &a));
    499 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    500 	return error;
    501 }
    502 
    503 const int vop_ioctl_vp_offsets[] = {
    504 	VOPARG_OFFSETOF(struct vop_ioctl_args,a_vp),
    505 	VDESC_NO_OFFSET
    506 };
    507 const struct vnodeop_desc vop_ioctl_desc = {
    508 	VOP_IOCTL_DESCOFFSET,
    509 	"vop_ioctl",
    510 	0,
    511 	vop_ioctl_vp_offsets,
    512 	VDESC_NO_OFFSET,
    513 	VOPARG_OFFSETOF(struct vop_ioctl_args, a_cred),
    514 	VDESC_NO_OFFSET,
    515 };
    516 int
    517 VOP_IOCTL(struct vnode *vp,
    518     u_long command,
    519     void *data,
    520     int fflag,
    521     kauth_cred_t cred)
    522 {
    523 	int error;
    524 	bool mpsafe;
    525 	struct vop_ioctl_args a;
    526 	a.a_desc = VDESC(vop_ioctl);
    527 	a.a_vp = vp;
    528 	a.a_command = command;
    529 	a.a_data = data;
    530 	a.a_fflag = fflag;
    531 	a.a_cred = cred;
    532 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    533 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    534 	error = (VCALL(vp, VOFFSET(vop_ioctl), &a));
    535 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    536 	return error;
    537 }
    538 
    539 const int vop_fcntl_vp_offsets[] = {
    540 	VOPARG_OFFSETOF(struct vop_fcntl_args,a_vp),
    541 	VDESC_NO_OFFSET
    542 };
    543 const struct vnodeop_desc vop_fcntl_desc = {
    544 	VOP_FCNTL_DESCOFFSET,
    545 	"vop_fcntl",
    546 	0,
    547 	vop_fcntl_vp_offsets,
    548 	VDESC_NO_OFFSET,
    549 	VOPARG_OFFSETOF(struct vop_fcntl_args, a_cred),
    550 	VDESC_NO_OFFSET,
    551 };
    552 int
    553 VOP_FCNTL(struct vnode *vp,
    554     u_int command,
    555     void *data,
    556     int fflag,
    557     kauth_cred_t cred)
    558 {
    559 	int error;
    560 	bool mpsafe;
    561 	struct vop_fcntl_args a;
    562 	a.a_desc = VDESC(vop_fcntl);
    563 	a.a_vp = vp;
    564 	a.a_command = command;
    565 	a.a_data = data;
    566 	a.a_fflag = fflag;
    567 	a.a_cred = cred;
    568 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    569 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    570 	error = (VCALL(vp, VOFFSET(vop_fcntl), &a));
    571 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    572 	return error;
    573 }
    574 
    575 const int vop_poll_vp_offsets[] = {
    576 	VOPARG_OFFSETOF(struct vop_poll_args,a_vp),
    577 	VDESC_NO_OFFSET
    578 };
    579 const struct vnodeop_desc vop_poll_desc = {
    580 	VOP_POLL_DESCOFFSET,
    581 	"vop_poll",
    582 	0,
    583 	vop_poll_vp_offsets,
    584 	VDESC_NO_OFFSET,
    585 	VDESC_NO_OFFSET,
    586 	VDESC_NO_OFFSET,
    587 };
    588 int
    589 VOP_POLL(struct vnode *vp,
    590     int events)
    591 {
    592 	int error;
    593 	bool mpsafe;
    594 	struct vop_poll_args a;
    595 	struct mount *mp = vp->v_mount;
    596 	a.a_desc = VDESC(vop_poll);
    597 	a.a_vp = vp;
    598 	a.a_events = events;
    599 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    600 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    601 	fstrans_start(mp, FSTRANS_SHARED);
    602 	error = (VCALL(vp, VOFFSET(vop_poll), &a));
    603 	fstrans_done(mp);
    604 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    605 	return error;
    606 }
    607 
    608 const int vop_kqfilter_vp_offsets[] = {
    609 	VOPARG_OFFSETOF(struct vop_kqfilter_args,a_vp),
    610 	VDESC_NO_OFFSET
    611 };
    612 const struct vnodeop_desc vop_kqfilter_desc = {
    613 	VOP_KQFILTER_DESCOFFSET,
    614 	"vop_kqfilter",
    615 	0,
    616 	vop_kqfilter_vp_offsets,
    617 	VDESC_NO_OFFSET,
    618 	VDESC_NO_OFFSET,
    619 	VDESC_NO_OFFSET,
    620 };
    621 int
    622 VOP_KQFILTER(struct vnode *vp,
    623     struct knote *kn)
    624 {
    625 	int error;
    626 	bool mpsafe;
    627 	struct vop_kqfilter_args a;
    628 	struct mount *mp = vp->v_mount;
    629 	a.a_desc = VDESC(vop_kqfilter);
    630 	a.a_vp = vp;
    631 	a.a_kn = kn;
    632 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    633 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    634 	fstrans_start(mp, FSTRANS_SHARED);
    635 	error = (VCALL(vp, VOFFSET(vop_kqfilter), &a));
    636 	fstrans_done(mp);
    637 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    638 	return error;
    639 }
    640 
    641 const int vop_revoke_vp_offsets[] = {
    642 	VOPARG_OFFSETOF(struct vop_revoke_args,a_vp),
    643 	VDESC_NO_OFFSET
    644 };
    645 const struct vnodeop_desc vop_revoke_desc = {
    646 	VOP_REVOKE_DESCOFFSET,
    647 	"vop_revoke",
    648 	0,
    649 	vop_revoke_vp_offsets,
    650 	VDESC_NO_OFFSET,
    651 	VDESC_NO_OFFSET,
    652 	VDESC_NO_OFFSET,
    653 };
    654 int
    655 VOP_REVOKE(struct vnode *vp,
    656     int flags)
    657 {
    658 	int error;
    659 	bool mpsafe;
    660 	struct vop_revoke_args a;
    661 	a.a_desc = VDESC(vop_revoke);
    662 	a.a_vp = vp;
    663 	a.a_flags = flags;
    664 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    665 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    666 	error = (VCALL(vp, VOFFSET(vop_revoke), &a));
    667 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    668 	return error;
    669 }
    670 
    671 const int vop_mmap_vp_offsets[] = {
    672 	VOPARG_OFFSETOF(struct vop_mmap_args,a_vp),
    673 	VDESC_NO_OFFSET
    674 };
    675 const struct vnodeop_desc vop_mmap_desc = {
    676 	VOP_MMAP_DESCOFFSET,
    677 	"vop_mmap",
    678 	0,
    679 	vop_mmap_vp_offsets,
    680 	VDESC_NO_OFFSET,
    681 	VOPARG_OFFSETOF(struct vop_mmap_args, a_cred),
    682 	VDESC_NO_OFFSET,
    683 };
    684 int
    685 VOP_MMAP(struct vnode *vp,
    686     vm_prot_t prot,
    687     kauth_cred_t cred)
    688 {
    689 	int error;
    690 	bool mpsafe;
    691 	struct vop_mmap_args a;
    692 	struct mount *mp = vp->v_mount;
    693 	a.a_desc = VDESC(vop_mmap);
    694 	a.a_vp = vp;
    695 	a.a_prot = prot;
    696 	a.a_cred = cred;
    697 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    698 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    699 	fstrans_start(mp, FSTRANS_SHARED);
    700 	error = (VCALL(vp, VOFFSET(vop_mmap), &a));
    701 	fstrans_done(mp);
    702 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    703 	return error;
    704 }
    705 
    706 const int vop_fsync_vp_offsets[] = {
    707 	VOPARG_OFFSETOF(struct vop_fsync_args,a_vp),
    708 	VDESC_NO_OFFSET
    709 };
    710 const struct vnodeop_desc vop_fsync_desc = {
    711 	VOP_FSYNC_DESCOFFSET,
    712 	"vop_fsync",
    713 	0,
    714 	vop_fsync_vp_offsets,
    715 	VDESC_NO_OFFSET,
    716 	VOPARG_OFFSETOF(struct vop_fsync_args, a_cred),
    717 	VDESC_NO_OFFSET,
    718 };
    719 int
    720 VOP_FSYNC(struct vnode *vp,
    721     kauth_cred_t cred,
    722     int flags,
    723     off_t offlo,
    724     off_t offhi)
    725 {
    726 	int error;
    727 	bool mpsafe;
    728 	struct vop_fsync_args a;
    729 	a.a_desc = VDESC(vop_fsync);
    730 	a.a_vp = vp;
    731 	a.a_cred = cred;
    732 	a.a_flags = flags;
    733 	a.a_offlo = offlo;
    734 	a.a_offhi = offhi;
    735 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    736 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    737 	error = (VCALL(vp, VOFFSET(vop_fsync), &a));
    738 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    739 	return error;
    740 }
    741 
    742 const int vop_seek_vp_offsets[] = {
    743 	VOPARG_OFFSETOF(struct vop_seek_args,a_vp),
    744 	VDESC_NO_OFFSET
    745 };
    746 const struct vnodeop_desc vop_seek_desc = {
    747 	VOP_SEEK_DESCOFFSET,
    748 	"vop_seek",
    749 	0,
    750 	vop_seek_vp_offsets,
    751 	VDESC_NO_OFFSET,
    752 	VOPARG_OFFSETOF(struct vop_seek_args, a_cred),
    753 	VDESC_NO_OFFSET,
    754 };
    755 int
    756 VOP_SEEK(struct vnode *vp,
    757     off_t oldoff,
    758     off_t newoff,
    759     kauth_cred_t cred)
    760 {
    761 	int error;
    762 	bool mpsafe;
    763 	struct vop_seek_args a;
    764 	struct mount *mp = vp->v_mount;
    765 	a.a_desc = VDESC(vop_seek);
    766 	a.a_vp = vp;
    767 	a.a_oldoff = oldoff;
    768 	a.a_newoff = newoff;
    769 	a.a_cred = cred;
    770 	mpsafe = (vp->v_vflag & VV_MPSAFE);
    771 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    772 	fstrans_start(mp, FSTRANS_SHARED);
    773 	error = (VCALL(vp, VOFFSET(vop_seek), &a));
    774 	fstrans_done(mp);
    775 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    776 	return error;
    777 }
    778 
    779 const int vop_remove_vp_offsets[] = {
    780 	VOPARG_OFFSETOF(struct vop_remove_args,a_dvp),
    781 	VOPARG_OFFSETOF(struct vop_remove_args,a_vp),
    782 	VDESC_NO_OFFSET
    783 };
    784 const struct vnodeop_desc vop_remove_desc = {
    785 	VOP_REMOVE_DESCOFFSET,
    786 	"vop_remove",
    787 	0 | VDESC_VP0_WILLPUT | VDESC_VP1_WILLPUT,
    788 	vop_remove_vp_offsets,
    789 	VDESC_NO_OFFSET,
    790 	VDESC_NO_OFFSET,
    791 	VOPARG_OFFSETOF(struct vop_remove_args, a_cnp),
    792 };
    793 int
    794 VOP_REMOVE(struct vnode *dvp,
    795     struct vnode *vp,
    796     struct componentname *cnp)
    797 {
    798 	int error;
    799 	bool mpsafe;
    800 	struct vop_remove_args a;
    801 	a.a_desc = VDESC(vop_remove);
    802 	a.a_dvp = dvp;
    803 	a.a_vp = vp;
    804 	a.a_cnp = cnp;
    805 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    806 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    807 	error = (VCALL(dvp, VOFFSET(vop_remove), &a));
    808 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    809 	return error;
    810 }
    811 
    812 const int vop_link_vp_offsets[] = {
    813 	VOPARG_OFFSETOF(struct vop_link_v2_args,a_dvp),
    814 	VOPARG_OFFSETOF(struct vop_link_v2_args,a_vp),
    815 	VDESC_NO_OFFSET
    816 };
    817 const struct vnodeop_desc vop_link_desc = {
    818 	VOP_LINK_DESCOFFSET,
    819 	"vop_link",
    820 	0,
    821 	vop_link_vp_offsets,
    822 	VDESC_NO_OFFSET,
    823 	VDESC_NO_OFFSET,
    824 	VOPARG_OFFSETOF(struct vop_link_v2_args, a_cnp),
    825 };
    826 int
    827 VOP_LINK(struct vnode *dvp,
    828     struct vnode *vp,
    829     struct componentname *cnp)
    830 {
    831 	int error;
    832 	bool mpsafe;
    833 	struct vop_link_v2_args a;
    834 	a.a_desc = VDESC(vop_link);
    835 	a.a_dvp = dvp;
    836 	a.a_vp = vp;
    837 	a.a_cnp = cnp;
    838 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    839 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    840 	error = (VCALL(dvp, VOFFSET(vop_link), &a));
    841 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    842 	return error;
    843 }
    844 
    845 const int vop_rename_vp_offsets[] = {
    846 	VOPARG_OFFSETOF(struct vop_rename_args,a_fdvp),
    847 	VOPARG_OFFSETOF(struct vop_rename_args,a_fvp),
    848 	VOPARG_OFFSETOF(struct vop_rename_args,a_tdvp),
    849 	VOPARG_OFFSETOF(struct vop_rename_args,a_tvp),
    850 	VDESC_NO_OFFSET
    851 };
    852 const struct vnodeop_desc vop_rename_desc = {
    853 	VOP_RENAME_DESCOFFSET,
    854 	"vop_rename",
    855 	0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE | VDESC_VP2_WILLPUT | VDESC_VP3_WILLPUT,
    856 	vop_rename_vp_offsets,
    857 	VDESC_NO_OFFSET,
    858 	VDESC_NO_OFFSET,
    859 	VOPARG_OFFSETOF(struct vop_rename_args, a_fcnp),
    860 };
    861 int
    862 VOP_RENAME(struct vnode *fdvp,
    863     struct vnode *fvp,
    864     struct componentname *fcnp,
    865     struct vnode *tdvp,
    866     struct vnode *tvp,
    867     struct componentname *tcnp)
    868 {
    869 	int error;
    870 	bool mpsafe;
    871 	struct vop_rename_args a;
    872 	struct mount *mp = fdvp->v_mount;
    873 	a.a_desc = VDESC(vop_rename);
    874 	a.a_fdvp = fdvp;
    875 	a.a_fvp = fvp;
    876 	a.a_fcnp = fcnp;
    877 	a.a_tdvp = tdvp;
    878 	a.a_tvp = tvp;
    879 	a.a_tcnp = tcnp;
    880 	mpsafe = (fdvp->v_vflag & VV_MPSAFE);
    881 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    882 	fstrans_start(mp, FSTRANS_SHARED);
    883 	error = (VCALL(fdvp, VOFFSET(vop_rename), &a));
    884 	fstrans_done(mp);
    885 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    886 	return error;
    887 }
    888 
    889 const int vop_mkdir_vp_offsets[] = {
    890 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args,a_dvp),
    891 	VDESC_NO_OFFSET
    892 };
    893 const struct vnodeop_desc vop_mkdir_desc = {
    894 	VOP_MKDIR_DESCOFFSET,
    895 	"vop_mkdir",
    896 	0,
    897 	vop_mkdir_vp_offsets,
    898 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args, a_vpp),
    899 	VDESC_NO_OFFSET,
    900 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args, a_cnp),
    901 };
    902 int
    903 VOP_MKDIR(struct vnode *dvp,
    904     struct vnode **vpp,
    905     struct componentname *cnp,
    906     struct vattr *vap)
    907 {
    908 	int error;
    909 	bool mpsafe;
    910 	struct vop_mkdir_v3_args a;
    911 	a.a_desc = VDESC(vop_mkdir);
    912 	a.a_dvp = dvp;
    913 	a.a_vpp = vpp;
    914 	a.a_cnp = cnp;
    915 	a.a_vap = vap;
    916 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    917 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    918 	error = (VCALL(dvp, VOFFSET(vop_mkdir), &a));
    919 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    920 #ifdef DIAGNOSTIC
    921 	if (error == 0)
    922 		KASSERT((*vpp)->v_size != VSIZENOTSET
    923 		    && (*vpp)->v_writesize != VSIZENOTSET);
    924 #endif /* DIAGNOSTIC */
    925 	return error;
    926 }
    927 
    928 const int vop_rmdir_vp_offsets[] = {
    929 	VOPARG_OFFSETOF(struct vop_rmdir_args,a_dvp),
    930 	VOPARG_OFFSETOF(struct vop_rmdir_args,a_vp),
    931 	VDESC_NO_OFFSET
    932 };
    933 const struct vnodeop_desc vop_rmdir_desc = {
    934 	VOP_RMDIR_DESCOFFSET,
    935 	"vop_rmdir",
    936 	0 | VDESC_VP0_WILLPUT | VDESC_VP1_WILLPUT,
    937 	vop_rmdir_vp_offsets,
    938 	VDESC_NO_OFFSET,
    939 	VDESC_NO_OFFSET,
    940 	VOPARG_OFFSETOF(struct vop_rmdir_args, a_cnp),
    941 };
    942 int
    943 VOP_RMDIR(struct vnode *dvp,
    944     struct vnode *vp,
    945     struct componentname *cnp)
    946 {
    947 	int error;
    948 	bool mpsafe;
    949 	struct vop_rmdir_args a;
    950 	a.a_desc = VDESC(vop_rmdir);
    951 	a.a_dvp = dvp;
    952 	a.a_vp = vp;
    953 	a.a_cnp = cnp;
    954 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    955 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    956 	error = (VCALL(dvp, VOFFSET(vop_rmdir), &a));
    957 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    958 	return error;
    959 }
    960 
    961 const int vop_symlink_vp_offsets[] = {
    962 	VOPARG_OFFSETOF(struct vop_symlink_v3_args,a_dvp),
    963 	VDESC_NO_OFFSET
    964 };
    965 const struct vnodeop_desc vop_symlink_desc = {
    966 	VOP_SYMLINK_DESCOFFSET,
    967 	"vop_symlink",
    968 	0,
    969 	vop_symlink_vp_offsets,
    970 	VOPARG_OFFSETOF(struct vop_symlink_v3_args, a_vpp),
    971 	VDESC_NO_OFFSET,
    972 	VOPARG_OFFSETOF(struct vop_symlink_v3_args, a_cnp),
    973 };
    974 int
    975 VOP_SYMLINK(struct vnode *dvp,
    976     struct vnode **vpp,
    977     struct componentname *cnp,
    978     struct vattr *vap,
    979     char *target)
    980 {
    981 	int error;
    982 	bool mpsafe;
    983 	struct vop_symlink_v3_args a;
    984 	a.a_desc = VDESC(vop_symlink);
    985 	a.a_dvp = dvp;
    986 	a.a_vpp = vpp;
    987 	a.a_cnp = cnp;
    988 	a.a_vap = vap;
    989 	a.a_target = target;
    990 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
    991 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
    992 	error = (VCALL(dvp, VOFFSET(vop_symlink), &a));
    993 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
    994 #ifdef DIAGNOSTIC
    995 	if (error == 0)
    996 		KASSERT((*vpp)->v_size != VSIZENOTSET
    997 		    && (*vpp)->v_writesize != VSIZENOTSET);
    998 #endif /* DIAGNOSTIC */
    999 	return error;
   1000 }
   1001 
   1002 const int vop_readdir_vp_offsets[] = {
   1003 	VOPARG_OFFSETOF(struct vop_readdir_args,a_vp),
   1004 	VDESC_NO_OFFSET
   1005 };
   1006 const struct vnodeop_desc vop_readdir_desc = {
   1007 	VOP_READDIR_DESCOFFSET,
   1008 	"vop_readdir",
   1009 	0,
   1010 	vop_readdir_vp_offsets,
   1011 	VDESC_NO_OFFSET,
   1012 	VOPARG_OFFSETOF(struct vop_readdir_args, a_cred),
   1013 	VDESC_NO_OFFSET,
   1014 };
   1015 int
   1016 VOP_READDIR(struct vnode *vp,
   1017     struct uio *uio,
   1018     kauth_cred_t cred,
   1019     int *eofflag,
   1020     off_t **cookies,
   1021     int *ncookies)
   1022 {
   1023 	int error;
   1024 	bool mpsafe;
   1025 	struct vop_readdir_args a;
   1026 	a.a_desc = VDESC(vop_readdir);
   1027 	a.a_vp = vp;
   1028 	a.a_uio = uio;
   1029 	a.a_cred = cred;
   1030 	a.a_eofflag = eofflag;
   1031 	a.a_cookies = cookies;
   1032 	a.a_ncookies = ncookies;
   1033 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1034 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1035 	error = (VCALL(vp, VOFFSET(vop_readdir), &a));
   1036 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1037 	return error;
   1038 }
   1039 
   1040 const int vop_readlink_vp_offsets[] = {
   1041 	VOPARG_OFFSETOF(struct vop_readlink_args,a_vp),
   1042 	VDESC_NO_OFFSET
   1043 };
   1044 const struct vnodeop_desc vop_readlink_desc = {
   1045 	VOP_READLINK_DESCOFFSET,
   1046 	"vop_readlink",
   1047 	0,
   1048 	vop_readlink_vp_offsets,
   1049 	VDESC_NO_OFFSET,
   1050 	VOPARG_OFFSETOF(struct vop_readlink_args, a_cred),
   1051 	VDESC_NO_OFFSET,
   1052 };
   1053 int
   1054 VOP_READLINK(struct vnode *vp,
   1055     struct uio *uio,
   1056     kauth_cred_t cred)
   1057 {
   1058 	int error;
   1059 	bool mpsafe;
   1060 	struct vop_readlink_args a;
   1061 	a.a_desc = VDESC(vop_readlink);
   1062 	a.a_vp = vp;
   1063 	a.a_uio = uio;
   1064 	a.a_cred = cred;
   1065 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1066 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1067 	error = (VCALL(vp, VOFFSET(vop_readlink), &a));
   1068 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1069 	return error;
   1070 }
   1071 
   1072 const int vop_abortop_vp_offsets[] = {
   1073 	VOPARG_OFFSETOF(struct vop_abortop_args,a_dvp),
   1074 	VDESC_NO_OFFSET
   1075 };
   1076 const struct vnodeop_desc vop_abortop_desc = {
   1077 	VOP_ABORTOP_DESCOFFSET,
   1078 	"vop_abortop",
   1079 	0,
   1080 	vop_abortop_vp_offsets,
   1081 	VDESC_NO_OFFSET,
   1082 	VDESC_NO_OFFSET,
   1083 	VOPARG_OFFSETOF(struct vop_abortop_args, a_cnp),
   1084 };
   1085 int
   1086 VOP_ABORTOP(struct vnode *dvp,
   1087     struct componentname *cnp)
   1088 {
   1089 	int error;
   1090 	bool mpsafe;
   1091 	struct vop_abortop_args a;
   1092 	struct mount *mp = dvp->v_mount;
   1093 	a.a_desc = VDESC(vop_abortop);
   1094 	a.a_dvp = dvp;
   1095 	a.a_cnp = cnp;
   1096 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
   1097 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1098 	fstrans_start(mp, FSTRANS_SHARED);
   1099 	error = (VCALL(dvp, VOFFSET(vop_abortop), &a));
   1100 	fstrans_done(mp);
   1101 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1102 	return error;
   1103 }
   1104 
   1105 const int vop_inactive_vp_offsets[] = {
   1106 	VOPARG_OFFSETOF(struct vop_inactive_v2_args,a_vp),
   1107 	VDESC_NO_OFFSET
   1108 };
   1109 const struct vnodeop_desc vop_inactive_desc = {
   1110 	VOP_INACTIVE_DESCOFFSET,
   1111 	"vop_inactive",
   1112 	0,
   1113 	vop_inactive_vp_offsets,
   1114 	VDESC_NO_OFFSET,
   1115 	VDESC_NO_OFFSET,
   1116 	VDESC_NO_OFFSET,
   1117 };
   1118 int
   1119 VOP_INACTIVE(struct vnode *vp,
   1120     bool *recycle)
   1121 {
   1122 	int error;
   1123 	bool mpsafe;
   1124 	struct vop_inactive_v2_args a;
   1125 	a.a_desc = VDESC(vop_inactive);
   1126 	a.a_vp = vp;
   1127 	a.a_recycle = recycle;
   1128 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1129 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1130 	error = (VCALL(vp, VOFFSET(vop_inactive), &a));
   1131 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1132 	return error;
   1133 }
   1134 
   1135 const int vop_reclaim_vp_offsets[] = {
   1136 	VOPARG_OFFSETOF(struct vop_reclaim_args,a_vp),
   1137 	VDESC_NO_OFFSET
   1138 };
   1139 const struct vnodeop_desc vop_reclaim_desc = {
   1140 	VOP_RECLAIM_DESCOFFSET,
   1141 	"vop_reclaim",
   1142 	0,
   1143 	vop_reclaim_vp_offsets,
   1144 	VDESC_NO_OFFSET,
   1145 	VDESC_NO_OFFSET,
   1146 	VDESC_NO_OFFSET,
   1147 };
   1148 int
   1149 VOP_RECLAIM(struct vnode *vp)
   1150 {
   1151 	int error;
   1152 	bool mpsafe;
   1153 	struct vop_reclaim_args a;
   1154 	a.a_desc = VDESC(vop_reclaim);
   1155 	a.a_vp = vp;
   1156 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1157 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1158 	error = (VCALL(vp, VOFFSET(vop_reclaim), &a));
   1159 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1160 	return error;
   1161 }
   1162 
   1163 const int vop_lock_vp_offsets[] = {
   1164 	VOPARG_OFFSETOF(struct vop_lock_args,a_vp),
   1165 	VDESC_NO_OFFSET
   1166 };
   1167 const struct vnodeop_desc vop_lock_desc = {
   1168 	VOP_LOCK_DESCOFFSET,
   1169 	"vop_lock",
   1170 	0,
   1171 	vop_lock_vp_offsets,
   1172 	VDESC_NO_OFFSET,
   1173 	VDESC_NO_OFFSET,
   1174 	VDESC_NO_OFFSET,
   1175 };
   1176 int
   1177 VOP_LOCK(struct vnode *vp,
   1178     int flags)
   1179 {
   1180 	int error;
   1181 	bool mpsafe;
   1182 	struct vop_lock_args a;
   1183 	a.a_desc = VDESC(vop_lock);
   1184 	a.a_vp = vp;
   1185 	a.a_flags = flags;
   1186 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1187 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1188 	error = (VCALL(vp, VOFFSET(vop_lock), &a));
   1189 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1190 	return error;
   1191 }
   1192 
   1193 const int vop_unlock_vp_offsets[] = {
   1194 	VOPARG_OFFSETOF(struct vop_unlock_args,a_vp),
   1195 	VDESC_NO_OFFSET
   1196 };
   1197 const struct vnodeop_desc vop_unlock_desc = {
   1198 	VOP_UNLOCK_DESCOFFSET,
   1199 	"vop_unlock",
   1200 	0,
   1201 	vop_unlock_vp_offsets,
   1202 	VDESC_NO_OFFSET,
   1203 	VDESC_NO_OFFSET,
   1204 	VDESC_NO_OFFSET,
   1205 };
   1206 int
   1207 VOP_UNLOCK(struct vnode *vp)
   1208 {
   1209 	int error;
   1210 	bool mpsafe;
   1211 	struct vop_unlock_args a;
   1212 	a.a_desc = VDESC(vop_unlock);
   1213 	a.a_vp = vp;
   1214 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1215 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1216 	error = (VCALL(vp, VOFFSET(vop_unlock), &a));
   1217 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1218 	return error;
   1219 }
   1220 
   1221 const int vop_bmap_vp_offsets[] = {
   1222 	VOPARG_OFFSETOF(struct vop_bmap_args,a_vp),
   1223 	VDESC_NO_OFFSET
   1224 };
   1225 const struct vnodeop_desc vop_bmap_desc = {
   1226 	VOP_BMAP_DESCOFFSET,
   1227 	"vop_bmap",
   1228 	0,
   1229 	vop_bmap_vp_offsets,
   1230 	VOPARG_OFFSETOF(struct vop_bmap_args, a_vpp),
   1231 	VDESC_NO_OFFSET,
   1232 	VDESC_NO_OFFSET,
   1233 };
   1234 int
   1235 VOP_BMAP(struct vnode *vp,
   1236     daddr_t bn,
   1237     struct vnode **vpp,
   1238     daddr_t *bnp,
   1239     int *runp)
   1240 {
   1241 	int error;
   1242 	bool mpsafe;
   1243 	struct vop_bmap_args a;
   1244 	struct mount *mp = vp->v_mount;
   1245 	a.a_desc = VDESC(vop_bmap);
   1246 	a.a_vp = vp;
   1247 	a.a_bn = bn;
   1248 	a.a_vpp = vpp;
   1249 	a.a_bnp = bnp;
   1250 	a.a_runp = runp;
   1251 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1252 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1253 	fstrans_start(mp, FSTRANS_SHARED);
   1254 	error = (VCALL(vp, VOFFSET(vop_bmap), &a));
   1255 	fstrans_done(mp);
   1256 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1257 	return error;
   1258 }
   1259 
   1260 const int vop_strategy_vp_offsets[] = {
   1261 	VOPARG_OFFSETOF(struct vop_strategy_args,a_vp),
   1262 	VDESC_NO_OFFSET
   1263 };
   1264 const struct vnodeop_desc vop_strategy_desc = {
   1265 	VOP_STRATEGY_DESCOFFSET,
   1266 	"vop_strategy",
   1267 	0,
   1268 	vop_strategy_vp_offsets,
   1269 	VDESC_NO_OFFSET,
   1270 	VDESC_NO_OFFSET,
   1271 	VDESC_NO_OFFSET,
   1272 };
   1273 int
   1274 VOP_STRATEGY(struct vnode *vp,
   1275     struct buf *bp)
   1276 {
   1277 	int error;
   1278 	bool mpsafe;
   1279 	struct vop_strategy_args a;
   1280 	struct mount *mp = vp->v_mount;
   1281 	a.a_desc = VDESC(vop_strategy);
   1282 	a.a_vp = vp;
   1283 	a.a_bp = bp;
   1284 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1285 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1286 	fstrans_start(mp, FSTRANS_SHARED);
   1287 	error = (VCALL(vp, VOFFSET(vop_strategy), &a));
   1288 	fstrans_done(mp);
   1289 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1290 	return error;
   1291 }
   1292 
   1293 const int vop_print_vp_offsets[] = {
   1294 	VOPARG_OFFSETOF(struct vop_print_args,a_vp),
   1295 	VDESC_NO_OFFSET
   1296 };
   1297 const struct vnodeop_desc vop_print_desc = {
   1298 	VOP_PRINT_DESCOFFSET,
   1299 	"vop_print",
   1300 	0,
   1301 	vop_print_vp_offsets,
   1302 	VDESC_NO_OFFSET,
   1303 	VDESC_NO_OFFSET,
   1304 	VDESC_NO_OFFSET,
   1305 };
   1306 int
   1307 VOP_PRINT(struct vnode *vp)
   1308 {
   1309 	int error;
   1310 	bool mpsafe;
   1311 	struct vop_print_args a;
   1312 	struct mount *mp = vp->v_mount;
   1313 	a.a_desc = VDESC(vop_print);
   1314 	a.a_vp = vp;
   1315 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1316 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1317 	fstrans_start(mp, FSTRANS_SHARED);
   1318 	error = (VCALL(vp, VOFFSET(vop_print), &a));
   1319 	fstrans_done(mp);
   1320 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1321 	return error;
   1322 }
   1323 
   1324 const int vop_islocked_vp_offsets[] = {
   1325 	VOPARG_OFFSETOF(struct vop_islocked_args,a_vp),
   1326 	VDESC_NO_OFFSET
   1327 };
   1328 const struct vnodeop_desc vop_islocked_desc = {
   1329 	VOP_ISLOCKED_DESCOFFSET,
   1330 	"vop_islocked",
   1331 	0,
   1332 	vop_islocked_vp_offsets,
   1333 	VDESC_NO_OFFSET,
   1334 	VDESC_NO_OFFSET,
   1335 	VDESC_NO_OFFSET,
   1336 };
   1337 int
   1338 VOP_ISLOCKED(struct vnode *vp)
   1339 {
   1340 	int error;
   1341 	bool mpsafe;
   1342 	struct vop_islocked_args a;
   1343 	a.a_desc = VDESC(vop_islocked);
   1344 	a.a_vp = vp;
   1345 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1346 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1347 	error = (VCALL(vp, VOFFSET(vop_islocked), &a));
   1348 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1349 	return error;
   1350 }
   1351 
   1352 const int vop_pathconf_vp_offsets[] = {
   1353 	VOPARG_OFFSETOF(struct vop_pathconf_args,a_vp),
   1354 	VDESC_NO_OFFSET
   1355 };
   1356 const struct vnodeop_desc vop_pathconf_desc = {
   1357 	VOP_PATHCONF_DESCOFFSET,
   1358 	"vop_pathconf",
   1359 	0,
   1360 	vop_pathconf_vp_offsets,
   1361 	VDESC_NO_OFFSET,
   1362 	VDESC_NO_OFFSET,
   1363 	VDESC_NO_OFFSET,
   1364 };
   1365 int
   1366 VOP_PATHCONF(struct vnode *vp,
   1367     int name,
   1368     register_t *retval)
   1369 {
   1370 	int error;
   1371 	bool mpsafe;
   1372 	struct vop_pathconf_args a;
   1373 	a.a_desc = VDESC(vop_pathconf);
   1374 	a.a_vp = vp;
   1375 	a.a_name = name;
   1376 	a.a_retval = retval;
   1377 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1378 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1379 	error = (VCALL(vp, VOFFSET(vop_pathconf), &a));
   1380 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1381 	return error;
   1382 }
   1383 
   1384 const int vop_advlock_vp_offsets[] = {
   1385 	VOPARG_OFFSETOF(struct vop_advlock_args,a_vp),
   1386 	VDESC_NO_OFFSET
   1387 };
   1388 const struct vnodeop_desc vop_advlock_desc = {
   1389 	VOP_ADVLOCK_DESCOFFSET,
   1390 	"vop_advlock",
   1391 	0,
   1392 	vop_advlock_vp_offsets,
   1393 	VDESC_NO_OFFSET,
   1394 	VDESC_NO_OFFSET,
   1395 	VDESC_NO_OFFSET,
   1396 };
   1397 int
   1398 VOP_ADVLOCK(struct vnode *vp,
   1399     void *id,
   1400     int op,
   1401     struct flock *fl,
   1402     int flags)
   1403 {
   1404 	int error;
   1405 	bool mpsafe;
   1406 	struct vop_advlock_args a;
   1407 	struct mount *mp = vp->v_mount;
   1408 	a.a_desc = VDESC(vop_advlock);
   1409 	a.a_vp = vp;
   1410 	a.a_id = id;
   1411 	a.a_op = op;
   1412 	a.a_fl = fl;
   1413 	a.a_flags = flags;
   1414 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1415 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1416 	fstrans_start(mp, FSTRANS_SHARED);
   1417 	error = (VCALL(vp, VOFFSET(vop_advlock), &a));
   1418 	fstrans_done(mp);
   1419 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1420 	return error;
   1421 }
   1422 
   1423 const int vop_whiteout_vp_offsets[] = {
   1424 	VOPARG_OFFSETOF(struct vop_whiteout_args,a_dvp),
   1425 	VDESC_NO_OFFSET
   1426 };
   1427 const struct vnodeop_desc vop_whiteout_desc = {
   1428 	VOP_WHITEOUT_DESCOFFSET,
   1429 	"vop_whiteout",
   1430 	0,
   1431 	vop_whiteout_vp_offsets,
   1432 	VDESC_NO_OFFSET,
   1433 	VDESC_NO_OFFSET,
   1434 	VOPARG_OFFSETOF(struct vop_whiteout_args, a_cnp),
   1435 };
   1436 int
   1437 VOP_WHITEOUT(struct vnode *dvp,
   1438     struct componentname *cnp,
   1439     int flags)
   1440 {
   1441 	int error;
   1442 	bool mpsafe;
   1443 	struct vop_whiteout_args a;
   1444 	a.a_desc = VDESC(vop_whiteout);
   1445 	a.a_dvp = dvp;
   1446 	a.a_cnp = cnp;
   1447 	a.a_flags = flags;
   1448 	mpsafe = (dvp->v_vflag & VV_MPSAFE);
   1449 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1450 	error = (VCALL(dvp, VOFFSET(vop_whiteout), &a));
   1451 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1452 	return error;
   1453 }
   1454 
   1455 const int vop_getpages_vp_offsets[] = {
   1456 	VOPARG_OFFSETOF(struct vop_getpages_args,a_vp),
   1457 	VDESC_NO_OFFSET
   1458 };
   1459 const struct vnodeop_desc vop_getpages_desc = {
   1460 	VOP_GETPAGES_DESCOFFSET,
   1461 	"vop_getpages",
   1462 	0,
   1463 	vop_getpages_vp_offsets,
   1464 	VDESC_NO_OFFSET,
   1465 	VDESC_NO_OFFSET,
   1466 	VDESC_NO_OFFSET,
   1467 };
   1468 int
   1469 VOP_GETPAGES(struct vnode *vp,
   1470     voff_t offset,
   1471     struct vm_page **m,
   1472     int *count,
   1473     int centeridx,
   1474     vm_prot_t access_type,
   1475     int advice,
   1476     int flags)
   1477 {
   1478 	int error;
   1479 	bool mpsafe;
   1480 	struct vop_getpages_args a;
   1481 	a.a_desc = VDESC(vop_getpages);
   1482 	a.a_vp = vp;
   1483 	a.a_offset = offset;
   1484 	a.a_m = m;
   1485 	a.a_count = count;
   1486 	a.a_centeridx = centeridx;
   1487 	a.a_access_type = access_type;
   1488 	a.a_advice = advice;
   1489 	a.a_flags = flags;
   1490 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1491 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1492 	error = (VCALL(vp, VOFFSET(vop_getpages), &a));
   1493 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1494 	return error;
   1495 }
   1496 
   1497 const int vop_putpages_vp_offsets[] = {
   1498 	VOPARG_OFFSETOF(struct vop_putpages_args,a_vp),
   1499 	VDESC_NO_OFFSET
   1500 };
   1501 const struct vnodeop_desc vop_putpages_desc = {
   1502 	VOP_PUTPAGES_DESCOFFSET,
   1503 	"vop_putpages",
   1504 	0,
   1505 	vop_putpages_vp_offsets,
   1506 	VDESC_NO_OFFSET,
   1507 	VDESC_NO_OFFSET,
   1508 	VDESC_NO_OFFSET,
   1509 };
   1510 int
   1511 VOP_PUTPAGES(struct vnode *vp,
   1512     voff_t offlo,
   1513     voff_t offhi,
   1514     int flags)
   1515 {
   1516 	int error;
   1517 	bool mpsafe;
   1518 	struct vop_putpages_args a;
   1519 	a.a_desc = VDESC(vop_putpages);
   1520 	a.a_vp = vp;
   1521 	a.a_offlo = offlo;
   1522 	a.a_offhi = offhi;
   1523 	a.a_flags = flags;
   1524 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1525 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1526 	error = (VCALL(vp, VOFFSET(vop_putpages), &a));
   1527 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1528 	return error;
   1529 }
   1530 
   1531 const int vop_closeextattr_vp_offsets[] = {
   1532 	VOPARG_OFFSETOF(struct vop_closeextattr_args,a_vp),
   1533 	VDESC_NO_OFFSET
   1534 };
   1535 const struct vnodeop_desc vop_closeextattr_desc = {
   1536 	VOP_CLOSEEXTATTR_DESCOFFSET,
   1537 	"vop_closeextattr",
   1538 	0,
   1539 	vop_closeextattr_vp_offsets,
   1540 	VDESC_NO_OFFSET,
   1541 	VOPARG_OFFSETOF(struct vop_closeextattr_args, a_cred),
   1542 	VDESC_NO_OFFSET,
   1543 };
   1544 int
   1545 VOP_CLOSEEXTATTR(struct vnode *vp,
   1546     int commit,
   1547     kauth_cred_t cred)
   1548 {
   1549 	int error;
   1550 	bool mpsafe;
   1551 	struct vop_closeextattr_args a;
   1552 	a.a_desc = VDESC(vop_closeextattr);
   1553 	a.a_vp = vp;
   1554 	a.a_commit = commit;
   1555 	a.a_cred = cred;
   1556 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1557 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1558 	error = (VCALL(vp, VOFFSET(vop_closeextattr), &a));
   1559 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1560 	return error;
   1561 }
   1562 
   1563 const int vop_getextattr_vp_offsets[] = {
   1564 	VOPARG_OFFSETOF(struct vop_getextattr_args,a_vp),
   1565 	VDESC_NO_OFFSET
   1566 };
   1567 const struct vnodeop_desc vop_getextattr_desc = {
   1568 	VOP_GETEXTATTR_DESCOFFSET,
   1569 	"vop_getextattr",
   1570 	0,
   1571 	vop_getextattr_vp_offsets,
   1572 	VDESC_NO_OFFSET,
   1573 	VOPARG_OFFSETOF(struct vop_getextattr_args, a_cred),
   1574 	VDESC_NO_OFFSET,
   1575 };
   1576 int
   1577 VOP_GETEXTATTR(struct vnode *vp,
   1578     int attrnamespace,
   1579     const char *name,
   1580     struct uio *uio,
   1581     size_t *size,
   1582     kauth_cred_t cred)
   1583 {
   1584 	int error;
   1585 	bool mpsafe;
   1586 	struct vop_getextattr_args a;
   1587 	a.a_desc = VDESC(vop_getextattr);
   1588 	a.a_vp = vp;
   1589 	a.a_attrnamespace = attrnamespace;
   1590 	a.a_name = name;
   1591 	a.a_uio = uio;
   1592 	a.a_size = size;
   1593 	a.a_cred = cred;
   1594 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1595 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1596 	error = (VCALL(vp, VOFFSET(vop_getextattr), &a));
   1597 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1598 	return error;
   1599 }
   1600 
   1601 const int vop_listextattr_vp_offsets[] = {
   1602 	VOPARG_OFFSETOF(struct vop_listextattr_args,a_vp),
   1603 	VDESC_NO_OFFSET
   1604 };
   1605 const struct vnodeop_desc vop_listextattr_desc = {
   1606 	VOP_LISTEXTATTR_DESCOFFSET,
   1607 	"vop_listextattr",
   1608 	0,
   1609 	vop_listextattr_vp_offsets,
   1610 	VDESC_NO_OFFSET,
   1611 	VOPARG_OFFSETOF(struct vop_listextattr_args, a_cred),
   1612 	VDESC_NO_OFFSET,
   1613 };
   1614 int
   1615 VOP_LISTEXTATTR(struct vnode *vp,
   1616     int attrnamespace,
   1617     struct uio *uio,
   1618     size_t *size,
   1619     int flag,
   1620     kauth_cred_t cred)
   1621 {
   1622 	int error;
   1623 	bool mpsafe;
   1624 	struct vop_listextattr_args a;
   1625 	a.a_desc = VDESC(vop_listextattr);
   1626 	a.a_vp = vp;
   1627 	a.a_attrnamespace = attrnamespace;
   1628 	a.a_uio = uio;
   1629 	a.a_size = size;
   1630 	a.a_flag = flag;
   1631 	a.a_cred = cred;
   1632 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1633 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1634 	error = (VCALL(vp, VOFFSET(vop_listextattr), &a));
   1635 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1636 	return error;
   1637 }
   1638 
   1639 const int vop_openextattr_vp_offsets[] = {
   1640 	VOPARG_OFFSETOF(struct vop_openextattr_args,a_vp),
   1641 	VDESC_NO_OFFSET
   1642 };
   1643 const struct vnodeop_desc vop_openextattr_desc = {
   1644 	VOP_OPENEXTATTR_DESCOFFSET,
   1645 	"vop_openextattr",
   1646 	0,
   1647 	vop_openextattr_vp_offsets,
   1648 	VDESC_NO_OFFSET,
   1649 	VOPARG_OFFSETOF(struct vop_openextattr_args, a_cred),
   1650 	VDESC_NO_OFFSET,
   1651 };
   1652 int
   1653 VOP_OPENEXTATTR(struct vnode *vp,
   1654     kauth_cred_t cred)
   1655 {
   1656 	int error;
   1657 	bool mpsafe;
   1658 	struct vop_openextattr_args a;
   1659 	a.a_desc = VDESC(vop_openextattr);
   1660 	a.a_vp = vp;
   1661 	a.a_cred = cred;
   1662 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1663 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1664 	error = (VCALL(vp, VOFFSET(vop_openextattr), &a));
   1665 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1666 	return error;
   1667 }
   1668 
   1669 const int vop_deleteextattr_vp_offsets[] = {
   1670 	VOPARG_OFFSETOF(struct vop_deleteextattr_args,a_vp),
   1671 	VDESC_NO_OFFSET
   1672 };
   1673 const struct vnodeop_desc vop_deleteextattr_desc = {
   1674 	VOP_DELETEEXTATTR_DESCOFFSET,
   1675 	"vop_deleteextattr",
   1676 	0,
   1677 	vop_deleteextattr_vp_offsets,
   1678 	VDESC_NO_OFFSET,
   1679 	VOPARG_OFFSETOF(struct vop_deleteextattr_args, a_cred),
   1680 	VDESC_NO_OFFSET,
   1681 };
   1682 int
   1683 VOP_DELETEEXTATTR(struct vnode *vp,
   1684     int attrnamespace,
   1685     const char *name,
   1686     kauth_cred_t cred)
   1687 {
   1688 	int error;
   1689 	bool mpsafe;
   1690 	struct vop_deleteextattr_args a;
   1691 	a.a_desc = VDESC(vop_deleteextattr);
   1692 	a.a_vp = vp;
   1693 	a.a_attrnamespace = attrnamespace;
   1694 	a.a_name = name;
   1695 	a.a_cred = cred;
   1696 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1697 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1698 	error = (VCALL(vp, VOFFSET(vop_deleteextattr), &a));
   1699 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1700 	return error;
   1701 }
   1702 
   1703 const int vop_setextattr_vp_offsets[] = {
   1704 	VOPARG_OFFSETOF(struct vop_setextattr_args,a_vp),
   1705 	VDESC_NO_OFFSET
   1706 };
   1707 const struct vnodeop_desc vop_setextattr_desc = {
   1708 	VOP_SETEXTATTR_DESCOFFSET,
   1709 	"vop_setextattr",
   1710 	0,
   1711 	vop_setextattr_vp_offsets,
   1712 	VDESC_NO_OFFSET,
   1713 	VOPARG_OFFSETOF(struct vop_setextattr_args, a_cred),
   1714 	VDESC_NO_OFFSET,
   1715 };
   1716 int
   1717 VOP_SETEXTATTR(struct vnode *vp,
   1718     int attrnamespace,
   1719     const char *name,
   1720     struct uio *uio,
   1721     kauth_cred_t cred)
   1722 {
   1723 	int error;
   1724 	bool mpsafe;
   1725 	struct vop_setextattr_args a;
   1726 	a.a_desc = VDESC(vop_setextattr);
   1727 	a.a_vp = vp;
   1728 	a.a_attrnamespace = attrnamespace;
   1729 	a.a_name = name;
   1730 	a.a_uio = uio;
   1731 	a.a_cred = cred;
   1732 	mpsafe = (vp->v_vflag & VV_MPSAFE);
   1733 	if (!mpsafe) { KERNEL_LOCK(1, curlwp); }
   1734 	error = (VCALL(vp, VOFFSET(vop_setextattr), &a));
   1735 	if (!mpsafe) { KERNEL_UNLOCK_ONE(curlwp); }
   1736 	return error;
   1737 }
   1738 
   1739 const struct vnodeop_desc * const vfs_op_descs[] = {
   1740 	&vop_default_desc,	/* MUST BE FIRST */
   1741 
   1742 	&vop_bwrite_desc,
   1743 	&vop_lookup_desc,
   1744 	&vop_create_desc,
   1745 	&vop_mknod_desc,
   1746 	&vop_open_desc,
   1747 	&vop_close_desc,
   1748 	&vop_access_desc,
   1749 	&vop_getattr_desc,
   1750 	&vop_setattr_desc,
   1751 	&vop_read_desc,
   1752 	&vop_write_desc,
   1753 	&vop_fallocate_desc,
   1754 	&vop_fdiscard_desc,
   1755 	&vop_ioctl_desc,
   1756 	&vop_fcntl_desc,
   1757 	&vop_poll_desc,
   1758 	&vop_kqfilter_desc,
   1759 	&vop_revoke_desc,
   1760 	&vop_mmap_desc,
   1761 	&vop_fsync_desc,
   1762 	&vop_seek_desc,
   1763 	&vop_remove_desc,
   1764 	&vop_link_desc,
   1765 	&vop_rename_desc,
   1766 	&vop_mkdir_desc,
   1767 	&vop_rmdir_desc,
   1768 	&vop_symlink_desc,
   1769 	&vop_readdir_desc,
   1770 	&vop_readlink_desc,
   1771 	&vop_abortop_desc,
   1772 	&vop_inactive_desc,
   1773 	&vop_reclaim_desc,
   1774 	&vop_lock_desc,
   1775 	&vop_unlock_desc,
   1776 	&vop_bmap_desc,
   1777 	&vop_strategy_desc,
   1778 	&vop_print_desc,
   1779 	&vop_islocked_desc,
   1780 	&vop_pathconf_desc,
   1781 	&vop_advlock_desc,
   1782 	&vop_whiteout_desc,
   1783 	&vop_getpages_desc,
   1784 	&vop_putpages_desc,
   1785 	&vop_closeextattr_desc,
   1786 	&vop_getextattr_desc,
   1787 	&vop_listextattr_desc,
   1788 	&vop_openextattr_desc,
   1789 	&vop_deleteextattr_desc,
   1790 	&vop_setextattr_desc,
   1791 	NULL
   1792 };
   1793