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