Home | History | Annotate | Line # | Download | only in kern
vnode_if.c revision 1.115
      1  1.113  dholland /*	$NetBSD: vnode_if.c,v 1.115 2021/10/20 03:13:14 thorpej 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.115   thorpej  *	NetBSD: vnode_if.src,v 1.83 2021/10/20 03:08:18 thorpej Exp
      9    1.1       cgd  * by the script:
     10  1.115   thorpej  *	NetBSD: vnode_if.sh,v 1.72 2021/10/20 03:08:18 thorpej 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.113  dholland __KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.115 2021/10/20 03:13:14 thorpej 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.115   thorpej #include <sys/fcntl.h>
     49    1.1       cgd #include <sys/vnode.h>
     50   1.72        ad #include <sys/lock.h>
     51   1.97   hannken #include <sys/fstrans.h>
     52    1.1       cgd 
     53  1.108   hannken enum fst_op { FST_NO, FST_YES, FST_LAZY, FST_TRY };
     54  1.105   hannken 
     55  1.105   hannken static inline int
     56  1.105   hannken vop_pre(vnode_t *vp, struct mount **mp, bool *mpsafe, enum fst_op op)
     57  1.105   hannken {
     58  1.105   hannken 	int error;
     59  1.105   hannken 
     60  1.105   hannken 	*mpsafe = (vp->v_vflag & VV_MPSAFE);
     61  1.105   hannken 
     62  1.105   hannken 	if (!*mpsafe) {
     63  1.105   hannken 		KERNEL_LOCK(1, curlwp);
     64  1.105   hannken 	}
     65  1.105   hannken 
     66  1.108   hannken 	if (op == FST_YES || op == FST_LAZY || op == FST_TRY) {
     67  1.105   hannken 		for (;;) {
     68  1.105   hannken 			*mp = vp->v_mount;
     69  1.105   hannken 			if (op == FST_TRY) {
     70  1.106   hannken 				error = fstrans_start_nowait(*mp);
     71  1.105   hannken 				if (error) {
     72  1.105   hannken 					if (!*mpsafe) {
     73  1.105   hannken 						KERNEL_UNLOCK_ONE(curlwp);
     74  1.105   hannken 					}
     75  1.105   hannken 					return error;
     76  1.105   hannken 				}
     77  1.108   hannken 			} else if (op == FST_LAZY) {
     78  1.108   hannken 				fstrans_start_lazy(*mp);
     79  1.105   hannken 			} else {
     80  1.106   hannken 				fstrans_start(*mp);
     81  1.105   hannken 			}
     82  1.105   hannken 			if (__predict_true(*mp == vp->v_mount))
     83  1.105   hannken 				break;
     84  1.105   hannken 			fstrans_done(*mp);
     85  1.105   hannken 		}
     86  1.105   hannken 	} else {
     87  1.105   hannken 		*mp = vp->v_mount;
     88  1.105   hannken 	}
     89  1.105   hannken 
     90  1.105   hannken 	return 0;
     91  1.105   hannken }
     92  1.105   hannken 
     93  1.115   thorpej static inline u_quad_t
     94  1.115   thorpej vop_pre_get_size(struct vnode *vp)
     95  1.115   thorpej {
     96  1.115   thorpej 	mutex_enter(vp->v_interlock);
     97  1.115   thorpej 	KASSERT(vp->v_size != VSIZENOTSET);
     98  1.115   thorpej 	u_quad_t rv = (u_quad_t)vp->v_size;
     99  1.115   thorpej 	mutex_exit(vp->v_interlock);
    100  1.115   thorpej 
    101  1.115   thorpej 	return rv;
    102  1.115   thorpej }
    103  1.115   thorpej 
    104  1.115   thorpej /*
    105  1.115   thorpej  * VOP_RMDIR(), VOP_REMOVE(), and VOP_RENAME() need special handling
    106  1.115   thorpej  * because they each drop the caller's references on one or more of
    107  1.115   thorpej  * their arguments.  While there must be an open file descriptor in
    108  1.115   thorpej  * associated with a vnode in order for knotes to be attached to it,
    109  1.115   thorpej  * that status could change during the course of the operation.  So,
    110  1.115   thorpej  * for the vnode arguments that are WILLRELE or WILLPUT, we check
    111  1.115   thorpej  * pre-op if there are registered knotes, take a hold count if so,
    112  1.115   thorpej  * and post-op release the hold after activating any knotes still
    113  1.115   thorpej  * associated with the vnode.
    114  1.115   thorpej  */
    115  1.115   thorpej 
    116  1.115   thorpej #define	VOP_POST_KNOTE(thisvp, e, n)					\
    117  1.115   thorpej do {									\
    118  1.115   thorpej 	if (__predict_true((e) == 0)) {					\
    119  1.115   thorpej 		/*							\
    120  1.115   thorpej 		 * VN_KNOTE() does the VN_KEVENT_INTEREST()		\
    121  1.115   thorpej 		 * check for us.					\
    122  1.115   thorpej 		 */							\
    123  1.115   thorpej 		VN_KNOTE((thisvp), (n));				\
    124  1.115   thorpej 	}								\
    125  1.115   thorpej } while (/*CONSTCOND*/0)
    126  1.115   thorpej 
    127  1.115   thorpej #define	VOP_POST_KNOTE_HELD(thisvp, e, n)				\
    128  1.115   thorpej do {									\
    129  1.115   thorpej 	/*								\
    130  1.115   thorpej 	 * We don't perform a VN_KEVENT_INTEREST() check here; it	\
    131  1.115   thorpej 	 * was already performed when we did the pre-op work that	\
    132  1.115   thorpej 	 * caused the vnode to be held in the first place.		\
    133  1.115   thorpej 	 */								\
    134  1.115   thorpej 	mutex_enter((thisvp)->v_interlock);				\
    135  1.115   thorpej 	if (__predict_true((e) == 0)) {					\
    136  1.115   thorpej 		knote(&(thisvp)->v_klist, (n));				\
    137  1.115   thorpej 	}								\
    138  1.115   thorpej 	holdrelel((thisvp));						\
    139  1.115   thorpej 	mutex_exit((thisvp)->v_interlock);				\
    140  1.115   thorpej 	/*								\
    141  1.115   thorpej 	 * thisvp might be gone now!  Don't touch!			\
    142  1.115   thorpej 	 */								\
    143  1.115   thorpej } while (/*CONSTCOND*/0)
    144  1.115   thorpej 
    145  1.115   thorpej #define	vop_create_post(ap, e)						\
    146  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), NOTE_WRITE)
    147  1.115   thorpej 
    148  1.115   thorpej #define	vop_mknod_post(ap, e)						\
    149  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), NOTE_WRITE)
    150  1.115   thorpej 
    151  1.115   thorpej #define	vop_setattr_pre(ap)						\
    152  1.115   thorpej 	u_quad_t osize = 0;						\
    153  1.115   thorpej 	long vp_events =						\
    154  1.115   thorpej 	    VN_KEVENT_INTEREST((ap)->a_vp, NOTE_ATTRIB | NOTE_EXTEND)	\
    155  1.115   thorpej 	    ? NOTE_ATTRIB : 0;						\
    156  1.115   thorpej 	bool check_extend = false;					\
    157  1.115   thorpej 	if (__predict_false(vp_events != 0 &&				\
    158  1.115   thorpej 	    (ap)->a_vap->va_size != VNOVALSIZE)) {			\
    159  1.115   thorpej 		check_extend = true;					\
    160  1.115   thorpej 		osize = vop_pre_get_size((ap)->a_vp);			\
    161  1.115   thorpej 	}
    162  1.115   thorpej 
    163  1.115   thorpej #define	vop_setattr_post(ap, e)						\
    164  1.115   thorpej do {									\
    165  1.115   thorpej 	if (__predict_false(vp_events != 0)) {				\
    166  1.115   thorpej 		if (__predict_false(check_extend &&			\
    167  1.115   thorpej 		    (ap)->a_vap->va_size > osize)) {			\
    168  1.115   thorpej 			vp_events |= NOTE_EXTEND;			\
    169  1.115   thorpej 		}							\
    170  1.115   thorpej 		VOP_POST_KNOTE((ap)->a_vp, (e), vp_events);		\
    171  1.115   thorpej 	}								\
    172  1.115   thorpej } while (/*CONSTCOND*/0)
    173  1.115   thorpej 
    174  1.115   thorpej #define	vop_setacl_post(ap, e)						\
    175  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_vp, (e), NOTE_ATTRIB)
    176  1.115   thorpej 
    177  1.115   thorpej #define	vop_link_post(ap, e)						\
    178  1.115   thorpej do {									\
    179  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), NOTE_WRITE);			\
    180  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_vp, (e), NOTE_LINK);			\
    181  1.115   thorpej } while (/*CONSTCOND*/0)
    182  1.115   thorpej 
    183  1.115   thorpej #define	vop_mkdir_post(ap, e)						\
    184  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), NOTE_WRITE | NOTE_LINK)
    185  1.115   thorpej 
    186  1.115   thorpej #define	vop_remove_pre_common(ap)					\
    187  1.115   thorpej 	bool post_event_vp =						\
    188  1.115   thorpej 	    VN_KEVENT_INTEREST((ap)->a_vp, NOTE_DELETE | NOTE_LINK);	\
    189  1.115   thorpej 	if (__predict_false(post_event_vp)) {				\
    190  1.115   thorpej 		vhold((ap)->a_vp);					\
    191  1.115   thorpej 	}
    192  1.115   thorpej 
    193  1.115   thorpej #define	vop_remove_post_common(ap, e, dn, lc)				\
    194  1.115   thorpej do {									\
    195  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), (dn));				\
    196  1.115   thorpej 	if (__predict_false(post_event_vp)) {				\
    197  1.115   thorpej 		VOP_POST_KNOTE_HELD((ap)->a_vp, (e),			\
    198  1.115   thorpej 		    (lc) ? NOTE_LINK : NOTE_DELETE);			\
    199  1.115   thorpej 	}								\
    200  1.115   thorpej } while (/*CONSTCOND*/0)
    201  1.115   thorpej 
    202  1.115   thorpej /*
    203  1.115   thorpej  * One could make the argument that VOP_REMOVE() should send NOTE_LINK
    204  1.115   thorpej  * on vp if the resulting link count is not zero, but that's not what
    205  1.115   thorpej  * the documentation says.
    206  1.115   thorpej  *
    207  1.115   thorpej  * We could change this easily by passing ap->ctx_vp_new_nlink to
    208  1.115   thorpej  * vop_remove_post_common().
    209  1.115   thorpej  */
    210  1.115   thorpej #define	vop_remove_pre(ap)						\
    211  1.115   thorpej 	vop_remove_pre_common((ap));					\
    212  1.115   thorpej 	/*								\
    213  1.115   thorpej 	 * We will assume that the file being removed is deleted unless	\
    214  1.115   thorpej 	 * the file system tells us otherwise by updating vp_new_nlink.	\
    215  1.115   thorpej 	 */								\
    216  1.115   thorpej 	(ap)->ctx_vp_new_nlink = 0;
    217  1.115   thorpej 
    218  1.115   thorpej #define	vop_remove_post(ap, e)						\
    219  1.115   thorpej 	vop_remove_post_common((ap), (e), NOTE_WRITE, 0)
    220  1.115   thorpej 
    221  1.115   thorpej #define	vop_rmdir_pre(ap)						\
    222  1.115   thorpej 	vop_remove_pre_common(ap)
    223  1.115   thorpej 
    224  1.115   thorpej #define	vop_rmdir_post(ap, e)						\
    225  1.115   thorpej 	vop_remove_post_common((ap), (e), NOTE_WRITE | NOTE_LINK, 0)
    226  1.115   thorpej 
    227  1.115   thorpej #define	vop_symlink_post(ap, e)						\
    228  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_dvp, (e), NOTE_WRITE)
    229  1.115   thorpej 
    230  1.115   thorpej #define	vop_open_post(ap, e)						\
    231  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_vp, (e), NOTE_OPEN)
    232  1.115   thorpej 
    233  1.115   thorpej #define	vop_close_post(ap, e)						\
    234  1.115   thorpej do {									\
    235  1.115   thorpej 	extern int (**dead_vnodeop_p)(void *);				\
    236  1.115   thorpej 									\
    237  1.115   thorpej 	/* See the definition of VN_KNOTE() in <sys/vnode.h>. */	\
    238  1.115   thorpej 	if (__predict_false(VN_KEVENT_INTEREST((ap)->a_vp,		\
    239  1.115   thorpej 	    NOTE_CLOSE_WRITE | NOTE_CLOSE) && (e) == 0)) {		\
    240  1.115   thorpej 		struct vnode *thisvp = (ap)->a_vp;			\
    241  1.115   thorpej 		mutex_enter(thisvp->v_interlock);			\
    242  1.115   thorpej 		/*							\
    243  1.115   thorpej 		 * Don't send NOTE_CLOSE when closing a vnode that's	\
    244  1.115   thorpej 		 * been reclaimed or otherwise revoked; a NOTE_REVOKE	\
    245  1.115   thorpej 		 * has already been sent, and this close is effectively	\
    246  1.115   thorpej 		 * meaningless from the watcher's perspective.		\
    247  1.115   thorpej 		 */							\
    248  1.115   thorpej 		if (__predict_true(thisvp->v_op != dead_vnodeop_p)) {	\
    249  1.115   thorpej 			knote(&thisvp->v_klist,				\
    250  1.115   thorpej 			    ((ap)->a_fflag & FWRITE)			\
    251  1.115   thorpej 			    ? NOTE_CLOSE_WRITE : NOTE_CLOSE);		\
    252  1.115   thorpej 		}							\
    253  1.115   thorpej 		mutex_exit(thisvp->v_interlock);			\
    254  1.115   thorpej 	}								\
    255  1.115   thorpej } while (/*CONSTCOND*/0)
    256  1.115   thorpej 
    257  1.115   thorpej #define	vop_read_post(ap, e)						\
    258  1.115   thorpej 	VOP_POST_KNOTE((ap)->a_vp, (e), NOTE_READ)
    259  1.115   thorpej 
    260  1.115   thorpej #define	vop_write_pre(ap)						\
    261  1.115   thorpej 	off_t ooffset = 0, noffset = 0;					\
    262  1.115   thorpej 	u_quad_t osize = 0;						\
    263  1.115   thorpej 	long vp_events =						\
    264  1.115   thorpej 	    VN_KEVENT_INTEREST((ap)->a_vp, NOTE_WRITE | NOTE_EXTEND)	\
    265  1.115   thorpej 	    ? NOTE_WRITE : 0;						\
    266  1.115   thorpej 	if (__predict_false(vp_events != 0)) {				\
    267  1.115   thorpej 		ooffset = (ap)->a_uio->uio_offset;			\
    268  1.115   thorpej 		osize = vop_pre_get_size((ap)->a_vp);			\
    269  1.115   thorpej 	}
    270  1.115   thorpej 
    271  1.115   thorpej #define	vop_write_post(ap, e)						\
    272  1.115   thorpej do {									\
    273  1.115   thorpej 	/*								\
    274  1.115   thorpej 	 * If any data was written, we'll post an event, even if	\
    275  1.115   thorpej 	 * there was an error.						\
    276  1.115   thorpej 	 */								\
    277  1.115   thorpej 	noffset = (ap)->a_uio->uio_offset;				\
    278  1.115   thorpej 	if (__predict_false(vp_events != 0 && noffset > ooffset)) {	\
    279  1.115   thorpej 		if (noffset > osize) {					\
    280  1.115   thorpej 			vp_events |= NOTE_EXTEND;			\
    281  1.115   thorpej 		}							\
    282  1.115   thorpej 		VN_KNOTE((ap)->a_vp, vp_events);			\
    283  1.115   thorpej 	}								\
    284  1.115   thorpej } while (/*CONSTCOND*/0)
    285  1.115   thorpej 
    286  1.105   hannken static inline void
    287  1.105   hannken vop_post(vnode_t *vp, struct mount *mp, bool mpsafe, enum fst_op op)
    288  1.105   hannken {
    289  1.105   hannken 
    290  1.108   hannken 	if (op == FST_YES || op == FST_LAZY) {
    291  1.105   hannken 		fstrans_done(mp);
    292  1.105   hannken 	}
    293  1.105   hannken 
    294  1.105   hannken 	if (!mpsafe) {
    295  1.105   hannken 		KERNEL_UNLOCK_ONE(curlwp);
    296  1.105   hannken 	}
    297  1.105   hannken }
    298  1.105   hannken 
    299   1.34     lukem const struct vnodeop_desc vop_default_desc = {
    300    1.1       cgd 	0,
    301    1.1       cgd 	"default",
    302    1.1       cgd 	0,
    303    1.1       cgd 	NULL,
    304    1.1       cgd 	VDESC_NO_OFFSET,
    305    1.1       cgd 	VDESC_NO_OFFSET,
    306    1.1       cgd 	VDESC_NO_OFFSET,
    307    1.1       cgd };
    308    1.1       cgd 
    309    1.1       cgd 
    310   1.33  jdolecek const int vop_bwrite_vp_offsets[] = {
    311   1.88   hannken 	VOPARG_OFFSETOF(struct vop_bwrite_args,a_vp),
    312   1.33  jdolecek 	VDESC_NO_OFFSET
    313   1.33  jdolecek };
    314   1.33  jdolecek const struct vnodeop_desc vop_bwrite_desc = {
    315   1.67     pooka 	VOP_BWRITE_DESCOFFSET,
    316   1.33  jdolecek 	"vop_bwrite",
    317   1.33  jdolecek 	0,
    318   1.33  jdolecek 	vop_bwrite_vp_offsets,
    319   1.33  jdolecek 	VDESC_NO_OFFSET,
    320   1.33  jdolecek 	VDESC_NO_OFFSET,
    321   1.33  jdolecek 	VDESC_NO_OFFSET,
    322   1.33  jdolecek };
    323   1.33  jdolecek int
    324   1.88   hannken VOP_BWRITE(struct vnode *vp,
    325   1.88   hannken     struct buf *bp)
    326   1.33  jdolecek {
    327   1.72        ad 	int error;
    328   1.72        ad 	bool mpsafe;
    329   1.33  jdolecek 	struct vop_bwrite_args a;
    330  1.105   hannken 	struct mount *mp;
    331   1.33  jdolecek 	a.a_desc = VDESC(vop_bwrite);
    332   1.88   hannken 	a.a_vp = vp;
    333   1.33  jdolecek 	a.a_bp = bp;
    334  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
    335  1.105   hannken 	if (error)
    336  1.105   hannken 		return error;
    337   1.88   hannken 	error = (VCALL(vp, VOFFSET(vop_bwrite), &a));
    338  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
    339   1.72        ad 	return error;
    340   1.33  jdolecek }
    341   1.33  jdolecek 
    342  1.113  dholland const int vop_parsepath_vp_offsets[] = {
    343  1.113  dholland 	VOPARG_OFFSETOF(struct vop_parsepath_args,a_dvp),
    344  1.113  dholland 	VDESC_NO_OFFSET
    345  1.113  dholland };
    346  1.113  dholland const struct vnodeop_desc vop_parsepath_desc = {
    347  1.113  dholland 	VOP_PARSEPATH_DESCOFFSET,
    348  1.113  dholland 	"vop_parsepath",
    349  1.113  dholland 	0,
    350  1.113  dholland 	vop_parsepath_vp_offsets,
    351  1.113  dholland 	VDESC_NO_OFFSET,
    352  1.113  dholland 	VDESC_NO_OFFSET,
    353  1.113  dholland 	VDESC_NO_OFFSET,
    354  1.113  dholland };
    355  1.113  dholland int
    356  1.113  dholland VOP_PARSEPATH(struct vnode *dvp,
    357  1.113  dholland     const char *name,
    358  1.113  dholland     size_t *retval)
    359  1.113  dholland {
    360  1.113  dholland 	int error;
    361  1.113  dholland 	bool mpsafe;
    362  1.113  dholland 	struct vop_parsepath_args a;
    363  1.113  dholland 	struct mount *mp;
    364  1.113  dholland 	a.a_desc = VDESC(vop_parsepath);
    365  1.113  dholland 	a.a_dvp = dvp;
    366  1.113  dholland 	a.a_name = name;
    367  1.113  dholland 	a.a_retval = retval;
    368  1.114  dholland 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
    369  1.113  dholland 	if (error)
    370  1.113  dholland 		return error;
    371  1.113  dholland 	error = (VCALL(dvp, VOFFSET(vop_parsepath), &a));
    372  1.114  dholland 	vop_post(dvp, mp, mpsafe, FST_NO);
    373  1.113  dholland 	return error;
    374  1.113  dholland }
    375  1.113  dholland 
    376   1.31  jdolecek const int vop_lookup_vp_offsets[] = {
    377   1.92   hannken 	VOPARG_OFFSETOF(struct vop_lookup_v2_args,a_dvp),
    378    1.1       cgd 	VDESC_NO_OFFSET
    379    1.1       cgd };
    380   1.33  jdolecek const struct vnodeop_desc vop_lookup_desc = {
    381   1.67     pooka 	VOP_LOOKUP_DESCOFFSET,
    382    1.1       cgd 	"vop_lookup",
    383    1.1       cgd 	0,
    384    1.1       cgd 	vop_lookup_vp_offsets,
    385   1.92   hannken 	VOPARG_OFFSETOF(struct vop_lookup_v2_args, a_vpp),
    386    1.1       cgd 	VDESC_NO_OFFSET,
    387   1.92   hannken 	VOPARG_OFFSETOF(struct vop_lookup_v2_args, a_cnp),
    388    1.1       cgd };
    389   1.23   thorpej int
    390   1.60   thorpej VOP_LOOKUP(struct vnode *dvp,
    391   1.60   thorpej     struct vnode **vpp,
    392   1.60   thorpej     struct componentname *cnp)
    393   1.23   thorpej {
    394   1.72        ad 	int error;
    395   1.72        ad 	bool mpsafe;
    396   1.92   hannken 	struct vop_lookup_v2_args a;
    397  1.105   hannken 	struct mount *mp;
    398   1.23   thorpej 	a.a_desc = VDESC(vop_lookup);
    399   1.23   thorpej 	a.a_dvp = dvp;
    400   1.23   thorpej 	a.a_vpp = vpp;
    401   1.23   thorpej 	a.a_cnp = cnp;
    402  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
    403  1.105   hannken 	if (error)
    404  1.105   hannken 		return error;
    405   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_lookup), &a));
    406  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
    407   1.69     pooka #ifdef DIAGNOSTIC
    408   1.72        ad 	if (error == 0)
    409   1.69     pooka 		KASSERT((*vpp)->v_size != VSIZENOTSET
    410   1.69     pooka 		    && (*vpp)->v_writesize != VSIZENOTSET);
    411   1.69     pooka #endif /* DIAGNOSTIC */
    412   1.72        ad 	return error;
    413   1.23   thorpej }
    414    1.1       cgd 
    415   1.31  jdolecek const int vop_create_vp_offsets[] = {
    416   1.91   hannken 	VOPARG_OFFSETOF(struct vop_create_v3_args,a_dvp),
    417    1.1       cgd 	VDESC_NO_OFFSET
    418    1.1       cgd };
    419   1.33  jdolecek const struct vnodeop_desc vop_create_desc = {
    420   1.67     pooka 	VOP_CREATE_DESCOFFSET,
    421    1.1       cgd 	"vop_create",
    422   1.90   hannken 	0,
    423    1.1       cgd 	vop_create_vp_offsets,
    424   1.91   hannken 	VOPARG_OFFSETOF(struct vop_create_v3_args, a_vpp),
    425    1.1       cgd 	VDESC_NO_OFFSET,
    426   1.91   hannken 	VOPARG_OFFSETOF(struct vop_create_v3_args, a_cnp),
    427    1.1       cgd };
    428   1.23   thorpej int
    429   1.60   thorpej VOP_CREATE(struct vnode *dvp,
    430   1.60   thorpej     struct vnode **vpp,
    431   1.60   thorpej     struct componentname *cnp,
    432   1.60   thorpej     struct vattr *vap)
    433   1.23   thorpej {
    434   1.72        ad 	int error;
    435   1.72        ad 	bool mpsafe;
    436   1.91   hannken 	struct vop_create_v3_args a;
    437  1.105   hannken 	struct mount *mp;
    438   1.23   thorpej 	a.a_desc = VDESC(vop_create);
    439   1.23   thorpej 	a.a_dvp = dvp;
    440   1.23   thorpej 	a.a_vpp = vpp;
    441   1.23   thorpej 	a.a_cnp = cnp;
    442   1.23   thorpej 	a.a_vap = vap;
    443  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
    444  1.105   hannken 	if (error)
    445  1.105   hannken 		return error;
    446   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_create), &a));
    447  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
    448  1.115   thorpej 	vop_create_post(&a, error);
    449   1.69     pooka #ifdef DIAGNOSTIC
    450   1.72        ad 	if (error == 0)
    451   1.69     pooka 		KASSERT((*vpp)->v_size != VSIZENOTSET
    452   1.69     pooka 		    && (*vpp)->v_writesize != VSIZENOTSET);
    453   1.69     pooka #endif /* DIAGNOSTIC */
    454   1.72        ad 	return error;
    455   1.23   thorpej }
    456    1.1       cgd 
    457   1.31  jdolecek const int vop_mknod_vp_offsets[] = {
    458   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mknod_v3_args,a_dvp),
    459    1.1       cgd 	VDESC_NO_OFFSET
    460    1.1       cgd };
    461   1.33  jdolecek const struct vnodeop_desc vop_mknod_desc = {
    462   1.67     pooka 	VOP_MKNOD_DESCOFFSET,
    463    1.1       cgd 	"vop_mknod",
    464   1.90   hannken 	0,
    465    1.1       cgd 	vop_mknod_vp_offsets,
    466   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mknod_v3_args, a_vpp),
    467    1.1       cgd 	VDESC_NO_OFFSET,
    468   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mknod_v3_args, a_cnp),
    469    1.1       cgd };
    470   1.23   thorpej int
    471   1.60   thorpej VOP_MKNOD(struct vnode *dvp,
    472   1.60   thorpej     struct vnode **vpp,
    473   1.60   thorpej     struct componentname *cnp,
    474   1.60   thorpej     struct vattr *vap)
    475   1.23   thorpej {
    476   1.72        ad 	int error;
    477   1.72        ad 	bool mpsafe;
    478   1.91   hannken 	struct vop_mknod_v3_args a;
    479  1.105   hannken 	struct mount *mp;
    480   1.23   thorpej 	a.a_desc = VDESC(vop_mknod);
    481   1.23   thorpej 	a.a_dvp = dvp;
    482   1.23   thorpej 	a.a_vpp = vpp;
    483   1.23   thorpej 	a.a_cnp = cnp;
    484   1.23   thorpej 	a.a_vap = vap;
    485  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
    486  1.105   hannken 	if (error)
    487  1.105   hannken 		return error;
    488   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_mknod), &a));
    489  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
    490  1.115   thorpej 	vop_mknod_post(&a, error);
    491   1.69     pooka #ifdef DIAGNOSTIC
    492   1.72        ad 	if (error == 0)
    493   1.69     pooka 		KASSERT((*vpp)->v_size != VSIZENOTSET
    494   1.69     pooka 		    && (*vpp)->v_writesize != VSIZENOTSET);
    495   1.69     pooka #endif /* DIAGNOSTIC */
    496   1.72        ad 	return error;
    497   1.23   thorpej }
    498    1.1       cgd 
    499   1.31  jdolecek const int vop_open_vp_offsets[] = {
    500    1.1       cgd 	VOPARG_OFFSETOF(struct vop_open_args,a_vp),
    501    1.1       cgd 	VDESC_NO_OFFSET
    502    1.1       cgd };
    503   1.33  jdolecek const struct vnodeop_desc vop_open_desc = {
    504   1.67     pooka 	VOP_OPEN_DESCOFFSET,
    505    1.1       cgd 	"vop_open",
    506    1.1       cgd 	0,
    507    1.1       cgd 	vop_open_vp_offsets,
    508    1.1       cgd 	VDESC_NO_OFFSET,
    509    1.1       cgd 	VOPARG_OFFSETOF(struct vop_open_args, a_cred),
    510    1.1       cgd 	VDESC_NO_OFFSET,
    511    1.1       cgd };
    512   1.23   thorpej int
    513   1.60   thorpej VOP_OPEN(struct vnode *vp,
    514   1.60   thorpej     int mode,
    515   1.73     pooka     kauth_cred_t cred)
    516   1.23   thorpej {
    517   1.72        ad 	int error;
    518   1.72        ad 	bool mpsafe;
    519   1.23   thorpej 	struct vop_open_args a;
    520  1.105   hannken 	struct mount *mp;
    521   1.23   thorpej 	a.a_desc = VDESC(vop_open);
    522   1.23   thorpej 	a.a_vp = vp;
    523   1.23   thorpej 	a.a_mode = mode;
    524   1.23   thorpej 	a.a_cred = cred;
    525  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    526  1.105   hannken 	if (error)
    527  1.105   hannken 		return error;
    528   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_open), &a));
    529  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    530  1.115   thorpej 	vop_open_post(&a, error);
    531   1.72        ad 	return error;
    532   1.23   thorpej }
    533    1.1       cgd 
    534   1.31  jdolecek const int vop_close_vp_offsets[] = {
    535    1.1       cgd 	VOPARG_OFFSETOF(struct vop_close_args,a_vp),
    536    1.1       cgd 	VDESC_NO_OFFSET
    537    1.1       cgd };
    538   1.33  jdolecek const struct vnodeop_desc vop_close_desc = {
    539   1.67     pooka 	VOP_CLOSE_DESCOFFSET,
    540    1.1       cgd 	"vop_close",
    541    1.1       cgd 	0,
    542    1.1       cgd 	vop_close_vp_offsets,
    543    1.1       cgd 	VDESC_NO_OFFSET,
    544    1.1       cgd 	VOPARG_OFFSETOF(struct vop_close_args, a_cred),
    545    1.1       cgd 	VDESC_NO_OFFSET,
    546    1.1       cgd };
    547   1.23   thorpej int
    548   1.60   thorpej VOP_CLOSE(struct vnode *vp,
    549   1.60   thorpej     int fflag,
    550   1.73     pooka     kauth_cred_t cred)
    551   1.23   thorpej {
    552   1.72        ad 	int error;
    553   1.72        ad 	bool mpsafe;
    554   1.23   thorpej 	struct vop_close_args a;
    555  1.105   hannken 	struct mount *mp;
    556   1.23   thorpej 	a.a_desc = VDESC(vop_close);
    557   1.23   thorpej 	a.a_vp = vp;
    558   1.23   thorpej 	a.a_fflag = fflag;
    559   1.23   thorpej 	a.a_cred = cred;
    560  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    561  1.105   hannken 	if (error)
    562  1.105   hannken 		return error;
    563   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_close), &a));
    564  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    565  1.115   thorpej 	vop_close_post(&a, error);
    566   1.72        ad 	return error;
    567   1.23   thorpej }
    568    1.1       cgd 
    569   1.31  jdolecek const int vop_access_vp_offsets[] = {
    570    1.1       cgd 	VOPARG_OFFSETOF(struct vop_access_args,a_vp),
    571    1.1       cgd 	VDESC_NO_OFFSET
    572    1.1       cgd };
    573   1.33  jdolecek const struct vnodeop_desc vop_access_desc = {
    574   1.67     pooka 	VOP_ACCESS_DESCOFFSET,
    575    1.1       cgd 	"vop_access",
    576    1.1       cgd 	0,
    577    1.1       cgd 	vop_access_vp_offsets,
    578    1.1       cgd 	VDESC_NO_OFFSET,
    579    1.1       cgd 	VOPARG_OFFSETOF(struct vop_access_args, a_cred),
    580    1.1       cgd 	VDESC_NO_OFFSET,
    581    1.1       cgd };
    582   1.23   thorpej int
    583   1.60   thorpej VOP_ACCESS(struct vnode *vp,
    584  1.111  christos     accmode_t accmode,
    585   1.73     pooka     kauth_cred_t cred)
    586   1.23   thorpej {
    587   1.72        ad 	int error;
    588   1.72        ad 	bool mpsafe;
    589   1.23   thorpej 	struct vop_access_args a;
    590  1.105   hannken 	struct mount *mp;
    591   1.23   thorpej 	a.a_desc = VDESC(vop_access);
    592   1.23   thorpej 	a.a_vp = vp;
    593  1.111  christos 	a.a_accmode = accmode;
    594   1.23   thorpej 	a.a_cred = cred;
    595  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    596  1.105   hannken 	if (error)
    597  1.105   hannken 		return error;
    598   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_access), &a));
    599  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    600   1.72        ad 	return error;
    601   1.23   thorpej }
    602    1.1       cgd 
    603  1.111  christos const int vop_accessx_vp_offsets[] = {
    604  1.111  christos 	VOPARG_OFFSETOF(struct vop_accessx_args,a_vp),
    605  1.111  christos 	VDESC_NO_OFFSET
    606  1.111  christos };
    607  1.111  christos const struct vnodeop_desc vop_accessx_desc = {
    608  1.111  christos 	VOP_ACCESSX_DESCOFFSET,
    609  1.111  christos 	"vop_accessx",
    610  1.111  christos 	0,
    611  1.111  christos 	vop_accessx_vp_offsets,
    612  1.111  christos 	VDESC_NO_OFFSET,
    613  1.111  christos 	VOPARG_OFFSETOF(struct vop_accessx_args, a_cred),
    614  1.111  christos 	VDESC_NO_OFFSET,
    615  1.111  christos };
    616  1.111  christos int
    617  1.111  christos VOP_ACCESSX(struct vnode *vp,
    618  1.111  christos     accmode_t accmode,
    619  1.111  christos     kauth_cred_t cred)
    620  1.111  christos {
    621  1.111  christos 	int error;
    622  1.111  christos 	bool mpsafe;
    623  1.111  christos 	struct vop_accessx_args a;
    624  1.111  christos 	struct mount *mp;
    625  1.111  christos 	a.a_desc = VDESC(vop_accessx);
    626  1.111  christos 	a.a_vp = vp;
    627  1.111  christos 	a.a_accmode = accmode;
    628  1.111  christos 	a.a_cred = cred;
    629  1.111  christos 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    630  1.111  christos 	if (error)
    631  1.111  christos 		return error;
    632  1.111  christos 	error = (VCALL(vp, VOFFSET(vop_accessx), &a));
    633  1.111  christos 	vop_post(vp, mp, mpsafe, FST_NO);
    634  1.111  christos 	return error;
    635  1.111  christos }
    636  1.111  christos 
    637   1.31  jdolecek const int vop_getattr_vp_offsets[] = {
    638    1.1       cgd 	VOPARG_OFFSETOF(struct vop_getattr_args,a_vp),
    639    1.1       cgd 	VDESC_NO_OFFSET
    640    1.1       cgd };
    641   1.33  jdolecek const struct vnodeop_desc vop_getattr_desc = {
    642   1.67     pooka 	VOP_GETATTR_DESCOFFSET,
    643    1.1       cgd 	"vop_getattr",
    644    1.1       cgd 	0,
    645    1.1       cgd 	vop_getattr_vp_offsets,
    646    1.1       cgd 	VDESC_NO_OFFSET,
    647    1.1       cgd 	VOPARG_OFFSETOF(struct vop_getattr_args, a_cred),
    648    1.1       cgd 	VDESC_NO_OFFSET,
    649    1.1       cgd };
    650   1.23   thorpej int
    651   1.60   thorpej VOP_GETATTR(struct vnode *vp,
    652   1.60   thorpej     struct vattr *vap,
    653   1.73     pooka     kauth_cred_t cred)
    654   1.23   thorpej {
    655   1.72        ad 	int error;
    656   1.72        ad 	bool mpsafe;
    657   1.23   thorpej 	struct vop_getattr_args a;
    658  1.105   hannken 	struct mount *mp;
    659   1.23   thorpej 	a.a_desc = VDESC(vop_getattr);
    660   1.23   thorpej 	a.a_vp = vp;
    661   1.23   thorpej 	a.a_vap = vap;
    662   1.23   thorpej 	a.a_cred = cred;
    663  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    664  1.105   hannken 	if (error)
    665  1.105   hannken 		return error;
    666   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_getattr), &a));
    667  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    668   1.72        ad 	return error;
    669   1.23   thorpej }
    670    1.1       cgd 
    671   1.31  jdolecek const int vop_setattr_vp_offsets[] = {
    672    1.1       cgd 	VOPARG_OFFSETOF(struct vop_setattr_args,a_vp),
    673    1.1       cgd 	VDESC_NO_OFFSET
    674    1.1       cgd };
    675   1.33  jdolecek const struct vnodeop_desc vop_setattr_desc = {
    676   1.67     pooka 	VOP_SETATTR_DESCOFFSET,
    677    1.1       cgd 	"vop_setattr",
    678    1.1       cgd 	0,
    679    1.1       cgd 	vop_setattr_vp_offsets,
    680    1.1       cgd 	VDESC_NO_OFFSET,
    681    1.1       cgd 	VOPARG_OFFSETOF(struct vop_setattr_args, a_cred),
    682    1.1       cgd 	VDESC_NO_OFFSET,
    683    1.1       cgd };
    684   1.23   thorpej int
    685   1.60   thorpej VOP_SETATTR(struct vnode *vp,
    686   1.60   thorpej     struct vattr *vap,
    687   1.73     pooka     kauth_cred_t cred)
    688   1.23   thorpej {
    689   1.72        ad 	int error;
    690   1.72        ad 	bool mpsafe;
    691   1.23   thorpej 	struct vop_setattr_args a;
    692  1.105   hannken 	struct mount *mp;
    693   1.23   thorpej 	a.a_desc = VDESC(vop_setattr);
    694   1.23   thorpej 	a.a_vp = vp;
    695   1.23   thorpej 	a.a_vap = vap;
    696   1.23   thorpej 	a.a_cred = cred;
    697  1.115   thorpej 	vop_setattr_pre(&a);
    698  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    699  1.105   hannken 	if (error)
    700  1.105   hannken 		return error;
    701   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_setattr), &a));
    702  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    703  1.115   thorpej 	vop_setattr_post(&a, error);
    704   1.72        ad 	return error;
    705   1.23   thorpej }
    706    1.1       cgd 
    707   1.31  jdolecek const int vop_read_vp_offsets[] = {
    708    1.1       cgd 	VOPARG_OFFSETOF(struct vop_read_args,a_vp),
    709    1.1       cgd 	VDESC_NO_OFFSET
    710    1.1       cgd };
    711   1.33  jdolecek const struct vnodeop_desc vop_read_desc = {
    712   1.67     pooka 	VOP_READ_DESCOFFSET,
    713    1.1       cgd 	"vop_read",
    714    1.1       cgd 	0,
    715    1.1       cgd 	vop_read_vp_offsets,
    716    1.1       cgd 	VDESC_NO_OFFSET,
    717    1.1       cgd 	VOPARG_OFFSETOF(struct vop_read_args, a_cred),
    718    1.1       cgd 	VDESC_NO_OFFSET,
    719    1.1       cgd };
    720   1.23   thorpej int
    721   1.60   thorpej VOP_READ(struct vnode *vp,
    722   1.60   thorpej     struct uio *uio,
    723   1.60   thorpej     int ioflag,
    724   1.65      elad     kauth_cred_t cred)
    725   1.23   thorpej {
    726   1.72        ad 	int error;
    727   1.72        ad 	bool mpsafe;
    728   1.23   thorpej 	struct vop_read_args a;
    729  1.105   hannken 	struct mount *mp;
    730   1.23   thorpej 	a.a_desc = VDESC(vop_read);
    731   1.23   thorpej 	a.a_vp = vp;
    732   1.23   thorpej 	a.a_uio = uio;
    733   1.23   thorpej 	a.a_ioflag = ioflag;
    734   1.23   thorpej 	a.a_cred = cred;
    735  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    736  1.105   hannken 	if (error)
    737  1.105   hannken 		return error;
    738   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_read), &a));
    739  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    740  1.115   thorpej 	vop_read_post(&a, error);
    741   1.72        ad 	return error;
    742   1.23   thorpej }
    743    1.1       cgd 
    744   1.31  jdolecek const int vop_write_vp_offsets[] = {
    745    1.1       cgd 	VOPARG_OFFSETOF(struct vop_write_args,a_vp),
    746    1.1       cgd 	VDESC_NO_OFFSET
    747    1.1       cgd };
    748   1.33  jdolecek const struct vnodeop_desc vop_write_desc = {
    749   1.67     pooka 	VOP_WRITE_DESCOFFSET,
    750    1.1       cgd 	"vop_write",
    751    1.1       cgd 	0,
    752    1.1       cgd 	vop_write_vp_offsets,
    753    1.1       cgd 	VDESC_NO_OFFSET,
    754    1.1       cgd 	VOPARG_OFFSETOF(struct vop_write_args, a_cred),
    755    1.1       cgd 	VDESC_NO_OFFSET,
    756    1.1       cgd };
    757   1.23   thorpej int
    758   1.60   thorpej VOP_WRITE(struct vnode *vp,
    759   1.60   thorpej     struct uio *uio,
    760   1.60   thorpej     int ioflag,
    761   1.65      elad     kauth_cred_t cred)
    762   1.23   thorpej {
    763   1.72        ad 	int error;
    764   1.72        ad 	bool mpsafe;
    765   1.23   thorpej 	struct vop_write_args a;
    766  1.105   hannken 	struct mount *mp;
    767   1.23   thorpej 	a.a_desc = VDESC(vop_write);
    768   1.23   thorpej 	a.a_vp = vp;
    769   1.23   thorpej 	a.a_uio = uio;
    770   1.23   thorpej 	a.a_ioflag = ioflag;
    771   1.23   thorpej 	a.a_cred = cred;
    772  1.115   thorpej 	vop_write_pre(&a);
    773  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    774  1.105   hannken 	if (error)
    775  1.105   hannken 		return error;
    776   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_write), &a));
    777  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    778  1.115   thorpej 	vop_write_post(&a, error);
    779   1.72        ad 	return error;
    780   1.23   thorpej }
    781    1.1       cgd 
    782   1.93  dholland const int vop_fallocate_vp_offsets[] = {
    783   1.93  dholland 	VOPARG_OFFSETOF(struct vop_fallocate_args,a_vp),
    784   1.93  dholland 	VDESC_NO_OFFSET
    785   1.93  dholland };
    786   1.93  dholland const struct vnodeop_desc vop_fallocate_desc = {
    787   1.93  dholland 	VOP_FALLOCATE_DESCOFFSET,
    788   1.93  dholland 	"vop_fallocate",
    789   1.93  dholland 	0,
    790   1.93  dholland 	vop_fallocate_vp_offsets,
    791   1.93  dholland 	VDESC_NO_OFFSET,
    792   1.93  dholland 	VDESC_NO_OFFSET,
    793   1.93  dholland 	VDESC_NO_OFFSET,
    794   1.93  dholland };
    795   1.93  dholland int
    796   1.93  dholland VOP_FALLOCATE(struct vnode *vp,
    797   1.93  dholland     off_t pos,
    798   1.93  dholland     off_t len)
    799   1.93  dholland {
    800   1.93  dholland 	int error;
    801   1.93  dholland 	bool mpsafe;
    802   1.93  dholland 	struct vop_fallocate_args a;
    803  1.105   hannken 	struct mount *mp;
    804   1.93  dholland 	a.a_desc = VDESC(vop_fallocate);
    805   1.93  dholland 	a.a_vp = vp;
    806   1.93  dholland 	a.a_pos = pos;
    807   1.93  dholland 	a.a_len = len;
    808  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    809  1.105   hannken 	if (error)
    810  1.105   hannken 		return error;
    811   1.93  dholland 	error = (VCALL(vp, VOFFSET(vop_fallocate), &a));
    812  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    813   1.93  dholland 	return error;
    814   1.93  dholland }
    815   1.93  dholland 
    816   1.93  dholland const int vop_fdiscard_vp_offsets[] = {
    817   1.93  dholland 	VOPARG_OFFSETOF(struct vop_fdiscard_args,a_vp),
    818   1.93  dholland 	VDESC_NO_OFFSET
    819   1.93  dholland };
    820   1.93  dholland const struct vnodeop_desc vop_fdiscard_desc = {
    821   1.93  dholland 	VOP_FDISCARD_DESCOFFSET,
    822   1.93  dholland 	"vop_fdiscard",
    823   1.93  dholland 	0,
    824   1.93  dholland 	vop_fdiscard_vp_offsets,
    825   1.93  dholland 	VDESC_NO_OFFSET,
    826   1.93  dholland 	VDESC_NO_OFFSET,
    827   1.93  dholland 	VDESC_NO_OFFSET,
    828   1.93  dholland };
    829   1.93  dholland int
    830   1.93  dholland VOP_FDISCARD(struct vnode *vp,
    831   1.93  dholland     off_t pos,
    832   1.93  dholland     off_t len)
    833   1.93  dholland {
    834   1.93  dholland 	int error;
    835   1.93  dholland 	bool mpsafe;
    836   1.93  dholland 	struct vop_fdiscard_args a;
    837  1.105   hannken 	struct mount *mp;
    838   1.93  dholland 	a.a_desc = VDESC(vop_fdiscard);
    839   1.93  dholland 	a.a_vp = vp;
    840   1.93  dholland 	a.a_pos = pos;
    841   1.93  dholland 	a.a_len = len;
    842  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    843  1.105   hannken 	if (error)
    844  1.105   hannken 		return error;
    845   1.93  dholland 	error = (VCALL(vp, VOFFSET(vop_fdiscard), &a));
    846  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    847   1.93  dholland 	return error;
    848   1.93  dholland }
    849   1.93  dholland 
    850   1.31  jdolecek const int vop_ioctl_vp_offsets[] = {
    851    1.1       cgd 	VOPARG_OFFSETOF(struct vop_ioctl_args,a_vp),
    852    1.1       cgd 	VDESC_NO_OFFSET
    853    1.1       cgd };
    854   1.33  jdolecek const struct vnodeop_desc vop_ioctl_desc = {
    855   1.67     pooka 	VOP_IOCTL_DESCOFFSET,
    856    1.1       cgd 	"vop_ioctl",
    857    1.1       cgd 	0,
    858    1.1       cgd 	vop_ioctl_vp_offsets,
    859    1.1       cgd 	VDESC_NO_OFFSET,
    860    1.1       cgd 	VOPARG_OFFSETOF(struct vop_ioctl_args, a_cred),
    861    1.1       cgd 	VDESC_NO_OFFSET,
    862    1.1       cgd };
    863   1.23   thorpej int
    864   1.60   thorpej VOP_IOCTL(struct vnode *vp,
    865   1.60   thorpej     u_long command,
    866   1.60   thorpej     void *data,
    867   1.60   thorpej     int fflag,
    868   1.73     pooka     kauth_cred_t cred)
    869   1.23   thorpej {
    870   1.72        ad 	int error;
    871   1.72        ad 	bool mpsafe;
    872   1.23   thorpej 	struct vop_ioctl_args a;
    873  1.105   hannken 	struct mount *mp;
    874   1.23   thorpej 	a.a_desc = VDESC(vop_ioctl);
    875   1.23   thorpej 	a.a_vp = vp;
    876   1.23   thorpej 	a.a_command = command;
    877   1.23   thorpej 	a.a_data = data;
    878   1.23   thorpej 	a.a_fflag = fflag;
    879   1.23   thorpej 	a.a_cred = cred;
    880  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    881  1.105   hannken 	if (error)
    882  1.105   hannken 		return error;
    883   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_ioctl), &a));
    884  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    885   1.72        ad 	return error;
    886   1.23   thorpej }
    887    1.1       cgd 
    888   1.31  jdolecek const int vop_fcntl_vp_offsets[] = {
    889   1.18  wrstuden 	VOPARG_OFFSETOF(struct vop_fcntl_args,a_vp),
    890   1.18  wrstuden 	VDESC_NO_OFFSET
    891   1.18  wrstuden };
    892   1.33  jdolecek const struct vnodeop_desc vop_fcntl_desc = {
    893   1.67     pooka 	VOP_FCNTL_DESCOFFSET,
    894   1.18  wrstuden 	"vop_fcntl",
    895   1.18  wrstuden 	0,
    896   1.18  wrstuden 	vop_fcntl_vp_offsets,
    897   1.18  wrstuden 	VDESC_NO_OFFSET,
    898   1.18  wrstuden 	VOPARG_OFFSETOF(struct vop_fcntl_args, a_cred),
    899   1.18  wrstuden 	VDESC_NO_OFFSET,
    900   1.18  wrstuden };
    901   1.23   thorpej int
    902   1.60   thorpej VOP_FCNTL(struct vnode *vp,
    903   1.60   thorpej     u_int command,
    904   1.60   thorpej     void *data,
    905   1.60   thorpej     int fflag,
    906   1.73     pooka     kauth_cred_t cred)
    907   1.23   thorpej {
    908   1.72        ad 	int error;
    909   1.72        ad 	bool mpsafe;
    910   1.23   thorpej 	struct vop_fcntl_args a;
    911  1.105   hannken 	struct mount *mp;
    912   1.23   thorpej 	a.a_desc = VDESC(vop_fcntl);
    913   1.23   thorpej 	a.a_vp = vp;
    914   1.23   thorpej 	a.a_command = command;
    915   1.23   thorpej 	a.a_data = data;
    916   1.23   thorpej 	a.a_fflag = fflag;
    917   1.23   thorpej 	a.a_cred = cred;
    918  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
    919  1.105   hannken 	if (error)
    920  1.105   hannken 		return error;
    921   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_fcntl), &a));
    922  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
    923   1.72        ad 	return error;
    924   1.23   thorpej }
    925   1.18  wrstuden 
    926   1.31  jdolecek const int vop_poll_vp_offsets[] = {
    927    1.3   mycroft 	VOPARG_OFFSETOF(struct vop_poll_args,a_vp),
    928    1.1       cgd 	VDESC_NO_OFFSET
    929    1.1       cgd };
    930   1.33  jdolecek const struct vnodeop_desc vop_poll_desc = {
    931   1.67     pooka 	VOP_POLL_DESCOFFSET,
    932    1.3   mycroft 	"vop_poll",
    933    1.1       cgd 	0,
    934    1.3   mycroft 	vop_poll_vp_offsets,
    935    1.1       cgd 	VDESC_NO_OFFSET,
    936    1.3   mycroft 	VDESC_NO_OFFSET,
    937    1.1       cgd 	VDESC_NO_OFFSET,
    938    1.1       cgd };
    939   1.23   thorpej int
    940   1.60   thorpej VOP_POLL(struct vnode *vp,
    941   1.73     pooka     int events)
    942   1.23   thorpej {
    943   1.72        ad 	int error;
    944   1.72        ad 	bool mpsafe;
    945   1.23   thorpej 	struct vop_poll_args a;
    946  1.105   hannken 	struct mount *mp;
    947   1.23   thorpej 	a.a_desc = VDESC(vop_poll);
    948   1.23   thorpej 	a.a_vp = vp;
    949   1.23   thorpej 	a.a_events = events;
    950  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
    951  1.105   hannken 	if (error)
    952  1.105   hannken 		return error;
    953   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_poll), &a));
    954  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
    955   1.72        ad 	return error;
    956   1.23   thorpej }
    957    1.1       cgd 
    958   1.40  jdolecek const int vop_kqfilter_vp_offsets[] = {
    959   1.40  jdolecek 	VOPARG_OFFSETOF(struct vop_kqfilter_args,a_vp),
    960   1.40  jdolecek 	VDESC_NO_OFFSET
    961   1.40  jdolecek };
    962   1.40  jdolecek const struct vnodeop_desc vop_kqfilter_desc = {
    963   1.67     pooka 	VOP_KQFILTER_DESCOFFSET,
    964   1.40  jdolecek 	"vop_kqfilter",
    965   1.40  jdolecek 	0,
    966   1.40  jdolecek 	vop_kqfilter_vp_offsets,
    967   1.40  jdolecek 	VDESC_NO_OFFSET,
    968   1.40  jdolecek 	VDESC_NO_OFFSET,
    969   1.40  jdolecek 	VDESC_NO_OFFSET,
    970   1.40  jdolecek };
    971   1.40  jdolecek int
    972   1.60   thorpej VOP_KQFILTER(struct vnode *vp,
    973   1.60   thorpej     struct knote *kn)
    974   1.40  jdolecek {
    975   1.72        ad 	int error;
    976   1.72        ad 	bool mpsafe;
    977   1.40  jdolecek 	struct vop_kqfilter_args a;
    978  1.105   hannken 	struct mount *mp;
    979   1.40  jdolecek 	a.a_desc = VDESC(vop_kqfilter);
    980   1.40  jdolecek 	a.a_vp = vp;
    981   1.40  jdolecek 	a.a_kn = kn;
    982  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
    983  1.105   hannken 	if (error)
    984  1.105   hannken 		return error;
    985   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_kqfilter), &a));
    986  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
    987   1.72        ad 	return error;
    988   1.40  jdolecek }
    989   1.40  jdolecek 
    990   1.31  jdolecek const int vop_revoke_vp_offsets[] = {
    991   1.10      fvdl 	VOPARG_OFFSETOF(struct vop_revoke_args,a_vp),
    992   1.10      fvdl 	VDESC_NO_OFFSET
    993   1.10      fvdl };
    994   1.33  jdolecek const struct vnodeop_desc vop_revoke_desc = {
    995   1.67     pooka 	VOP_REVOKE_DESCOFFSET,
    996   1.10      fvdl 	"vop_revoke",
    997   1.10      fvdl 	0,
    998   1.10      fvdl 	vop_revoke_vp_offsets,
    999   1.10      fvdl 	VDESC_NO_OFFSET,
   1000   1.10      fvdl 	VDESC_NO_OFFSET,
   1001   1.10      fvdl 	VDESC_NO_OFFSET,
   1002   1.10      fvdl };
   1003   1.23   thorpej int
   1004   1.60   thorpej VOP_REVOKE(struct vnode *vp,
   1005   1.60   thorpej     int flags)
   1006   1.23   thorpej {
   1007   1.72        ad 	int error;
   1008   1.72        ad 	bool mpsafe;
   1009   1.23   thorpej 	struct vop_revoke_args a;
   1010  1.105   hannken 	struct mount *mp;
   1011   1.23   thorpej 	a.a_desc = VDESC(vop_revoke);
   1012   1.23   thorpej 	a.a_vp = vp;
   1013   1.23   thorpej 	a.a_flags = flags;
   1014  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1015  1.105   hannken 	if (error)
   1016  1.105   hannken 		return error;
   1017   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_revoke), &a));
   1018  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1019   1.72        ad 	return error;
   1020   1.23   thorpej }
   1021   1.10      fvdl 
   1022   1.31  jdolecek const int vop_mmap_vp_offsets[] = {
   1023    1.1       cgd 	VOPARG_OFFSETOF(struct vop_mmap_args,a_vp),
   1024    1.1       cgd 	VDESC_NO_OFFSET
   1025    1.1       cgd };
   1026   1.33  jdolecek const struct vnodeop_desc vop_mmap_desc = {
   1027   1.67     pooka 	VOP_MMAP_DESCOFFSET,
   1028    1.1       cgd 	"vop_mmap",
   1029    1.1       cgd 	0,
   1030    1.1       cgd 	vop_mmap_vp_offsets,
   1031    1.1       cgd 	VDESC_NO_OFFSET,
   1032    1.1       cgd 	VOPARG_OFFSETOF(struct vop_mmap_args, a_cred),
   1033    1.1       cgd 	VDESC_NO_OFFSET,
   1034    1.1       cgd };
   1035   1.23   thorpej int
   1036   1.60   thorpej VOP_MMAP(struct vnode *vp,
   1037   1.70     pooka     vm_prot_t prot,
   1038   1.73     pooka     kauth_cred_t cred)
   1039   1.23   thorpej {
   1040   1.72        ad 	int error;
   1041   1.72        ad 	bool mpsafe;
   1042   1.23   thorpej 	struct vop_mmap_args a;
   1043  1.105   hannken 	struct mount *mp;
   1044   1.23   thorpej 	a.a_desc = VDESC(vop_mmap);
   1045   1.23   thorpej 	a.a_vp = vp;
   1046   1.70     pooka 	a.a_prot = prot;
   1047   1.23   thorpej 	a.a_cred = cred;
   1048  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1049  1.105   hannken 	if (error)
   1050  1.105   hannken 		return error;
   1051   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_mmap), &a));
   1052  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
   1053   1.72        ad 	return error;
   1054   1.23   thorpej }
   1055    1.1       cgd 
   1056   1.31  jdolecek const int vop_fsync_vp_offsets[] = {
   1057    1.1       cgd 	VOPARG_OFFSETOF(struct vop_fsync_args,a_vp),
   1058    1.1       cgd 	VDESC_NO_OFFSET
   1059    1.1       cgd };
   1060   1.33  jdolecek const struct vnodeop_desc vop_fsync_desc = {
   1061   1.67     pooka 	VOP_FSYNC_DESCOFFSET,
   1062    1.1       cgd 	"vop_fsync",
   1063    1.1       cgd 	0,
   1064    1.1       cgd 	vop_fsync_vp_offsets,
   1065    1.1       cgd 	VDESC_NO_OFFSET,
   1066    1.1       cgd 	VOPARG_OFFSETOF(struct vop_fsync_args, a_cred),
   1067    1.1       cgd 	VDESC_NO_OFFSET,
   1068    1.1       cgd };
   1069   1.23   thorpej int
   1070   1.60   thorpej VOP_FSYNC(struct vnode *vp,
   1071   1.65      elad     kauth_cred_t cred,
   1072   1.60   thorpej     int flags,
   1073   1.60   thorpej     off_t offlo,
   1074   1.73     pooka     off_t offhi)
   1075   1.23   thorpej {
   1076   1.72        ad 	int error;
   1077   1.72        ad 	bool mpsafe;
   1078   1.23   thorpej 	struct vop_fsync_args a;
   1079  1.105   hannken 	struct mount *mp;
   1080   1.23   thorpej 	a.a_desc = VDESC(vop_fsync);
   1081   1.23   thorpej 	a.a_vp = vp;
   1082   1.23   thorpej 	a.a_cred = cred;
   1083   1.23   thorpej 	a.a_flags = flags;
   1084   1.25      fvdl 	a.a_offlo = offlo;
   1085   1.25      fvdl 	a.a_offhi = offhi;
   1086  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1087  1.105   hannken 	if (error)
   1088  1.105   hannken 		return error;
   1089   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_fsync), &a));
   1090  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1091   1.72        ad 	return error;
   1092   1.23   thorpej }
   1093    1.1       cgd 
   1094   1.31  jdolecek const int vop_seek_vp_offsets[] = {
   1095    1.1       cgd 	VOPARG_OFFSETOF(struct vop_seek_args,a_vp),
   1096    1.1       cgd 	VDESC_NO_OFFSET
   1097    1.1       cgd };
   1098   1.33  jdolecek const struct vnodeop_desc vop_seek_desc = {
   1099   1.67     pooka 	VOP_SEEK_DESCOFFSET,
   1100    1.1       cgd 	"vop_seek",
   1101    1.1       cgd 	0,
   1102    1.1       cgd 	vop_seek_vp_offsets,
   1103    1.1       cgd 	VDESC_NO_OFFSET,
   1104    1.1       cgd 	VOPARG_OFFSETOF(struct vop_seek_args, a_cred),
   1105    1.1       cgd 	VDESC_NO_OFFSET,
   1106    1.1       cgd };
   1107   1.23   thorpej int
   1108   1.60   thorpej VOP_SEEK(struct vnode *vp,
   1109   1.60   thorpej     off_t oldoff,
   1110   1.60   thorpej     off_t newoff,
   1111   1.65      elad     kauth_cred_t cred)
   1112   1.23   thorpej {
   1113   1.72        ad 	int error;
   1114   1.72        ad 	bool mpsafe;
   1115   1.23   thorpej 	struct vop_seek_args a;
   1116  1.105   hannken 	struct mount *mp;
   1117   1.23   thorpej 	a.a_desc = VDESC(vop_seek);
   1118   1.23   thorpej 	a.a_vp = vp;
   1119   1.23   thorpej 	a.a_oldoff = oldoff;
   1120   1.23   thorpej 	a.a_newoff = newoff;
   1121   1.23   thorpej 	a.a_cred = cred;
   1122  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1123  1.105   hannken 	if (error)
   1124  1.105   hannken 		return error;
   1125   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_seek), &a));
   1126  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
   1127   1.72        ad 	return error;
   1128   1.23   thorpej }
   1129    1.1       cgd 
   1130   1.31  jdolecek const int vop_remove_vp_offsets[] = {
   1131  1.115   thorpej 	VOPARG_OFFSETOF(struct vop_remove_v3_args,a_dvp),
   1132  1.115   thorpej 	VOPARG_OFFSETOF(struct vop_remove_v3_args,a_vp),
   1133    1.1       cgd 	VDESC_NO_OFFSET
   1134    1.1       cgd };
   1135   1.33  jdolecek const struct vnodeop_desc vop_remove_desc = {
   1136   1.67     pooka 	VOP_REMOVE_DESCOFFSET,
   1137    1.1       cgd 	"vop_remove",
   1138  1.103  riastrad 	0 | VDESC_VP1_WILLPUT,
   1139    1.1       cgd 	vop_remove_vp_offsets,
   1140    1.1       cgd 	VDESC_NO_OFFSET,
   1141    1.1       cgd 	VDESC_NO_OFFSET,
   1142  1.115   thorpej 	VOPARG_OFFSETOF(struct vop_remove_v3_args, a_cnp),
   1143    1.1       cgd };
   1144   1.23   thorpej int
   1145   1.60   thorpej VOP_REMOVE(struct vnode *dvp,
   1146   1.60   thorpej     struct vnode *vp,
   1147   1.60   thorpej     struct componentname *cnp)
   1148   1.23   thorpej {
   1149   1.72        ad 	int error;
   1150   1.72        ad 	bool mpsafe;
   1151  1.115   thorpej 	struct vop_remove_v3_args a;
   1152  1.105   hannken 	struct mount *mp;
   1153   1.23   thorpej 	a.a_desc = VDESC(vop_remove);
   1154   1.23   thorpej 	a.a_dvp = dvp;
   1155   1.81     pooka 	a.a_vp = vp;
   1156   1.23   thorpej 	a.a_cnp = cnp;
   1157  1.115   thorpej 	vop_remove_pre(&a);
   1158  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1159  1.105   hannken 	if (error)
   1160  1.105   hannken 		return error;
   1161   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_remove), &a));
   1162  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1163  1.115   thorpej 	vop_remove_post(&a, error);
   1164   1.72        ad 	return error;
   1165   1.23   thorpej }
   1166    1.1       cgd 
   1167   1.31  jdolecek const int vop_link_vp_offsets[] = {
   1168   1.94  riastrad 	VOPARG_OFFSETOF(struct vop_link_v2_args,a_dvp),
   1169   1.94  riastrad 	VOPARG_OFFSETOF(struct vop_link_v2_args,a_vp),
   1170    1.1       cgd 	VDESC_NO_OFFSET
   1171    1.1       cgd };
   1172   1.33  jdolecek const struct vnodeop_desc vop_link_desc = {
   1173   1.67     pooka 	VOP_LINK_DESCOFFSET,
   1174    1.1       cgd 	"vop_link",
   1175   1.94  riastrad 	0,
   1176    1.1       cgd 	vop_link_vp_offsets,
   1177    1.1       cgd 	VDESC_NO_OFFSET,
   1178    1.1       cgd 	VDESC_NO_OFFSET,
   1179   1.94  riastrad 	VOPARG_OFFSETOF(struct vop_link_v2_args, a_cnp),
   1180    1.1       cgd };
   1181   1.23   thorpej int
   1182   1.60   thorpej VOP_LINK(struct vnode *dvp,
   1183   1.60   thorpej     struct vnode *vp,
   1184   1.60   thorpej     struct componentname *cnp)
   1185   1.23   thorpej {
   1186   1.72        ad 	int error;
   1187   1.72        ad 	bool mpsafe;
   1188   1.94  riastrad 	struct vop_link_v2_args a;
   1189  1.105   hannken 	struct mount *mp;
   1190   1.23   thorpej 	a.a_desc = VDESC(vop_link);
   1191   1.23   thorpej 	a.a_dvp = dvp;
   1192   1.81     pooka 	a.a_vp = vp;
   1193   1.23   thorpej 	a.a_cnp = cnp;
   1194  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1195  1.105   hannken 	if (error)
   1196  1.105   hannken 		return error;
   1197   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_link), &a));
   1198  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1199  1.115   thorpej 	vop_link_post(&a, error);
   1200   1.72        ad 	return error;
   1201   1.23   thorpej }
   1202    1.1       cgd 
   1203   1.31  jdolecek const int vop_rename_vp_offsets[] = {
   1204    1.1       cgd 	VOPARG_OFFSETOF(struct vop_rename_args,a_fdvp),
   1205    1.1       cgd 	VOPARG_OFFSETOF(struct vop_rename_args,a_fvp),
   1206    1.1       cgd 	VOPARG_OFFSETOF(struct vop_rename_args,a_tdvp),
   1207    1.1       cgd 	VOPARG_OFFSETOF(struct vop_rename_args,a_tvp),
   1208    1.1       cgd 	VDESC_NO_OFFSET
   1209    1.1       cgd };
   1210   1.33  jdolecek const struct vnodeop_desc vop_rename_desc = {
   1211   1.67     pooka 	VOP_RENAME_DESCOFFSET,
   1212    1.1       cgd 	"vop_rename",
   1213   1.42  jdolecek 	0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE | VDESC_VP2_WILLPUT | VDESC_VP3_WILLPUT,
   1214    1.1       cgd 	vop_rename_vp_offsets,
   1215    1.1       cgd 	VDESC_NO_OFFSET,
   1216    1.1       cgd 	VDESC_NO_OFFSET,
   1217    1.1       cgd 	VOPARG_OFFSETOF(struct vop_rename_args, a_fcnp),
   1218    1.1       cgd };
   1219   1.23   thorpej int
   1220   1.60   thorpej VOP_RENAME(struct vnode *fdvp,
   1221   1.60   thorpej     struct vnode *fvp,
   1222   1.60   thorpej     struct componentname *fcnp,
   1223   1.60   thorpej     struct vnode *tdvp,
   1224   1.60   thorpej     struct vnode *tvp,
   1225   1.60   thorpej     struct componentname *tcnp)
   1226   1.23   thorpej {
   1227   1.72        ad 	int error;
   1228   1.72        ad 	bool mpsafe;
   1229   1.23   thorpej 	struct vop_rename_args a;
   1230  1.105   hannken 	struct mount *mp;
   1231   1.23   thorpej 	a.a_desc = VDESC(vop_rename);
   1232   1.23   thorpej 	a.a_fdvp = fdvp;
   1233   1.23   thorpej 	a.a_fvp = fvp;
   1234   1.23   thorpej 	a.a_fcnp = fcnp;
   1235   1.23   thorpej 	a.a_tdvp = tdvp;
   1236   1.23   thorpej 	a.a_tvp = tvp;
   1237   1.23   thorpej 	a.a_tcnp = tcnp;
   1238  1.105   hannken 	error = vop_pre(fdvp, &mp, &mpsafe, FST_YES);
   1239  1.105   hannken 	if (error)
   1240  1.105   hannken 		return error;
   1241   1.72        ad 	error = (VCALL(fdvp, VOFFSET(vop_rename), &a));
   1242  1.105   hannken 	vop_post(fdvp, mp, mpsafe, FST_YES);
   1243   1.72        ad 	return error;
   1244   1.23   thorpej }
   1245    1.1       cgd 
   1246   1.31  jdolecek const int vop_mkdir_vp_offsets[] = {
   1247   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args,a_dvp),
   1248    1.1       cgd 	VDESC_NO_OFFSET
   1249    1.1       cgd };
   1250   1.33  jdolecek const struct vnodeop_desc vop_mkdir_desc = {
   1251   1.67     pooka 	VOP_MKDIR_DESCOFFSET,
   1252    1.1       cgd 	"vop_mkdir",
   1253   1.90   hannken 	0,
   1254    1.1       cgd 	vop_mkdir_vp_offsets,
   1255   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args, a_vpp),
   1256    1.1       cgd 	VDESC_NO_OFFSET,
   1257   1.91   hannken 	VOPARG_OFFSETOF(struct vop_mkdir_v3_args, a_cnp),
   1258    1.1       cgd };
   1259   1.23   thorpej int
   1260   1.60   thorpej VOP_MKDIR(struct vnode *dvp,
   1261   1.60   thorpej     struct vnode **vpp,
   1262   1.60   thorpej     struct componentname *cnp,
   1263   1.60   thorpej     struct vattr *vap)
   1264   1.23   thorpej {
   1265   1.72        ad 	int error;
   1266   1.72        ad 	bool mpsafe;
   1267   1.91   hannken 	struct vop_mkdir_v3_args a;
   1268  1.105   hannken 	struct mount *mp;
   1269   1.23   thorpej 	a.a_desc = VDESC(vop_mkdir);
   1270   1.23   thorpej 	a.a_dvp = dvp;
   1271   1.23   thorpej 	a.a_vpp = vpp;
   1272   1.23   thorpej 	a.a_cnp = cnp;
   1273   1.23   thorpej 	a.a_vap = vap;
   1274  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1275  1.105   hannken 	if (error)
   1276  1.105   hannken 		return error;
   1277   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_mkdir), &a));
   1278  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1279  1.115   thorpej 	vop_mkdir_post(&a, error);
   1280   1.69     pooka #ifdef DIAGNOSTIC
   1281   1.72        ad 	if (error == 0)
   1282   1.69     pooka 		KASSERT((*vpp)->v_size != VSIZENOTSET
   1283   1.69     pooka 		    && (*vpp)->v_writesize != VSIZENOTSET);
   1284   1.69     pooka #endif /* DIAGNOSTIC */
   1285   1.72        ad 	return error;
   1286   1.23   thorpej }
   1287    1.1       cgd 
   1288   1.31  jdolecek const int vop_rmdir_vp_offsets[] = {
   1289  1.103  riastrad 	VOPARG_OFFSETOF(struct vop_rmdir_v2_args,a_dvp),
   1290  1.103  riastrad 	VOPARG_OFFSETOF(struct vop_rmdir_v2_args,a_vp),
   1291    1.1       cgd 	VDESC_NO_OFFSET
   1292    1.1       cgd };
   1293   1.33  jdolecek const struct vnodeop_desc vop_rmdir_desc = {
   1294   1.67     pooka 	VOP_RMDIR_DESCOFFSET,
   1295    1.1       cgd 	"vop_rmdir",
   1296  1.103  riastrad 	0 | VDESC_VP1_WILLPUT,
   1297    1.1       cgd 	vop_rmdir_vp_offsets,
   1298    1.1       cgd 	VDESC_NO_OFFSET,
   1299    1.1       cgd 	VDESC_NO_OFFSET,
   1300  1.103  riastrad 	VOPARG_OFFSETOF(struct vop_rmdir_v2_args, a_cnp),
   1301    1.1       cgd };
   1302   1.23   thorpej int
   1303   1.60   thorpej VOP_RMDIR(struct vnode *dvp,
   1304   1.60   thorpej     struct vnode *vp,
   1305   1.60   thorpej     struct componentname *cnp)
   1306   1.23   thorpej {
   1307   1.72        ad 	int error;
   1308   1.72        ad 	bool mpsafe;
   1309  1.103  riastrad 	struct vop_rmdir_v2_args a;
   1310  1.105   hannken 	struct mount *mp;
   1311   1.23   thorpej 	a.a_desc = VDESC(vop_rmdir);
   1312   1.23   thorpej 	a.a_dvp = dvp;
   1313   1.81     pooka 	a.a_vp = vp;
   1314   1.23   thorpej 	a.a_cnp = cnp;
   1315  1.115   thorpej 	vop_rmdir_pre(&a);
   1316  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1317  1.105   hannken 	if (error)
   1318  1.105   hannken 		return error;
   1319   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_rmdir), &a));
   1320  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1321  1.115   thorpej 	vop_rmdir_post(&a, error);
   1322   1.72        ad 	return error;
   1323   1.23   thorpej }
   1324    1.1       cgd 
   1325   1.31  jdolecek const int vop_symlink_vp_offsets[] = {
   1326   1.91   hannken 	VOPARG_OFFSETOF(struct vop_symlink_v3_args,a_dvp),
   1327    1.1       cgd 	VDESC_NO_OFFSET
   1328    1.1       cgd };
   1329   1.33  jdolecek const struct vnodeop_desc vop_symlink_desc = {
   1330   1.67     pooka 	VOP_SYMLINK_DESCOFFSET,
   1331    1.1       cgd 	"vop_symlink",
   1332   1.90   hannken 	0,
   1333    1.1       cgd 	vop_symlink_vp_offsets,
   1334   1.91   hannken 	VOPARG_OFFSETOF(struct vop_symlink_v3_args, a_vpp),
   1335    1.1       cgd 	VDESC_NO_OFFSET,
   1336   1.91   hannken 	VOPARG_OFFSETOF(struct vop_symlink_v3_args, a_cnp),
   1337    1.1       cgd };
   1338   1.23   thorpej int
   1339   1.60   thorpej VOP_SYMLINK(struct vnode *dvp,
   1340   1.60   thorpej     struct vnode **vpp,
   1341   1.60   thorpej     struct componentname *cnp,
   1342   1.60   thorpej     struct vattr *vap,
   1343   1.60   thorpej     char *target)
   1344   1.23   thorpej {
   1345   1.72        ad 	int error;
   1346   1.72        ad 	bool mpsafe;
   1347   1.91   hannken 	struct vop_symlink_v3_args a;
   1348  1.105   hannken 	struct mount *mp;
   1349   1.23   thorpej 	a.a_desc = VDESC(vop_symlink);
   1350   1.23   thorpej 	a.a_dvp = dvp;
   1351   1.23   thorpej 	a.a_vpp = vpp;
   1352   1.23   thorpej 	a.a_cnp = cnp;
   1353   1.23   thorpej 	a.a_vap = vap;
   1354   1.23   thorpej 	a.a_target = target;
   1355  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1356  1.105   hannken 	if (error)
   1357  1.105   hannken 		return error;
   1358   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_symlink), &a));
   1359  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1360  1.115   thorpej 	vop_symlink_post(&a, error);
   1361   1.69     pooka #ifdef DIAGNOSTIC
   1362   1.72        ad 	if (error == 0)
   1363   1.69     pooka 		KASSERT((*vpp)->v_size != VSIZENOTSET
   1364   1.69     pooka 		    && (*vpp)->v_writesize != VSIZENOTSET);
   1365   1.69     pooka #endif /* DIAGNOSTIC */
   1366   1.72        ad 	return error;
   1367   1.23   thorpej }
   1368    1.1       cgd 
   1369   1.31  jdolecek const int vop_readdir_vp_offsets[] = {
   1370    1.1       cgd 	VOPARG_OFFSETOF(struct vop_readdir_args,a_vp),
   1371    1.1       cgd 	VDESC_NO_OFFSET
   1372    1.1       cgd };
   1373   1.33  jdolecek const struct vnodeop_desc vop_readdir_desc = {
   1374   1.67     pooka 	VOP_READDIR_DESCOFFSET,
   1375    1.1       cgd 	"vop_readdir",
   1376    1.1       cgd 	0,
   1377    1.1       cgd 	vop_readdir_vp_offsets,
   1378    1.1       cgd 	VDESC_NO_OFFSET,
   1379    1.1       cgd 	VOPARG_OFFSETOF(struct vop_readdir_args, a_cred),
   1380    1.1       cgd 	VDESC_NO_OFFSET,
   1381    1.1       cgd };
   1382   1.23   thorpej int
   1383   1.60   thorpej VOP_READDIR(struct vnode *vp,
   1384   1.60   thorpej     struct uio *uio,
   1385   1.65      elad     kauth_cred_t cred,
   1386   1.60   thorpej     int *eofflag,
   1387   1.60   thorpej     off_t **cookies,
   1388   1.60   thorpej     int *ncookies)
   1389   1.23   thorpej {
   1390   1.72        ad 	int error;
   1391   1.72        ad 	bool mpsafe;
   1392   1.23   thorpej 	struct vop_readdir_args a;
   1393  1.105   hannken 	struct mount *mp;
   1394   1.23   thorpej 	a.a_desc = VDESC(vop_readdir);
   1395   1.23   thorpej 	a.a_vp = vp;
   1396   1.23   thorpej 	a.a_uio = uio;
   1397   1.23   thorpej 	a.a_cred = cred;
   1398   1.23   thorpej 	a.a_eofflag = eofflag;
   1399   1.23   thorpej 	a.a_cookies = cookies;
   1400   1.23   thorpej 	a.a_ncookies = ncookies;
   1401  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1402  1.105   hannken 	if (error)
   1403  1.105   hannken 		return error;
   1404   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_readdir), &a));
   1405  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1406   1.72        ad 	return error;
   1407   1.23   thorpej }
   1408    1.1       cgd 
   1409   1.31  jdolecek const int vop_readlink_vp_offsets[] = {
   1410    1.1       cgd 	VOPARG_OFFSETOF(struct vop_readlink_args,a_vp),
   1411    1.1       cgd 	VDESC_NO_OFFSET
   1412    1.1       cgd };
   1413   1.33  jdolecek const struct vnodeop_desc vop_readlink_desc = {
   1414   1.67     pooka 	VOP_READLINK_DESCOFFSET,
   1415    1.1       cgd 	"vop_readlink",
   1416    1.1       cgd 	0,
   1417    1.1       cgd 	vop_readlink_vp_offsets,
   1418    1.1       cgd 	VDESC_NO_OFFSET,
   1419    1.1       cgd 	VOPARG_OFFSETOF(struct vop_readlink_args, a_cred),
   1420    1.1       cgd 	VDESC_NO_OFFSET,
   1421    1.1       cgd };
   1422   1.23   thorpej int
   1423   1.60   thorpej VOP_READLINK(struct vnode *vp,
   1424   1.60   thorpej     struct uio *uio,
   1425   1.65      elad     kauth_cred_t cred)
   1426   1.23   thorpej {
   1427   1.72        ad 	int error;
   1428   1.72        ad 	bool mpsafe;
   1429   1.23   thorpej 	struct vop_readlink_args a;
   1430  1.105   hannken 	struct mount *mp;
   1431   1.23   thorpej 	a.a_desc = VDESC(vop_readlink);
   1432   1.23   thorpej 	a.a_vp = vp;
   1433   1.23   thorpej 	a.a_uio = uio;
   1434   1.23   thorpej 	a.a_cred = cred;
   1435  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1436  1.105   hannken 	if (error)
   1437  1.105   hannken 		return error;
   1438   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_readlink), &a));
   1439  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1440   1.72        ad 	return error;
   1441   1.23   thorpej }
   1442    1.1       cgd 
   1443   1.31  jdolecek const int vop_abortop_vp_offsets[] = {
   1444    1.1       cgd 	VOPARG_OFFSETOF(struct vop_abortop_args,a_dvp),
   1445    1.1       cgd 	VDESC_NO_OFFSET
   1446    1.1       cgd };
   1447   1.33  jdolecek const struct vnodeop_desc vop_abortop_desc = {
   1448   1.67     pooka 	VOP_ABORTOP_DESCOFFSET,
   1449    1.1       cgd 	"vop_abortop",
   1450    1.1       cgd 	0,
   1451    1.1       cgd 	vop_abortop_vp_offsets,
   1452    1.1       cgd 	VDESC_NO_OFFSET,
   1453    1.1       cgd 	VDESC_NO_OFFSET,
   1454    1.1       cgd 	VOPARG_OFFSETOF(struct vop_abortop_args, a_cnp),
   1455    1.1       cgd };
   1456   1.23   thorpej int
   1457   1.60   thorpej VOP_ABORTOP(struct vnode *dvp,
   1458   1.60   thorpej     struct componentname *cnp)
   1459   1.23   thorpej {
   1460   1.72        ad 	int error;
   1461   1.72        ad 	bool mpsafe;
   1462   1.23   thorpej 	struct vop_abortop_args a;
   1463  1.105   hannken 	struct mount *mp;
   1464   1.23   thorpej 	a.a_desc = VDESC(vop_abortop);
   1465   1.23   thorpej 	a.a_dvp = dvp;
   1466   1.23   thorpej 	a.a_cnp = cnp;
   1467  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_YES);
   1468  1.105   hannken 	if (error)
   1469  1.105   hannken 		return error;
   1470   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_abortop), &a));
   1471  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_YES);
   1472   1.72        ad 	return error;
   1473   1.23   thorpej }
   1474    1.1       cgd 
   1475   1.31  jdolecek const int vop_inactive_vp_offsets[] = {
   1476   1.98  riastrad 	VOPARG_OFFSETOF(struct vop_inactive_v2_args,a_vp),
   1477    1.1       cgd 	VDESC_NO_OFFSET
   1478    1.1       cgd };
   1479   1.33  jdolecek const struct vnodeop_desc vop_inactive_desc = {
   1480   1.67     pooka 	VOP_INACTIVE_DESCOFFSET,
   1481    1.1       cgd 	"vop_inactive",
   1482   1.98  riastrad 	0,
   1483    1.1       cgd 	vop_inactive_vp_offsets,
   1484    1.1       cgd 	VDESC_NO_OFFSET,
   1485    1.1       cgd 	VDESC_NO_OFFSET,
   1486    1.1       cgd 	VDESC_NO_OFFSET,
   1487    1.1       cgd };
   1488   1.23   thorpej int
   1489   1.75        ad VOP_INACTIVE(struct vnode *vp,
   1490   1.75        ad     bool *recycle)
   1491   1.23   thorpej {
   1492   1.72        ad 	int error;
   1493   1.72        ad 	bool mpsafe;
   1494   1.98  riastrad 	struct vop_inactive_v2_args a;
   1495  1.105   hannken 	struct mount *mp;
   1496   1.23   thorpej 	a.a_desc = VDESC(vop_inactive);
   1497   1.23   thorpej 	a.a_vp = vp;
   1498   1.75        ad 	a.a_recycle = recycle;
   1499  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1500  1.105   hannken 	if (error)
   1501  1.105   hannken 		return error;
   1502   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_inactive), &a));
   1503  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1504   1.72        ad 	return error;
   1505   1.23   thorpej }
   1506    1.1       cgd 
   1507   1.31  jdolecek const int vop_reclaim_vp_offsets[] = {
   1508  1.104  riastrad 	VOPARG_OFFSETOF(struct vop_reclaim_v2_args,a_vp),
   1509    1.1       cgd 	VDESC_NO_OFFSET
   1510    1.1       cgd };
   1511   1.33  jdolecek const struct vnodeop_desc vop_reclaim_desc = {
   1512   1.67     pooka 	VOP_RECLAIM_DESCOFFSET,
   1513    1.1       cgd 	"vop_reclaim",
   1514    1.1       cgd 	0,
   1515    1.1       cgd 	vop_reclaim_vp_offsets,
   1516    1.1       cgd 	VDESC_NO_OFFSET,
   1517    1.1       cgd 	VDESC_NO_OFFSET,
   1518    1.1       cgd 	VDESC_NO_OFFSET,
   1519    1.1       cgd };
   1520   1.23   thorpej int
   1521   1.73     pooka VOP_RECLAIM(struct vnode *vp)
   1522   1.23   thorpej {
   1523   1.72        ad 	int error;
   1524   1.72        ad 	bool mpsafe;
   1525  1.104  riastrad 	struct vop_reclaim_v2_args a;
   1526  1.105   hannken 	struct mount *mp;
   1527   1.23   thorpej 	a.a_desc = VDESC(vop_reclaim);
   1528   1.23   thorpej 	a.a_vp = vp;
   1529  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1530  1.105   hannken 	if (error)
   1531  1.105   hannken 		return error;
   1532   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_reclaim), &a));
   1533  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1534   1.72        ad 	return error;
   1535   1.23   thorpej }
   1536    1.1       cgd 
   1537   1.31  jdolecek const int vop_lock_vp_offsets[] = {
   1538    1.1       cgd 	VOPARG_OFFSETOF(struct vop_lock_args,a_vp),
   1539    1.1       cgd 	VDESC_NO_OFFSET
   1540    1.1       cgd };
   1541   1.33  jdolecek const struct vnodeop_desc vop_lock_desc = {
   1542   1.67     pooka 	VOP_LOCK_DESCOFFSET,
   1543    1.1       cgd 	"vop_lock",
   1544    1.1       cgd 	0,
   1545    1.1       cgd 	vop_lock_vp_offsets,
   1546    1.1       cgd 	VDESC_NO_OFFSET,
   1547    1.1       cgd 	VDESC_NO_OFFSET,
   1548    1.1       cgd 	VDESC_NO_OFFSET,
   1549    1.1       cgd };
   1550   1.23   thorpej int
   1551   1.60   thorpej VOP_LOCK(struct vnode *vp,
   1552   1.60   thorpej     int flags)
   1553   1.23   thorpej {
   1554   1.72        ad 	int error;
   1555   1.72        ad 	bool mpsafe;
   1556   1.23   thorpej 	struct vop_lock_args a;
   1557  1.105   hannken 	struct mount *mp;
   1558   1.23   thorpej 	a.a_desc = VDESC(vop_lock);
   1559   1.23   thorpej 	a.a_vp = vp;
   1560   1.23   thorpej 	a.a_flags = flags;
   1561  1.110        ad 	error = vop_pre(vp, &mp, &mpsafe, (!(flags & (LK_SHARED|LK_EXCLUSIVE)) ? FST_NO : (flags & LK_NOWAIT ? FST_TRY : FST_YES)));
   1562  1.105   hannken 	if (error)
   1563  1.105   hannken 		return error;
   1564   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_lock), &a));
   1565  1.109        ad 	vop_post(vp, mp, mpsafe, (flags & (LK_UPGRADE|LK_DOWNGRADE) ? FST_NO : (error ? FST_YES : FST_NO)));
   1566   1.72        ad 	return error;
   1567   1.23   thorpej }
   1568    1.1       cgd 
   1569   1.31  jdolecek const int vop_unlock_vp_offsets[] = {
   1570    1.1       cgd 	VOPARG_OFFSETOF(struct vop_unlock_args,a_vp),
   1571    1.1       cgd 	VDESC_NO_OFFSET
   1572    1.1       cgd };
   1573   1.33  jdolecek const struct vnodeop_desc vop_unlock_desc = {
   1574   1.67     pooka 	VOP_UNLOCK_DESCOFFSET,
   1575    1.1       cgd 	"vop_unlock",
   1576    1.1       cgd 	0,
   1577    1.1       cgd 	vop_unlock_vp_offsets,
   1578    1.1       cgd 	VDESC_NO_OFFSET,
   1579    1.1       cgd 	VDESC_NO_OFFSET,
   1580    1.1       cgd 	VDESC_NO_OFFSET,
   1581    1.1       cgd };
   1582   1.23   thorpej int
   1583   1.85   hannken VOP_UNLOCK(struct vnode *vp)
   1584   1.23   thorpej {
   1585   1.72        ad 	int error;
   1586   1.72        ad 	bool mpsafe;
   1587   1.23   thorpej 	struct vop_unlock_args a;
   1588  1.105   hannken 	struct mount *mp;
   1589   1.23   thorpej 	a.a_desc = VDESC(vop_unlock);
   1590   1.23   thorpej 	a.a_vp = vp;
   1591  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1592  1.105   hannken 	if (error)
   1593  1.105   hannken 		return error;
   1594   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_unlock), &a));
   1595  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
   1596   1.72        ad 	return error;
   1597   1.23   thorpej }
   1598    1.1       cgd 
   1599   1.31  jdolecek const int vop_bmap_vp_offsets[] = {
   1600    1.1       cgd 	VOPARG_OFFSETOF(struct vop_bmap_args,a_vp),
   1601    1.1       cgd 	VDESC_NO_OFFSET
   1602    1.1       cgd };
   1603   1.33  jdolecek const struct vnodeop_desc vop_bmap_desc = {
   1604   1.67     pooka 	VOP_BMAP_DESCOFFSET,
   1605    1.1       cgd 	"vop_bmap",
   1606    1.1       cgd 	0,
   1607    1.1       cgd 	vop_bmap_vp_offsets,
   1608    1.1       cgd 	VOPARG_OFFSETOF(struct vop_bmap_args, a_vpp),
   1609    1.1       cgd 	VDESC_NO_OFFSET,
   1610    1.1       cgd 	VDESC_NO_OFFSET,
   1611    1.1       cgd };
   1612   1.23   thorpej int
   1613   1.60   thorpej VOP_BMAP(struct vnode *vp,
   1614   1.60   thorpej     daddr_t bn,
   1615   1.60   thorpej     struct vnode **vpp,
   1616   1.60   thorpej     daddr_t *bnp,
   1617   1.60   thorpej     int *runp)
   1618   1.23   thorpej {
   1619   1.72        ad 	int error;
   1620   1.72        ad 	bool mpsafe;
   1621   1.23   thorpej 	struct vop_bmap_args a;
   1622  1.105   hannken 	struct mount *mp;
   1623   1.23   thorpej 	a.a_desc = VDESC(vop_bmap);
   1624   1.23   thorpej 	a.a_vp = vp;
   1625   1.23   thorpej 	a.a_bn = bn;
   1626   1.23   thorpej 	a.a_vpp = vpp;
   1627   1.23   thorpej 	a.a_bnp = bnp;
   1628   1.23   thorpej 	a.a_runp = runp;
   1629  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1630  1.105   hannken 	if (error)
   1631  1.105   hannken 		return error;
   1632   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_bmap), &a));
   1633  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
   1634   1.72        ad 	return error;
   1635   1.23   thorpej }
   1636    1.1       cgd 
   1637   1.46   hannken const int vop_strategy_vp_offsets[] = {
   1638   1.46   hannken 	VOPARG_OFFSETOF(struct vop_strategy_args,a_vp),
   1639   1.46   hannken 	VDESC_NO_OFFSET
   1640   1.46   hannken };
   1641   1.46   hannken const struct vnodeop_desc vop_strategy_desc = {
   1642   1.67     pooka 	VOP_STRATEGY_DESCOFFSET,
   1643   1.46   hannken 	"vop_strategy",
   1644   1.46   hannken 	0,
   1645   1.46   hannken 	vop_strategy_vp_offsets,
   1646   1.46   hannken 	VDESC_NO_OFFSET,
   1647   1.46   hannken 	VDESC_NO_OFFSET,
   1648   1.46   hannken 	VDESC_NO_OFFSET,
   1649   1.46   hannken };
   1650   1.46   hannken int
   1651   1.60   thorpej VOP_STRATEGY(struct vnode *vp,
   1652   1.60   thorpej     struct buf *bp)
   1653   1.46   hannken {
   1654   1.72        ad 	int error;
   1655   1.72        ad 	bool mpsafe;
   1656   1.46   hannken 	struct vop_strategy_args a;
   1657  1.105   hannken 	struct mount *mp;
   1658   1.46   hannken 	a.a_desc = VDESC(vop_strategy);
   1659   1.46   hannken 	a.a_vp = vp;
   1660   1.46   hannken 	a.a_bp = bp;
   1661  1.112   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1662  1.105   hannken 	if (error)
   1663  1.105   hannken 		return error;
   1664   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_strategy), &a));
   1665  1.112   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1666   1.72        ad 	return error;
   1667   1.46   hannken }
   1668   1.46   hannken 
   1669   1.31  jdolecek const int vop_print_vp_offsets[] = {
   1670    1.1       cgd 	VOPARG_OFFSETOF(struct vop_print_args,a_vp),
   1671    1.1       cgd 	VDESC_NO_OFFSET
   1672    1.1       cgd };
   1673   1.33  jdolecek const struct vnodeop_desc vop_print_desc = {
   1674   1.67     pooka 	VOP_PRINT_DESCOFFSET,
   1675    1.1       cgd 	"vop_print",
   1676    1.1       cgd 	0,
   1677    1.1       cgd 	vop_print_vp_offsets,
   1678    1.1       cgd 	VDESC_NO_OFFSET,
   1679    1.1       cgd 	VDESC_NO_OFFSET,
   1680    1.1       cgd 	VDESC_NO_OFFSET,
   1681    1.1       cgd };
   1682   1.23   thorpej int
   1683   1.60   thorpej VOP_PRINT(struct vnode *vp)
   1684   1.23   thorpej {
   1685   1.72        ad 	int error;
   1686   1.72        ad 	bool mpsafe;
   1687   1.23   thorpej 	struct vop_print_args a;
   1688  1.105   hannken 	struct mount *mp;
   1689   1.23   thorpej 	a.a_desc = VDESC(vop_print);
   1690   1.23   thorpej 	a.a_vp = vp;
   1691  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1692  1.105   hannken 	if (error)
   1693  1.105   hannken 		return error;
   1694   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_print), &a));
   1695  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_YES);
   1696   1.72        ad 	return error;
   1697   1.23   thorpej }
   1698    1.1       cgd 
   1699   1.31  jdolecek const int vop_islocked_vp_offsets[] = {
   1700    1.1       cgd 	VOPARG_OFFSETOF(struct vop_islocked_args,a_vp),
   1701    1.1       cgd 	VDESC_NO_OFFSET
   1702    1.1       cgd };
   1703   1.33  jdolecek const struct vnodeop_desc vop_islocked_desc = {
   1704   1.67     pooka 	VOP_ISLOCKED_DESCOFFSET,
   1705    1.1       cgd 	"vop_islocked",
   1706    1.1       cgd 	0,
   1707    1.1       cgd 	vop_islocked_vp_offsets,
   1708    1.1       cgd 	VDESC_NO_OFFSET,
   1709    1.1       cgd 	VDESC_NO_OFFSET,
   1710    1.1       cgd 	VDESC_NO_OFFSET,
   1711    1.1       cgd };
   1712   1.23   thorpej int
   1713   1.60   thorpej VOP_ISLOCKED(struct vnode *vp)
   1714   1.23   thorpej {
   1715   1.72        ad 	int error;
   1716   1.72        ad 	bool mpsafe;
   1717   1.23   thorpej 	struct vop_islocked_args a;
   1718  1.105   hannken 	struct mount *mp;
   1719   1.23   thorpej 	a.a_desc = VDESC(vop_islocked);
   1720   1.23   thorpej 	a.a_vp = vp;
   1721  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1722  1.105   hannken 	if (error)
   1723  1.105   hannken 		return error;
   1724   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_islocked), &a));
   1725  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1726   1.72        ad 	return error;
   1727   1.23   thorpej }
   1728    1.1       cgd 
   1729   1.31  jdolecek const int vop_pathconf_vp_offsets[] = {
   1730    1.1       cgd 	VOPARG_OFFSETOF(struct vop_pathconf_args,a_vp),
   1731    1.1       cgd 	VDESC_NO_OFFSET
   1732    1.1       cgd };
   1733   1.33  jdolecek const struct vnodeop_desc vop_pathconf_desc = {
   1734   1.67     pooka 	VOP_PATHCONF_DESCOFFSET,
   1735    1.1       cgd 	"vop_pathconf",
   1736    1.1       cgd 	0,
   1737    1.1       cgd 	vop_pathconf_vp_offsets,
   1738    1.1       cgd 	VDESC_NO_OFFSET,
   1739    1.1       cgd 	VDESC_NO_OFFSET,
   1740    1.1       cgd 	VDESC_NO_OFFSET,
   1741    1.1       cgd };
   1742   1.23   thorpej int
   1743   1.60   thorpej VOP_PATHCONF(struct vnode *vp,
   1744   1.60   thorpej     int name,
   1745   1.60   thorpej     register_t *retval)
   1746   1.23   thorpej {
   1747   1.72        ad 	int error;
   1748   1.72        ad 	bool mpsafe;
   1749   1.23   thorpej 	struct vop_pathconf_args a;
   1750  1.105   hannken 	struct mount *mp;
   1751   1.23   thorpej 	a.a_desc = VDESC(vop_pathconf);
   1752   1.23   thorpej 	a.a_vp = vp;
   1753   1.23   thorpej 	a.a_name = name;
   1754   1.23   thorpej 	a.a_retval = retval;
   1755  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1756  1.105   hannken 	if (error)
   1757  1.105   hannken 		return error;
   1758   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_pathconf), &a));
   1759  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1760   1.72        ad 	return error;
   1761   1.23   thorpej }
   1762    1.1       cgd 
   1763   1.31  jdolecek const int vop_advlock_vp_offsets[] = {
   1764    1.1       cgd 	VOPARG_OFFSETOF(struct vop_advlock_args,a_vp),
   1765    1.1       cgd 	VDESC_NO_OFFSET
   1766    1.1       cgd };
   1767   1.33  jdolecek const struct vnodeop_desc vop_advlock_desc = {
   1768   1.67     pooka 	VOP_ADVLOCK_DESCOFFSET,
   1769    1.1       cgd 	"vop_advlock",
   1770    1.1       cgd 	0,
   1771    1.1       cgd 	vop_advlock_vp_offsets,
   1772    1.1       cgd 	VDESC_NO_OFFSET,
   1773    1.1       cgd 	VDESC_NO_OFFSET,
   1774    1.1       cgd 	VDESC_NO_OFFSET,
   1775    1.1       cgd };
   1776   1.23   thorpej int
   1777   1.60   thorpej VOP_ADVLOCK(struct vnode *vp,
   1778   1.60   thorpej     void *id,
   1779   1.60   thorpej     int op,
   1780   1.60   thorpej     struct flock *fl,
   1781   1.60   thorpej     int flags)
   1782   1.23   thorpej {
   1783   1.72        ad 	int error;
   1784   1.72        ad 	bool mpsafe;
   1785   1.23   thorpej 	struct vop_advlock_args a;
   1786  1.105   hannken 	struct mount *mp;
   1787   1.23   thorpej 	a.a_desc = VDESC(vop_advlock);
   1788   1.23   thorpej 	a.a_vp = vp;
   1789   1.23   thorpej 	a.a_id = id;
   1790   1.23   thorpej 	a.a_op = op;
   1791   1.23   thorpej 	a.a_fl = fl;
   1792   1.23   thorpej 	a.a_flags = flags;
   1793  1.107   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1794  1.105   hannken 	if (error)
   1795  1.105   hannken 		return error;
   1796   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_advlock), &a));
   1797  1.107   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1798   1.72        ad 	return error;
   1799   1.23   thorpej }
   1800    1.1       cgd 
   1801   1.31  jdolecek const int vop_whiteout_vp_offsets[] = {
   1802    1.1       cgd 	VOPARG_OFFSETOF(struct vop_whiteout_args,a_dvp),
   1803    1.1       cgd 	VDESC_NO_OFFSET
   1804    1.1       cgd };
   1805   1.33  jdolecek const struct vnodeop_desc vop_whiteout_desc = {
   1806   1.67     pooka 	VOP_WHITEOUT_DESCOFFSET,
   1807    1.1       cgd 	"vop_whiteout",
   1808    1.1       cgd 	0,
   1809    1.1       cgd 	vop_whiteout_vp_offsets,
   1810    1.1       cgd 	VDESC_NO_OFFSET,
   1811    1.1       cgd 	VDESC_NO_OFFSET,
   1812    1.1       cgd 	VOPARG_OFFSETOF(struct vop_whiteout_args, a_cnp),
   1813    1.1       cgd };
   1814   1.23   thorpej int
   1815   1.60   thorpej VOP_WHITEOUT(struct vnode *dvp,
   1816   1.60   thorpej     struct componentname *cnp,
   1817   1.60   thorpej     int flags)
   1818   1.23   thorpej {
   1819   1.72        ad 	int error;
   1820   1.72        ad 	bool mpsafe;
   1821   1.23   thorpej 	struct vop_whiteout_args a;
   1822  1.105   hannken 	struct mount *mp;
   1823   1.23   thorpej 	a.a_desc = VDESC(vop_whiteout);
   1824   1.23   thorpej 	a.a_dvp = dvp;
   1825   1.23   thorpej 	a.a_cnp = cnp;
   1826   1.23   thorpej 	a.a_flags = flags;
   1827  1.105   hannken 	error = vop_pre(dvp, &mp, &mpsafe, FST_NO);
   1828  1.105   hannken 	if (error)
   1829  1.105   hannken 		return error;
   1830   1.72        ad 	error = (VCALL(dvp, VOFFSET(vop_whiteout), &a));
   1831  1.105   hannken 	vop_post(dvp, mp, mpsafe, FST_NO);
   1832   1.72        ad 	return error;
   1833   1.23   thorpej }
   1834    1.1       cgd 
   1835   1.31  jdolecek const int vop_getpages_vp_offsets[] = {
   1836   1.26       chs 	VOPARG_OFFSETOF(struct vop_getpages_args,a_vp),
   1837   1.26       chs 	VDESC_NO_OFFSET
   1838   1.26       chs };
   1839   1.33  jdolecek const struct vnodeop_desc vop_getpages_desc = {
   1840   1.67     pooka 	VOP_GETPAGES_DESCOFFSET,
   1841   1.26       chs 	"vop_getpages",
   1842   1.26       chs 	0,
   1843   1.26       chs 	vop_getpages_vp_offsets,
   1844   1.26       chs 	VDESC_NO_OFFSET,
   1845   1.26       chs 	VDESC_NO_OFFSET,
   1846   1.26       chs 	VDESC_NO_OFFSET,
   1847   1.26       chs };
   1848   1.26       chs int
   1849   1.60   thorpej VOP_GETPAGES(struct vnode *vp,
   1850   1.60   thorpej     voff_t offset,
   1851   1.60   thorpej     struct vm_page **m,
   1852   1.60   thorpej     int *count,
   1853   1.60   thorpej     int centeridx,
   1854   1.60   thorpej     vm_prot_t access_type,
   1855   1.60   thorpej     int advice,
   1856   1.60   thorpej     int flags)
   1857   1.26       chs {
   1858   1.72        ad 	int error;
   1859   1.72        ad 	bool mpsafe;
   1860   1.26       chs 	struct vop_getpages_args a;
   1861  1.105   hannken 	struct mount *mp;
   1862   1.26       chs 	a.a_desc = VDESC(vop_getpages);
   1863   1.26       chs 	a.a_vp = vp;
   1864   1.26       chs 	a.a_offset = offset;
   1865   1.26       chs 	a.a_m = m;
   1866   1.26       chs 	a.a_count = count;
   1867   1.26       chs 	a.a_centeridx = centeridx;
   1868   1.26       chs 	a.a_access_type = access_type;
   1869   1.26       chs 	a.a_advice = advice;
   1870   1.26       chs 	a.a_flags = flags;
   1871  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1872  1.105   hannken 	if (error)
   1873  1.105   hannken 		return error;
   1874   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_getpages), &a));
   1875  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1876   1.72        ad 	return error;
   1877   1.26       chs }
   1878   1.26       chs 
   1879   1.31  jdolecek const int vop_putpages_vp_offsets[] = {
   1880   1.26       chs 	VOPARG_OFFSETOF(struct vop_putpages_args,a_vp),
   1881   1.26       chs 	VDESC_NO_OFFSET
   1882   1.26       chs };
   1883   1.33  jdolecek const struct vnodeop_desc vop_putpages_desc = {
   1884   1.67     pooka 	VOP_PUTPAGES_DESCOFFSET,
   1885   1.26       chs 	"vop_putpages",
   1886   1.26       chs 	0,
   1887   1.26       chs 	vop_putpages_vp_offsets,
   1888   1.26       chs 	VDESC_NO_OFFSET,
   1889   1.26       chs 	VDESC_NO_OFFSET,
   1890   1.26       chs 	VDESC_NO_OFFSET,
   1891   1.26       chs };
   1892   1.26       chs int
   1893   1.60   thorpej VOP_PUTPAGES(struct vnode *vp,
   1894   1.60   thorpej     voff_t offlo,
   1895   1.60   thorpej     voff_t offhi,
   1896   1.60   thorpej     int flags)
   1897   1.26       chs {
   1898   1.72        ad 	int error;
   1899   1.72        ad 	bool mpsafe;
   1900   1.26       chs 	struct vop_putpages_args a;
   1901  1.105   hannken 	struct mount *mp;
   1902   1.26       chs 	a.a_desc = VDESC(vop_putpages);
   1903   1.26       chs 	a.a_vp = vp;
   1904   1.38       chs 	a.a_offlo = offlo;
   1905   1.38       chs 	a.a_offhi = offhi;
   1906   1.26       chs 	a.a_flags = flags;
   1907  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   1908  1.105   hannken 	if (error)
   1909  1.105   hannken 		return error;
   1910   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_putpages), &a));
   1911  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   1912   1.72        ad 	return error;
   1913   1.26       chs }
   1914   1.26       chs 
   1915  1.111  christos const int vop_getacl_vp_offsets[] = {
   1916  1.111  christos 	VOPARG_OFFSETOF(struct vop_getacl_args,a_vp),
   1917  1.111  christos 	VDESC_NO_OFFSET
   1918  1.111  christos };
   1919  1.111  christos const struct vnodeop_desc vop_getacl_desc = {
   1920  1.111  christos 	VOP_GETACL_DESCOFFSET,
   1921  1.111  christos 	"vop_getacl",
   1922  1.111  christos 	0,
   1923  1.111  christos 	vop_getacl_vp_offsets,
   1924  1.111  christos 	VDESC_NO_OFFSET,
   1925  1.111  christos 	VOPARG_OFFSETOF(struct vop_getacl_args, a_cred),
   1926  1.111  christos 	VDESC_NO_OFFSET,
   1927  1.111  christos };
   1928  1.111  christos int
   1929  1.111  christos VOP_GETACL(struct vnode *vp,
   1930  1.111  christos     acl_type_t type,
   1931  1.111  christos     struct acl *aclp,
   1932  1.111  christos     kauth_cred_t cred)
   1933  1.111  christos {
   1934  1.111  christos 	int error;
   1935  1.111  christos 	bool mpsafe;
   1936  1.111  christos 	struct vop_getacl_args a;
   1937  1.111  christos 	struct mount *mp;
   1938  1.111  christos 	a.a_desc = VDESC(vop_getacl);
   1939  1.111  christos 	a.a_vp = vp;
   1940  1.111  christos 	a.a_type = type;
   1941  1.111  christos 	a.a_aclp = aclp;
   1942  1.111  christos 	a.a_cred = cred;
   1943  1.111  christos 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1944  1.111  christos 	if (error)
   1945  1.111  christos 		return error;
   1946  1.111  christos 	error = (VCALL(vp, VOFFSET(vop_getacl), &a));
   1947  1.111  christos 	vop_post(vp, mp, mpsafe, FST_YES);
   1948  1.111  christos 	return error;
   1949  1.111  christos }
   1950  1.111  christos 
   1951  1.111  christos const int vop_setacl_vp_offsets[] = {
   1952  1.111  christos 	VOPARG_OFFSETOF(struct vop_setacl_args,a_vp),
   1953  1.111  christos 	VDESC_NO_OFFSET
   1954  1.111  christos };
   1955  1.111  christos const struct vnodeop_desc vop_setacl_desc = {
   1956  1.111  christos 	VOP_SETACL_DESCOFFSET,
   1957  1.111  christos 	"vop_setacl",
   1958  1.111  christos 	0,
   1959  1.111  christos 	vop_setacl_vp_offsets,
   1960  1.111  christos 	VDESC_NO_OFFSET,
   1961  1.111  christos 	VOPARG_OFFSETOF(struct vop_setacl_args, a_cred),
   1962  1.111  christos 	VDESC_NO_OFFSET,
   1963  1.111  christos };
   1964  1.111  christos int
   1965  1.111  christos VOP_SETACL(struct vnode *vp,
   1966  1.111  christos     acl_type_t type,
   1967  1.111  christos     struct acl *aclp,
   1968  1.111  christos     kauth_cred_t cred)
   1969  1.111  christos {
   1970  1.111  christos 	int error;
   1971  1.111  christos 	bool mpsafe;
   1972  1.111  christos 	struct vop_setacl_args a;
   1973  1.111  christos 	struct mount *mp;
   1974  1.111  christos 	a.a_desc = VDESC(vop_setacl);
   1975  1.111  christos 	a.a_vp = vp;
   1976  1.111  christos 	a.a_type = type;
   1977  1.111  christos 	a.a_aclp = aclp;
   1978  1.111  christos 	a.a_cred = cred;
   1979  1.111  christos 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   1980  1.111  christos 	if (error)
   1981  1.111  christos 		return error;
   1982  1.111  christos 	error = (VCALL(vp, VOFFSET(vop_setacl), &a));
   1983  1.111  christos 	vop_post(vp, mp, mpsafe, FST_YES);
   1984  1.115   thorpej 	vop_setacl_post(&a, error);
   1985  1.111  christos 	return error;
   1986  1.111  christos }
   1987  1.111  christos 
   1988  1.111  christos const int vop_aclcheck_vp_offsets[] = {
   1989  1.111  christos 	VOPARG_OFFSETOF(struct vop_aclcheck_args,a_vp),
   1990  1.111  christos 	VDESC_NO_OFFSET
   1991  1.111  christos };
   1992  1.111  christos const struct vnodeop_desc vop_aclcheck_desc = {
   1993  1.111  christos 	VOP_ACLCHECK_DESCOFFSET,
   1994  1.111  christos 	"vop_aclcheck",
   1995  1.111  christos 	0,
   1996  1.111  christos 	vop_aclcheck_vp_offsets,
   1997  1.111  christos 	VDESC_NO_OFFSET,
   1998  1.111  christos 	VOPARG_OFFSETOF(struct vop_aclcheck_args, a_cred),
   1999  1.111  christos 	VDESC_NO_OFFSET,
   2000  1.111  christos };
   2001  1.111  christos int
   2002  1.111  christos VOP_ACLCHECK(struct vnode *vp,
   2003  1.111  christos     acl_type_t type,
   2004  1.111  christos     struct acl *aclp,
   2005  1.111  christos     kauth_cred_t cred)
   2006  1.111  christos {
   2007  1.111  christos 	int error;
   2008  1.111  christos 	bool mpsafe;
   2009  1.111  christos 	struct vop_aclcheck_args a;
   2010  1.111  christos 	struct mount *mp;
   2011  1.111  christos 	a.a_desc = VDESC(vop_aclcheck);
   2012  1.111  christos 	a.a_vp = vp;
   2013  1.111  christos 	a.a_type = type;
   2014  1.111  christos 	a.a_aclp = aclp;
   2015  1.111  christos 	a.a_cred = cred;
   2016  1.111  christos 	error = vop_pre(vp, &mp, &mpsafe, FST_YES);
   2017  1.111  christos 	if (error)
   2018  1.111  christos 		return error;
   2019  1.111  christos 	error = (VCALL(vp, VOFFSET(vop_aclcheck), &a));
   2020  1.111  christos 	vop_post(vp, mp, mpsafe, FST_YES);
   2021  1.111  christos 	return error;
   2022  1.111  christos }
   2023  1.111  christos 
   2024   1.51   thorpej const int vop_closeextattr_vp_offsets[] = {
   2025   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_closeextattr_args,a_vp),
   2026   1.51   thorpej 	VDESC_NO_OFFSET
   2027   1.51   thorpej };
   2028   1.51   thorpej const struct vnodeop_desc vop_closeextattr_desc = {
   2029   1.67     pooka 	VOP_CLOSEEXTATTR_DESCOFFSET,
   2030   1.51   thorpej 	"vop_closeextattr",
   2031   1.51   thorpej 	0,
   2032   1.51   thorpej 	vop_closeextattr_vp_offsets,
   2033   1.51   thorpej 	VDESC_NO_OFFSET,
   2034   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_closeextattr_args, a_cred),
   2035   1.51   thorpej 	VDESC_NO_OFFSET,
   2036   1.51   thorpej };
   2037   1.51   thorpej int
   2038   1.60   thorpej VOP_CLOSEEXTATTR(struct vnode *vp,
   2039   1.60   thorpej     int commit,
   2040   1.73     pooka     kauth_cred_t cred)
   2041   1.51   thorpej {
   2042   1.72        ad 	int error;
   2043   1.72        ad 	bool mpsafe;
   2044   1.51   thorpej 	struct vop_closeextattr_args a;
   2045  1.105   hannken 	struct mount *mp;
   2046   1.51   thorpej 	a.a_desc = VDESC(vop_closeextattr);
   2047   1.51   thorpej 	a.a_vp = vp;
   2048   1.51   thorpej 	a.a_commit = commit;
   2049   1.51   thorpej 	a.a_cred = cred;
   2050  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2051  1.105   hannken 	if (error)
   2052  1.105   hannken 		return error;
   2053   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_closeextattr), &a));
   2054  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2055   1.72        ad 	return error;
   2056   1.51   thorpej }
   2057   1.51   thorpej 
   2058   1.51   thorpej const int vop_getextattr_vp_offsets[] = {
   2059   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_getextattr_args,a_vp),
   2060   1.51   thorpej 	VDESC_NO_OFFSET
   2061   1.51   thorpej };
   2062   1.51   thorpej const struct vnodeop_desc vop_getextattr_desc = {
   2063   1.67     pooka 	VOP_GETEXTATTR_DESCOFFSET,
   2064   1.51   thorpej 	"vop_getextattr",
   2065   1.51   thorpej 	0,
   2066   1.51   thorpej 	vop_getextattr_vp_offsets,
   2067   1.51   thorpej 	VDESC_NO_OFFSET,
   2068   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_getextattr_args, a_cred),
   2069   1.51   thorpej 	VDESC_NO_OFFSET,
   2070   1.51   thorpej };
   2071   1.51   thorpej int
   2072   1.60   thorpej VOP_GETEXTATTR(struct vnode *vp,
   2073   1.60   thorpej     int attrnamespace,
   2074   1.60   thorpej     const char *name,
   2075   1.60   thorpej     struct uio *uio,
   2076   1.60   thorpej     size_t *size,
   2077   1.73     pooka     kauth_cred_t cred)
   2078   1.51   thorpej {
   2079   1.72        ad 	int error;
   2080   1.72        ad 	bool mpsafe;
   2081   1.51   thorpej 	struct vop_getextattr_args a;
   2082  1.105   hannken 	struct mount *mp;
   2083   1.51   thorpej 	a.a_desc = VDESC(vop_getextattr);
   2084   1.51   thorpej 	a.a_vp = vp;
   2085   1.51   thorpej 	a.a_attrnamespace = attrnamespace;
   2086   1.51   thorpej 	a.a_name = name;
   2087   1.51   thorpej 	a.a_uio = uio;
   2088   1.51   thorpej 	a.a_size = size;
   2089   1.51   thorpej 	a.a_cred = cred;
   2090  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2091  1.105   hannken 	if (error)
   2092  1.105   hannken 		return error;
   2093   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_getextattr), &a));
   2094  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2095   1.72        ad 	return error;
   2096   1.51   thorpej }
   2097   1.51   thorpej 
   2098   1.51   thorpej const int vop_listextattr_vp_offsets[] = {
   2099   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_listextattr_args,a_vp),
   2100   1.51   thorpej 	VDESC_NO_OFFSET
   2101   1.51   thorpej };
   2102   1.51   thorpej const struct vnodeop_desc vop_listextattr_desc = {
   2103   1.67     pooka 	VOP_LISTEXTATTR_DESCOFFSET,
   2104   1.51   thorpej 	"vop_listextattr",
   2105   1.51   thorpej 	0,
   2106   1.51   thorpej 	vop_listextattr_vp_offsets,
   2107   1.51   thorpej 	VDESC_NO_OFFSET,
   2108   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_listextattr_args, a_cred),
   2109   1.51   thorpej 	VDESC_NO_OFFSET,
   2110   1.51   thorpej };
   2111   1.51   thorpej int
   2112   1.60   thorpej VOP_LISTEXTATTR(struct vnode *vp,
   2113   1.60   thorpej     int attrnamespace,
   2114   1.60   thorpej     struct uio *uio,
   2115   1.60   thorpej     size_t *size,
   2116   1.87      manu     int flag,
   2117   1.73     pooka     kauth_cred_t cred)
   2118   1.51   thorpej {
   2119   1.72        ad 	int error;
   2120   1.72        ad 	bool mpsafe;
   2121   1.51   thorpej 	struct vop_listextattr_args a;
   2122  1.105   hannken 	struct mount *mp;
   2123   1.51   thorpej 	a.a_desc = VDESC(vop_listextattr);
   2124   1.51   thorpej 	a.a_vp = vp;
   2125   1.51   thorpej 	a.a_attrnamespace = attrnamespace;
   2126   1.51   thorpej 	a.a_uio = uio;
   2127   1.51   thorpej 	a.a_size = size;
   2128   1.87      manu 	a.a_flag = flag;
   2129   1.51   thorpej 	a.a_cred = cred;
   2130  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2131  1.105   hannken 	if (error)
   2132  1.105   hannken 		return error;
   2133   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_listextattr), &a));
   2134  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2135   1.72        ad 	return error;
   2136   1.51   thorpej }
   2137   1.51   thorpej 
   2138   1.51   thorpej const int vop_openextattr_vp_offsets[] = {
   2139   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_openextattr_args,a_vp),
   2140   1.51   thorpej 	VDESC_NO_OFFSET
   2141   1.51   thorpej };
   2142   1.51   thorpej const struct vnodeop_desc vop_openextattr_desc = {
   2143   1.67     pooka 	VOP_OPENEXTATTR_DESCOFFSET,
   2144   1.51   thorpej 	"vop_openextattr",
   2145   1.51   thorpej 	0,
   2146   1.51   thorpej 	vop_openextattr_vp_offsets,
   2147   1.51   thorpej 	VDESC_NO_OFFSET,
   2148   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_openextattr_args, a_cred),
   2149   1.51   thorpej 	VDESC_NO_OFFSET,
   2150   1.51   thorpej };
   2151   1.51   thorpej int
   2152   1.60   thorpej VOP_OPENEXTATTR(struct vnode *vp,
   2153   1.73     pooka     kauth_cred_t cred)
   2154   1.51   thorpej {
   2155   1.72        ad 	int error;
   2156   1.72        ad 	bool mpsafe;
   2157   1.51   thorpej 	struct vop_openextattr_args a;
   2158  1.105   hannken 	struct mount *mp;
   2159   1.51   thorpej 	a.a_desc = VDESC(vop_openextattr);
   2160   1.51   thorpej 	a.a_vp = vp;
   2161   1.51   thorpej 	a.a_cred = cred;
   2162  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2163  1.105   hannken 	if (error)
   2164  1.105   hannken 		return error;
   2165   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_openextattr), &a));
   2166  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2167   1.72        ad 	return error;
   2168   1.51   thorpej }
   2169   1.51   thorpej 
   2170   1.51   thorpej const int vop_deleteextattr_vp_offsets[] = {
   2171   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_deleteextattr_args,a_vp),
   2172   1.51   thorpej 	VDESC_NO_OFFSET
   2173   1.51   thorpej };
   2174   1.51   thorpej const struct vnodeop_desc vop_deleteextattr_desc = {
   2175   1.67     pooka 	VOP_DELETEEXTATTR_DESCOFFSET,
   2176   1.51   thorpej 	"vop_deleteextattr",
   2177   1.51   thorpej 	0,
   2178   1.51   thorpej 	vop_deleteextattr_vp_offsets,
   2179   1.51   thorpej 	VDESC_NO_OFFSET,
   2180   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_deleteextattr_args, a_cred),
   2181   1.51   thorpej 	VDESC_NO_OFFSET,
   2182   1.51   thorpej };
   2183   1.51   thorpej int
   2184   1.60   thorpej VOP_DELETEEXTATTR(struct vnode *vp,
   2185   1.60   thorpej     int attrnamespace,
   2186   1.60   thorpej     const char *name,
   2187   1.73     pooka     kauth_cred_t cred)
   2188   1.51   thorpej {
   2189   1.72        ad 	int error;
   2190   1.72        ad 	bool mpsafe;
   2191   1.51   thorpej 	struct vop_deleteextattr_args a;
   2192  1.105   hannken 	struct mount *mp;
   2193   1.51   thorpej 	a.a_desc = VDESC(vop_deleteextattr);
   2194   1.51   thorpej 	a.a_vp = vp;
   2195   1.51   thorpej 	a.a_attrnamespace = attrnamespace;
   2196   1.51   thorpej 	a.a_name = name;
   2197   1.51   thorpej 	a.a_cred = cred;
   2198  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2199  1.105   hannken 	if (error)
   2200  1.105   hannken 		return error;
   2201   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_deleteextattr), &a));
   2202  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2203   1.72        ad 	return error;
   2204   1.51   thorpej }
   2205   1.51   thorpej 
   2206   1.51   thorpej const int vop_setextattr_vp_offsets[] = {
   2207   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_setextattr_args,a_vp),
   2208   1.51   thorpej 	VDESC_NO_OFFSET
   2209   1.51   thorpej };
   2210   1.51   thorpej const struct vnodeop_desc vop_setextattr_desc = {
   2211   1.67     pooka 	VOP_SETEXTATTR_DESCOFFSET,
   2212   1.51   thorpej 	"vop_setextattr",
   2213   1.51   thorpej 	0,
   2214   1.51   thorpej 	vop_setextattr_vp_offsets,
   2215   1.51   thorpej 	VDESC_NO_OFFSET,
   2216   1.51   thorpej 	VOPARG_OFFSETOF(struct vop_setextattr_args, a_cred),
   2217   1.51   thorpej 	VDESC_NO_OFFSET,
   2218   1.51   thorpej };
   2219   1.51   thorpej int
   2220   1.60   thorpej VOP_SETEXTATTR(struct vnode *vp,
   2221   1.60   thorpej     int attrnamespace,
   2222   1.60   thorpej     const char *name,
   2223   1.60   thorpej     struct uio *uio,
   2224   1.73     pooka     kauth_cred_t cred)
   2225   1.51   thorpej {
   2226   1.72        ad 	int error;
   2227   1.72        ad 	bool mpsafe;
   2228   1.51   thorpej 	struct vop_setextattr_args a;
   2229  1.105   hannken 	struct mount *mp;
   2230   1.51   thorpej 	a.a_desc = VDESC(vop_setextattr);
   2231   1.51   thorpej 	a.a_vp = vp;
   2232   1.51   thorpej 	a.a_attrnamespace = attrnamespace;
   2233   1.51   thorpej 	a.a_name = name;
   2234   1.51   thorpej 	a.a_uio = uio;
   2235   1.51   thorpej 	a.a_cred = cred;
   2236  1.105   hannken 	error = vop_pre(vp, &mp, &mpsafe, FST_NO);
   2237  1.105   hannken 	if (error)
   2238  1.105   hannken 		return error;
   2239   1.72        ad 	error = (VCALL(vp, VOFFSET(vop_setextattr), &a));
   2240  1.105   hannken 	vop_post(vp, mp, mpsafe, FST_NO);
   2241   1.72        ad 	return error;
   2242   1.51   thorpej }
   2243   1.51   thorpej 
   2244   1.33  jdolecek const struct vnodeop_desc * const vfs_op_descs[] = {
   2245    1.1       cgd 	&vop_default_desc,	/* MUST BE FIRST */
   2246    1.1       cgd 
   2247   1.88   hannken 	&vop_bwrite_desc,
   2248  1.113  dholland 	&vop_parsepath_desc,
   2249    1.1       cgd 	&vop_lookup_desc,
   2250    1.1       cgd 	&vop_create_desc,
   2251    1.1       cgd 	&vop_mknod_desc,
   2252    1.1       cgd 	&vop_open_desc,
   2253    1.1       cgd 	&vop_close_desc,
   2254    1.1       cgd 	&vop_access_desc,
   2255  1.111  christos 	&vop_accessx_desc,
   2256    1.1       cgd 	&vop_getattr_desc,
   2257    1.1       cgd 	&vop_setattr_desc,
   2258    1.1       cgd 	&vop_read_desc,
   2259    1.1       cgd 	&vop_write_desc,
   2260   1.93  dholland 	&vop_fallocate_desc,
   2261   1.93  dholland 	&vop_fdiscard_desc,
   2262    1.1       cgd 	&vop_ioctl_desc,
   2263   1.18  wrstuden 	&vop_fcntl_desc,
   2264    1.3   mycroft 	&vop_poll_desc,
   2265   1.40  jdolecek 	&vop_kqfilter_desc,
   2266   1.10      fvdl 	&vop_revoke_desc,
   2267    1.1       cgd 	&vop_mmap_desc,
   2268    1.1       cgd 	&vop_fsync_desc,
   2269    1.1       cgd 	&vop_seek_desc,
   2270    1.1       cgd 	&vop_remove_desc,
   2271    1.1       cgd 	&vop_link_desc,
   2272    1.1       cgd 	&vop_rename_desc,
   2273    1.1       cgd 	&vop_mkdir_desc,
   2274    1.1       cgd 	&vop_rmdir_desc,
   2275    1.1       cgd 	&vop_symlink_desc,
   2276    1.1       cgd 	&vop_readdir_desc,
   2277    1.1       cgd 	&vop_readlink_desc,
   2278    1.1       cgd 	&vop_abortop_desc,
   2279    1.1       cgd 	&vop_inactive_desc,
   2280    1.1       cgd 	&vop_reclaim_desc,
   2281    1.1       cgd 	&vop_lock_desc,
   2282    1.1       cgd 	&vop_unlock_desc,
   2283    1.1       cgd 	&vop_bmap_desc,
   2284   1.46   hannken 	&vop_strategy_desc,
   2285    1.1       cgd 	&vop_print_desc,
   2286    1.1       cgd 	&vop_islocked_desc,
   2287    1.1       cgd 	&vop_pathconf_desc,
   2288    1.1       cgd 	&vop_advlock_desc,
   2289    1.1       cgd 	&vop_whiteout_desc,
   2290   1.26       chs 	&vop_getpages_desc,
   2291   1.26       chs 	&vop_putpages_desc,
   2292  1.111  christos 	&vop_getacl_desc,
   2293  1.111  christos 	&vop_setacl_desc,
   2294  1.111  christos 	&vop_aclcheck_desc,
   2295   1.51   thorpej 	&vop_closeextattr_desc,
   2296   1.51   thorpej 	&vop_getextattr_desc,
   2297   1.51   thorpej 	&vop_listextattr_desc,
   2298   1.51   thorpej 	&vop_openextattr_desc,
   2299   1.51   thorpej 	&vop_deleteextattr_desc,
   2300   1.51   thorpej 	&vop_setextattr_desc,
   2301    1.1       cgd 	NULL
   2302    1.1       cgd };
   2303