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