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