4 * Warning: DO NOT EDIT! This file is automatically generated!
5 * (Modifications made here may easily be lost!)
7 * Created from the file:
8 * NetBSD: vnode_if.src,v 1.58 2008/11/15 19:08:12 pooka Exp
10 * NetBSD: vnode_if.sh,v 1.52 2009/09/29 11:51:02 pooka Exp
14 * Copyright (c) 1992, 1993, 1994, 1995
15 * The Regents of the University of California. All rights reserved.
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 * 3. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 #include <sys/cdefs.h>
43 __KERNEL_RCSID(0, "$NetBSD$");
45 #include <sys/param.h>
46 #include <sys/mount.h>
48 #include <sys/vnode.h>
51 const struct vnodeop_desc vop_default_desc
= {
65 const int vop_bwrite_vp_offsets
[] = {
68 const struct vnodeop_desc vop_bwrite_desc
= {
69 VOP_BWRITE_DESCOFFSET
,
72 vop_bwrite_vp_offsets
,
79 VOP_BWRITE(struct buf
*bp
)
83 struct vop_bwrite_args a
;
84 a
.a_desc
= VDESC(vop_bwrite
);
86 mpsafe
= (bp
->b_vp
->v_vflag
& VV_MPSAFE
);
87 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
88 error
= (VCALL(bp
->b_vp
, VOFFSET(vop_bwrite
), &a
));
89 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
93 /* End of special cases */
95 const int vop_lookup_vp_offsets
[] = {
96 VOPARG_OFFSETOF(struct vop_lookup_args
,a_dvp
),
99 const struct vnodeop_desc vop_lookup_desc
= {
100 VOP_LOOKUP_DESCOFFSET
,
103 vop_lookup_vp_offsets
,
104 VOPARG_OFFSETOF(struct vop_lookup_args
, a_vpp
),
106 VOPARG_OFFSETOF(struct vop_lookup_args
, a_cnp
),
110 VOP_LOOKUP(struct vnode
*dvp
,
112 struct componentname
*cnp
)
116 struct vop_lookup_args a
;
117 a
.a_desc
= VDESC(vop_lookup
);
121 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
122 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
123 error
= (VCALL(dvp
, VOFFSET(vop_lookup
), &a
));
124 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
127 KASSERT((*vpp
)->v_size
!= VSIZENOTSET
128 && (*vpp
)->v_writesize
!= VSIZENOTSET
);
129 #endif /* DIAGNOSTIC */
133 const int vop_create_vp_offsets
[] = {
134 VOPARG_OFFSETOF(struct vop_create_args
,a_dvp
),
137 const struct vnodeop_desc vop_create_desc
= {
138 VOP_CREATE_DESCOFFSET
,
140 0 | VDESC_VP0_WILLPUT
,
141 vop_create_vp_offsets
,
142 VOPARG_OFFSETOF(struct vop_create_args
, a_vpp
),
144 VOPARG_OFFSETOF(struct vop_create_args
, a_cnp
),
148 VOP_CREATE(struct vnode
*dvp
,
150 struct componentname
*cnp
,
155 struct vop_create_args a
;
156 a
.a_desc
= VDESC(vop_create
);
161 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
162 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
163 error
= (VCALL(dvp
, VOFFSET(vop_create
), &a
));
164 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
167 KASSERT((*vpp
)->v_size
!= VSIZENOTSET
168 && (*vpp
)->v_writesize
!= VSIZENOTSET
);
169 #endif /* DIAGNOSTIC */
173 const int vop_mknod_vp_offsets
[] = {
174 VOPARG_OFFSETOF(struct vop_mknod_args
,a_dvp
),
177 const struct vnodeop_desc vop_mknod_desc
= {
178 VOP_MKNOD_DESCOFFSET
,
180 0 | VDESC_VP0_WILLPUT
,
181 vop_mknod_vp_offsets
,
182 VOPARG_OFFSETOF(struct vop_mknod_args
, a_vpp
),
184 VOPARG_OFFSETOF(struct vop_mknod_args
, a_cnp
),
188 VOP_MKNOD(struct vnode
*dvp
,
190 struct componentname
*cnp
,
195 struct vop_mknod_args a
;
196 a
.a_desc
= VDESC(vop_mknod
);
201 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
202 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
203 error
= (VCALL(dvp
, VOFFSET(vop_mknod
), &a
));
204 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
207 KASSERT((*vpp
)->v_size
!= VSIZENOTSET
208 && (*vpp
)->v_writesize
!= VSIZENOTSET
);
209 #endif /* DIAGNOSTIC */
213 const int vop_open_vp_offsets
[] = {
214 VOPARG_OFFSETOF(struct vop_open_args
,a_vp
),
217 const struct vnodeop_desc vop_open_desc
= {
223 VOPARG_OFFSETOF(struct vop_open_args
, a_cred
),
228 VOP_OPEN(struct vnode
*vp
,
234 struct vop_open_args a
;
235 a
.a_desc
= VDESC(vop_open
);
239 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
240 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
241 error
= (VCALL(vp
, VOFFSET(vop_open
), &a
));
242 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
246 const int vop_close_vp_offsets
[] = {
247 VOPARG_OFFSETOF(struct vop_close_args
,a_vp
),
250 const struct vnodeop_desc vop_close_desc
= {
251 VOP_CLOSE_DESCOFFSET
,
254 vop_close_vp_offsets
,
256 VOPARG_OFFSETOF(struct vop_close_args
, a_cred
),
261 VOP_CLOSE(struct vnode
*vp
,
267 struct vop_close_args a
;
268 a
.a_desc
= VDESC(vop_close
);
272 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
273 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
274 error
= (VCALL(vp
, VOFFSET(vop_close
), &a
));
275 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
279 const int vop_access_vp_offsets
[] = {
280 VOPARG_OFFSETOF(struct vop_access_args
,a_vp
),
283 const struct vnodeop_desc vop_access_desc
= {
284 VOP_ACCESS_DESCOFFSET
,
287 vop_access_vp_offsets
,
289 VOPARG_OFFSETOF(struct vop_access_args
, a_cred
),
294 VOP_ACCESS(struct vnode
*vp
,
300 struct vop_access_args a
;
301 a
.a_desc
= VDESC(vop_access
);
305 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
306 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
307 error
= (VCALL(vp
, VOFFSET(vop_access
), &a
));
308 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
312 const int vop_getattr_vp_offsets
[] = {
313 VOPARG_OFFSETOF(struct vop_getattr_args
,a_vp
),
316 const struct vnodeop_desc vop_getattr_desc
= {
317 VOP_GETATTR_DESCOFFSET
,
320 vop_getattr_vp_offsets
,
322 VOPARG_OFFSETOF(struct vop_getattr_args
, a_cred
),
327 VOP_GETATTR(struct vnode
*vp
,
333 struct vop_getattr_args a
;
334 a
.a_desc
= VDESC(vop_getattr
);
338 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
339 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
340 error
= (VCALL(vp
, VOFFSET(vop_getattr
), &a
));
341 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
345 const int vop_setattr_vp_offsets
[] = {
346 VOPARG_OFFSETOF(struct vop_setattr_args
,a_vp
),
349 const struct vnodeop_desc vop_setattr_desc
= {
350 VOP_SETATTR_DESCOFFSET
,
353 vop_setattr_vp_offsets
,
355 VOPARG_OFFSETOF(struct vop_setattr_args
, a_cred
),
360 VOP_SETATTR(struct vnode
*vp
,
366 struct vop_setattr_args a
;
367 a
.a_desc
= VDESC(vop_setattr
);
371 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
372 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
373 error
= (VCALL(vp
, VOFFSET(vop_setattr
), &a
));
374 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
378 const int vop_read_vp_offsets
[] = {
379 VOPARG_OFFSETOF(struct vop_read_args
,a_vp
),
382 const struct vnodeop_desc vop_read_desc
= {
388 VOPARG_OFFSETOF(struct vop_read_args
, a_cred
),
393 VOP_READ(struct vnode
*vp
,
400 struct vop_read_args a
;
401 a
.a_desc
= VDESC(vop_read
);
406 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
407 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
408 error
= (VCALL(vp
, VOFFSET(vop_read
), &a
));
409 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
413 const int vop_write_vp_offsets
[] = {
414 VOPARG_OFFSETOF(struct vop_write_args
,a_vp
),
417 const struct vnodeop_desc vop_write_desc
= {
418 VOP_WRITE_DESCOFFSET
,
421 vop_write_vp_offsets
,
423 VOPARG_OFFSETOF(struct vop_write_args
, a_cred
),
428 VOP_WRITE(struct vnode
*vp
,
435 struct vop_write_args a
;
436 a
.a_desc
= VDESC(vop_write
);
441 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
442 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
443 error
= (VCALL(vp
, VOFFSET(vop_write
), &a
));
444 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
448 const int vop_ioctl_vp_offsets
[] = {
449 VOPARG_OFFSETOF(struct vop_ioctl_args
,a_vp
),
452 const struct vnodeop_desc vop_ioctl_desc
= {
453 VOP_IOCTL_DESCOFFSET
,
456 vop_ioctl_vp_offsets
,
458 VOPARG_OFFSETOF(struct vop_ioctl_args
, a_cred
),
463 VOP_IOCTL(struct vnode
*vp
,
471 struct vop_ioctl_args a
;
472 a
.a_desc
= VDESC(vop_ioctl
);
474 a
.a_command
= command
;
478 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
479 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
480 error
= (VCALL(vp
, VOFFSET(vop_ioctl
), &a
));
481 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
485 const int vop_fcntl_vp_offsets
[] = {
486 VOPARG_OFFSETOF(struct vop_fcntl_args
,a_vp
),
489 const struct vnodeop_desc vop_fcntl_desc
= {
490 VOP_FCNTL_DESCOFFSET
,
493 vop_fcntl_vp_offsets
,
495 VOPARG_OFFSETOF(struct vop_fcntl_args
, a_cred
),
500 VOP_FCNTL(struct vnode
*vp
,
508 struct vop_fcntl_args a
;
509 a
.a_desc
= VDESC(vop_fcntl
);
511 a
.a_command
= command
;
515 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
516 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
517 error
= (VCALL(vp
, VOFFSET(vop_fcntl
), &a
));
518 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
522 const int vop_poll_vp_offsets
[] = {
523 VOPARG_OFFSETOF(struct vop_poll_args
,a_vp
),
526 const struct vnodeop_desc vop_poll_desc
= {
537 VOP_POLL(struct vnode
*vp
,
542 struct vop_poll_args a
;
543 a
.a_desc
= VDESC(vop_poll
);
546 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
547 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
548 error
= (VCALL(vp
, VOFFSET(vop_poll
), &a
));
549 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
553 const int vop_kqfilter_vp_offsets
[] = {
554 VOPARG_OFFSETOF(struct vop_kqfilter_args
,a_vp
),
557 const struct vnodeop_desc vop_kqfilter_desc
= {
558 VOP_KQFILTER_DESCOFFSET
,
561 vop_kqfilter_vp_offsets
,
568 VOP_KQFILTER(struct vnode
*vp
,
573 struct vop_kqfilter_args a
;
574 a
.a_desc
= VDESC(vop_kqfilter
);
577 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
578 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
579 error
= (VCALL(vp
, VOFFSET(vop_kqfilter
), &a
));
580 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
584 const int vop_revoke_vp_offsets
[] = {
585 VOPARG_OFFSETOF(struct vop_revoke_args
,a_vp
),
588 const struct vnodeop_desc vop_revoke_desc
= {
589 VOP_REVOKE_DESCOFFSET
,
592 vop_revoke_vp_offsets
,
599 VOP_REVOKE(struct vnode
*vp
,
604 struct vop_revoke_args a
;
605 a
.a_desc
= VDESC(vop_revoke
);
608 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
609 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
610 error
= (VCALL(vp
, VOFFSET(vop_revoke
), &a
));
611 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
615 const int vop_mmap_vp_offsets
[] = {
616 VOPARG_OFFSETOF(struct vop_mmap_args
,a_vp
),
619 const struct vnodeop_desc vop_mmap_desc
= {
625 VOPARG_OFFSETOF(struct vop_mmap_args
, a_cred
),
630 VOP_MMAP(struct vnode
*vp
,
636 struct vop_mmap_args a
;
637 a
.a_desc
= VDESC(vop_mmap
);
641 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
642 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
643 error
= (VCALL(vp
, VOFFSET(vop_mmap
), &a
));
644 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
648 const int vop_fsync_vp_offsets
[] = {
649 VOPARG_OFFSETOF(struct vop_fsync_args
,a_vp
),
652 const struct vnodeop_desc vop_fsync_desc
= {
653 VOP_FSYNC_DESCOFFSET
,
656 vop_fsync_vp_offsets
,
658 VOPARG_OFFSETOF(struct vop_fsync_args
, a_cred
),
663 VOP_FSYNC(struct vnode
*vp
,
671 struct vop_fsync_args a
;
672 a
.a_desc
= VDESC(vop_fsync
);
678 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
679 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
680 error
= (VCALL(vp
, VOFFSET(vop_fsync
), &a
));
681 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
685 const int vop_seek_vp_offsets
[] = {
686 VOPARG_OFFSETOF(struct vop_seek_args
,a_vp
),
689 const struct vnodeop_desc vop_seek_desc
= {
695 VOPARG_OFFSETOF(struct vop_seek_args
, a_cred
),
700 VOP_SEEK(struct vnode
*vp
,
707 struct vop_seek_args a
;
708 a
.a_desc
= VDESC(vop_seek
);
713 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
714 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
715 error
= (VCALL(vp
, VOFFSET(vop_seek
), &a
));
716 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
720 const int vop_remove_vp_offsets
[] = {
721 VOPARG_OFFSETOF(struct vop_remove_args
,a_dvp
),
722 VOPARG_OFFSETOF(struct vop_remove_args
,a_vp
),
725 const struct vnodeop_desc vop_remove_desc
= {
726 VOP_REMOVE_DESCOFFSET
,
728 0 | VDESC_VP0_WILLPUT
| VDESC_VP1_WILLPUT
,
729 vop_remove_vp_offsets
,
732 VOPARG_OFFSETOF(struct vop_remove_args
, a_cnp
),
736 VOP_REMOVE(struct vnode
*dvp
,
738 struct componentname
*cnp
)
742 struct vop_remove_args a
;
743 a
.a_desc
= VDESC(vop_remove
);
747 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
748 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
749 error
= (VCALL(dvp
, VOFFSET(vop_remove
), &a
));
750 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
754 const int vop_link_vp_offsets
[] = {
755 VOPARG_OFFSETOF(struct vop_link_args
,a_dvp
),
756 VOPARG_OFFSETOF(struct vop_link_args
,a_vp
),
759 const struct vnodeop_desc vop_link_desc
= {
762 0 | VDESC_VP0_WILLPUT
,
766 VOPARG_OFFSETOF(struct vop_link_args
, a_cnp
),
770 VOP_LINK(struct vnode
*dvp
,
772 struct componentname
*cnp
)
776 struct vop_link_args a
;
777 a
.a_desc
= VDESC(vop_link
);
781 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
782 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
783 error
= (VCALL(dvp
, VOFFSET(vop_link
), &a
));
784 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
788 const int vop_rename_vp_offsets
[] = {
789 VOPARG_OFFSETOF(struct vop_rename_args
,a_fdvp
),
790 VOPARG_OFFSETOF(struct vop_rename_args
,a_fvp
),
791 VOPARG_OFFSETOF(struct vop_rename_args
,a_tdvp
),
792 VOPARG_OFFSETOF(struct vop_rename_args
,a_tvp
),
795 const struct vnodeop_desc vop_rename_desc
= {
796 VOP_RENAME_DESCOFFSET
,
798 0 | VDESC_VP0_WILLRELE
| VDESC_VP1_WILLRELE
| VDESC_VP2_WILLPUT
| VDESC_VP3_WILLPUT
,
799 vop_rename_vp_offsets
,
802 VOPARG_OFFSETOF(struct vop_rename_args
, a_fcnp
),
806 VOP_RENAME(struct vnode
*fdvp
,
808 struct componentname
*fcnp
,
811 struct componentname
*tcnp
)
815 struct vop_rename_args a
;
816 a
.a_desc
= VDESC(vop_rename
);
823 mpsafe
= (fdvp
->v_vflag
& VV_MPSAFE
);
824 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
825 error
= (VCALL(fdvp
, VOFFSET(vop_rename
), &a
));
826 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
830 const int vop_mkdir_vp_offsets
[] = {
831 VOPARG_OFFSETOF(struct vop_mkdir_args
,a_dvp
),
834 const struct vnodeop_desc vop_mkdir_desc
= {
835 VOP_MKDIR_DESCOFFSET
,
837 0 | VDESC_VP0_WILLPUT
,
838 vop_mkdir_vp_offsets
,
839 VOPARG_OFFSETOF(struct vop_mkdir_args
, a_vpp
),
841 VOPARG_OFFSETOF(struct vop_mkdir_args
, a_cnp
),
845 VOP_MKDIR(struct vnode
*dvp
,
847 struct componentname
*cnp
,
852 struct vop_mkdir_args a
;
853 a
.a_desc
= VDESC(vop_mkdir
);
858 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
859 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
860 error
= (VCALL(dvp
, VOFFSET(vop_mkdir
), &a
));
861 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
864 KASSERT((*vpp
)->v_size
!= VSIZENOTSET
865 && (*vpp
)->v_writesize
!= VSIZENOTSET
);
866 #endif /* DIAGNOSTIC */
870 const int vop_rmdir_vp_offsets
[] = {
871 VOPARG_OFFSETOF(struct vop_rmdir_args
,a_dvp
),
872 VOPARG_OFFSETOF(struct vop_rmdir_args
,a_vp
),
875 const struct vnodeop_desc vop_rmdir_desc
= {
876 VOP_RMDIR_DESCOFFSET
,
878 0 | VDESC_VP0_WILLPUT
| VDESC_VP1_WILLPUT
,
879 vop_rmdir_vp_offsets
,
882 VOPARG_OFFSETOF(struct vop_rmdir_args
, a_cnp
),
886 VOP_RMDIR(struct vnode
*dvp
,
888 struct componentname
*cnp
)
892 struct vop_rmdir_args a
;
893 a
.a_desc
= VDESC(vop_rmdir
);
897 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
898 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
899 error
= (VCALL(dvp
, VOFFSET(vop_rmdir
), &a
));
900 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
904 const int vop_symlink_vp_offsets
[] = {
905 VOPARG_OFFSETOF(struct vop_symlink_args
,a_dvp
),
908 const struct vnodeop_desc vop_symlink_desc
= {
909 VOP_SYMLINK_DESCOFFSET
,
911 0 | VDESC_VP0_WILLPUT
,
912 vop_symlink_vp_offsets
,
913 VOPARG_OFFSETOF(struct vop_symlink_args
, a_vpp
),
915 VOPARG_OFFSETOF(struct vop_symlink_args
, a_cnp
),
919 VOP_SYMLINK(struct vnode
*dvp
,
921 struct componentname
*cnp
,
927 struct vop_symlink_args a
;
928 a
.a_desc
= VDESC(vop_symlink
);
934 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
935 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
936 error
= (VCALL(dvp
, VOFFSET(vop_symlink
), &a
));
937 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
940 KASSERT((*vpp
)->v_size
!= VSIZENOTSET
941 && (*vpp
)->v_writesize
!= VSIZENOTSET
);
942 #endif /* DIAGNOSTIC */
946 const int vop_readdir_vp_offsets
[] = {
947 VOPARG_OFFSETOF(struct vop_readdir_args
,a_vp
),
950 const struct vnodeop_desc vop_readdir_desc
= {
951 VOP_READDIR_DESCOFFSET
,
954 vop_readdir_vp_offsets
,
956 VOPARG_OFFSETOF(struct vop_readdir_args
, a_cred
),
961 VOP_READDIR(struct vnode
*vp
,
970 struct vop_readdir_args a
;
971 a
.a_desc
= VDESC(vop_readdir
);
975 a
.a_eofflag
= eofflag
;
976 a
.a_cookies
= cookies
;
977 a
.a_ncookies
= ncookies
;
978 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
979 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
980 error
= (VCALL(vp
, VOFFSET(vop_readdir
), &a
));
981 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
985 const int vop_readlink_vp_offsets
[] = {
986 VOPARG_OFFSETOF(struct vop_readlink_args
,a_vp
),
989 const struct vnodeop_desc vop_readlink_desc
= {
990 VOP_READLINK_DESCOFFSET
,
993 vop_readlink_vp_offsets
,
995 VOPARG_OFFSETOF(struct vop_readlink_args
, a_cred
),
1000 VOP_READLINK(struct vnode
*vp
,
1006 struct vop_readlink_args a
;
1007 a
.a_desc
= VDESC(vop_readlink
);
1011 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1012 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1013 error
= (VCALL(vp
, VOFFSET(vop_readlink
), &a
));
1014 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1018 const int vop_abortop_vp_offsets
[] = {
1019 VOPARG_OFFSETOF(struct vop_abortop_args
,a_dvp
),
1022 const struct vnodeop_desc vop_abortop_desc
= {
1023 VOP_ABORTOP_DESCOFFSET
,
1026 vop_abortop_vp_offsets
,
1029 VOPARG_OFFSETOF(struct vop_abortop_args
, a_cnp
),
1033 VOP_ABORTOP(struct vnode
*dvp
,
1034 struct componentname
*cnp
)
1038 struct vop_abortop_args a
;
1039 a
.a_desc
= VDESC(vop_abortop
);
1042 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
1043 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1044 error
= (VCALL(dvp
, VOFFSET(vop_abortop
), &a
));
1045 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1049 const int vop_inactive_vp_offsets
[] = {
1050 VOPARG_OFFSETOF(struct vop_inactive_args
,a_vp
),
1053 const struct vnodeop_desc vop_inactive_desc
= {
1054 VOP_INACTIVE_DESCOFFSET
,
1056 0 | VDESC_VP0_WILLUNLOCK
,
1057 vop_inactive_vp_offsets
,
1064 VOP_INACTIVE(struct vnode
*vp
,
1069 struct vop_inactive_args a
;
1070 a
.a_desc
= VDESC(vop_inactive
);
1072 a
.a_recycle
= recycle
;
1073 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1074 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1075 error
= (VCALL(vp
, VOFFSET(vop_inactive
), &a
));
1076 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1080 const int vop_reclaim_vp_offsets
[] = {
1081 VOPARG_OFFSETOF(struct vop_reclaim_args
,a_vp
),
1084 const struct vnodeop_desc vop_reclaim_desc
= {
1085 VOP_RECLAIM_DESCOFFSET
,
1088 vop_reclaim_vp_offsets
,
1095 VOP_RECLAIM(struct vnode
*vp
)
1099 struct vop_reclaim_args a
;
1100 a
.a_desc
= VDESC(vop_reclaim
);
1102 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1103 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1104 error
= (VCALL(vp
, VOFFSET(vop_reclaim
), &a
));
1105 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1109 const int vop_lock_vp_offsets
[] = {
1110 VOPARG_OFFSETOF(struct vop_lock_args
,a_vp
),
1113 const struct vnodeop_desc vop_lock_desc
= {
1114 VOP_LOCK_DESCOFFSET
,
1117 vop_lock_vp_offsets
,
1124 VOP_LOCK(struct vnode
*vp
,
1129 struct vop_lock_args a
;
1130 a
.a_desc
= VDESC(vop_lock
);
1133 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1134 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1135 error
= (VCALL(vp
, VOFFSET(vop_lock
), &a
));
1136 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1140 const int vop_unlock_vp_offsets
[] = {
1141 VOPARG_OFFSETOF(struct vop_unlock_args
,a_vp
),
1144 const struct vnodeop_desc vop_unlock_desc
= {
1145 VOP_UNLOCK_DESCOFFSET
,
1148 vop_unlock_vp_offsets
,
1155 VOP_UNLOCK(struct vnode
*vp
,
1160 struct vop_unlock_args a
;
1161 a
.a_desc
= VDESC(vop_unlock
);
1164 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1165 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1166 error
= (VCALL(vp
, VOFFSET(vop_unlock
), &a
));
1167 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1171 const int vop_bmap_vp_offsets
[] = {
1172 VOPARG_OFFSETOF(struct vop_bmap_args
,a_vp
),
1175 const struct vnodeop_desc vop_bmap_desc
= {
1176 VOP_BMAP_DESCOFFSET
,
1179 vop_bmap_vp_offsets
,
1180 VOPARG_OFFSETOF(struct vop_bmap_args
, a_vpp
),
1186 VOP_BMAP(struct vnode
*vp
,
1194 struct vop_bmap_args a
;
1195 a
.a_desc
= VDESC(vop_bmap
);
1201 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1202 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1203 error
= (VCALL(vp
, VOFFSET(vop_bmap
), &a
));
1204 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1208 const int vop_strategy_vp_offsets
[] = {
1209 VOPARG_OFFSETOF(struct vop_strategy_args
,a_vp
),
1212 const struct vnodeop_desc vop_strategy_desc
= {
1213 VOP_STRATEGY_DESCOFFSET
,
1216 vop_strategy_vp_offsets
,
1223 VOP_STRATEGY(struct vnode
*vp
,
1228 struct vop_strategy_args a
;
1229 a
.a_desc
= VDESC(vop_strategy
);
1232 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1233 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1234 error
= (VCALL(vp
, VOFFSET(vop_strategy
), &a
));
1235 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1239 const int vop_print_vp_offsets
[] = {
1240 VOPARG_OFFSETOF(struct vop_print_args
,a_vp
),
1243 const struct vnodeop_desc vop_print_desc
= {
1244 VOP_PRINT_DESCOFFSET
,
1247 vop_print_vp_offsets
,
1254 VOP_PRINT(struct vnode
*vp
)
1258 struct vop_print_args a
;
1259 a
.a_desc
= VDESC(vop_print
);
1261 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1262 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1263 error
= (VCALL(vp
, VOFFSET(vop_print
), &a
));
1264 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1268 const int vop_islocked_vp_offsets
[] = {
1269 VOPARG_OFFSETOF(struct vop_islocked_args
,a_vp
),
1272 const struct vnodeop_desc vop_islocked_desc
= {
1273 VOP_ISLOCKED_DESCOFFSET
,
1276 vop_islocked_vp_offsets
,
1283 VOP_ISLOCKED(struct vnode
*vp
)
1287 struct vop_islocked_args a
;
1288 a
.a_desc
= VDESC(vop_islocked
);
1290 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1291 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1292 error
= (VCALL(vp
, VOFFSET(vop_islocked
), &a
));
1293 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1297 const int vop_pathconf_vp_offsets
[] = {
1298 VOPARG_OFFSETOF(struct vop_pathconf_args
,a_vp
),
1301 const struct vnodeop_desc vop_pathconf_desc
= {
1302 VOP_PATHCONF_DESCOFFSET
,
1305 vop_pathconf_vp_offsets
,
1312 VOP_PATHCONF(struct vnode
*vp
,
1318 struct vop_pathconf_args a
;
1319 a
.a_desc
= VDESC(vop_pathconf
);
1322 a
.a_retval
= retval
;
1323 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1324 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1325 error
= (VCALL(vp
, VOFFSET(vop_pathconf
), &a
));
1326 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1330 const int vop_advlock_vp_offsets
[] = {
1331 VOPARG_OFFSETOF(struct vop_advlock_args
,a_vp
),
1334 const struct vnodeop_desc vop_advlock_desc
= {
1335 VOP_ADVLOCK_DESCOFFSET
,
1338 vop_advlock_vp_offsets
,
1345 VOP_ADVLOCK(struct vnode
*vp
,
1353 struct vop_advlock_args a
;
1354 a
.a_desc
= VDESC(vop_advlock
);
1360 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1361 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1362 error
= (VCALL(vp
, VOFFSET(vop_advlock
), &a
));
1363 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1367 const int vop_whiteout_vp_offsets
[] = {
1368 VOPARG_OFFSETOF(struct vop_whiteout_args
,a_dvp
),
1371 const struct vnodeop_desc vop_whiteout_desc
= {
1372 VOP_WHITEOUT_DESCOFFSET
,
1375 vop_whiteout_vp_offsets
,
1378 VOPARG_OFFSETOF(struct vop_whiteout_args
, a_cnp
),
1382 VOP_WHITEOUT(struct vnode
*dvp
,
1383 struct componentname
*cnp
,
1388 struct vop_whiteout_args a
;
1389 a
.a_desc
= VDESC(vop_whiteout
);
1393 mpsafe
= (dvp
->v_vflag
& VV_MPSAFE
);
1394 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1395 error
= (VCALL(dvp
, VOFFSET(vop_whiteout
), &a
));
1396 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1400 const int vop_getpages_vp_offsets
[] = {
1401 VOPARG_OFFSETOF(struct vop_getpages_args
,a_vp
),
1404 const struct vnodeop_desc vop_getpages_desc
= {
1405 VOP_GETPAGES_DESCOFFSET
,
1408 vop_getpages_vp_offsets
,
1415 VOP_GETPAGES(struct vnode
*vp
,
1420 vm_prot_t access_type
,
1426 struct vop_getpages_args a
;
1427 a
.a_desc
= VDESC(vop_getpages
);
1429 a
.a_offset
= offset
;
1432 a
.a_centeridx
= centeridx
;
1433 a
.a_access_type
= access_type
;
1434 a
.a_advice
= advice
;
1436 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1437 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1438 error
= (VCALL(vp
, VOFFSET(vop_getpages
), &a
));
1439 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1443 const int vop_putpages_vp_offsets
[] = {
1444 VOPARG_OFFSETOF(struct vop_putpages_args
,a_vp
),
1447 const struct vnodeop_desc vop_putpages_desc
= {
1448 VOP_PUTPAGES_DESCOFFSET
,
1451 vop_putpages_vp_offsets
,
1458 VOP_PUTPAGES(struct vnode
*vp
,
1465 struct vop_putpages_args a
;
1466 a
.a_desc
= VDESC(vop_putpages
);
1471 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1472 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1473 error
= (VCALL(vp
, VOFFSET(vop_putpages
), &a
));
1474 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1478 const int vop_closeextattr_vp_offsets
[] = {
1479 VOPARG_OFFSETOF(struct vop_closeextattr_args
,a_vp
),
1482 const struct vnodeop_desc vop_closeextattr_desc
= {
1483 VOP_CLOSEEXTATTR_DESCOFFSET
,
1486 vop_closeextattr_vp_offsets
,
1488 VOPARG_OFFSETOF(struct vop_closeextattr_args
, a_cred
),
1493 VOP_CLOSEEXTATTR(struct vnode
*vp
,
1499 struct vop_closeextattr_args a
;
1500 a
.a_desc
= VDESC(vop_closeextattr
);
1502 a
.a_commit
= commit
;
1504 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1505 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1506 error
= (VCALL(vp
, VOFFSET(vop_closeextattr
), &a
));
1507 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1511 const int vop_getextattr_vp_offsets
[] = {
1512 VOPARG_OFFSETOF(struct vop_getextattr_args
,a_vp
),
1515 const struct vnodeop_desc vop_getextattr_desc
= {
1516 VOP_GETEXTATTR_DESCOFFSET
,
1519 vop_getextattr_vp_offsets
,
1521 VOPARG_OFFSETOF(struct vop_getextattr_args
, a_cred
),
1526 VOP_GETEXTATTR(struct vnode
*vp
,
1535 struct vop_getextattr_args a
;
1536 a
.a_desc
= VDESC(vop_getextattr
);
1538 a
.a_attrnamespace
= attrnamespace
;
1543 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1544 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1545 error
= (VCALL(vp
, VOFFSET(vop_getextattr
), &a
));
1546 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1550 const int vop_listextattr_vp_offsets
[] = {
1551 VOPARG_OFFSETOF(struct vop_listextattr_args
,a_vp
),
1554 const struct vnodeop_desc vop_listextattr_desc
= {
1555 VOP_LISTEXTATTR_DESCOFFSET
,
1558 vop_listextattr_vp_offsets
,
1560 VOPARG_OFFSETOF(struct vop_listextattr_args
, a_cred
),
1565 VOP_LISTEXTATTR(struct vnode
*vp
,
1573 struct vop_listextattr_args a
;
1574 a
.a_desc
= VDESC(vop_listextattr
);
1576 a
.a_attrnamespace
= attrnamespace
;
1580 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1581 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1582 error
= (VCALL(vp
, VOFFSET(vop_listextattr
), &a
));
1583 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1587 const int vop_openextattr_vp_offsets
[] = {
1588 VOPARG_OFFSETOF(struct vop_openextattr_args
,a_vp
),
1591 const struct vnodeop_desc vop_openextattr_desc
= {
1592 VOP_OPENEXTATTR_DESCOFFSET
,
1595 vop_openextattr_vp_offsets
,
1597 VOPARG_OFFSETOF(struct vop_openextattr_args
, a_cred
),
1602 VOP_OPENEXTATTR(struct vnode
*vp
,
1607 struct vop_openextattr_args a
;
1608 a
.a_desc
= VDESC(vop_openextattr
);
1611 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1612 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1613 error
= (VCALL(vp
, VOFFSET(vop_openextattr
), &a
));
1614 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1618 const int vop_deleteextattr_vp_offsets
[] = {
1619 VOPARG_OFFSETOF(struct vop_deleteextattr_args
,a_vp
),
1622 const struct vnodeop_desc vop_deleteextattr_desc
= {
1623 VOP_DELETEEXTATTR_DESCOFFSET
,
1624 "vop_deleteextattr",
1626 vop_deleteextattr_vp_offsets
,
1628 VOPARG_OFFSETOF(struct vop_deleteextattr_args
, a_cred
),
1633 VOP_DELETEEXTATTR(struct vnode
*vp
,
1640 struct vop_deleteextattr_args a
;
1641 a
.a_desc
= VDESC(vop_deleteextattr
);
1643 a
.a_attrnamespace
= attrnamespace
;
1646 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1647 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1648 error
= (VCALL(vp
, VOFFSET(vop_deleteextattr
), &a
));
1649 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1653 const int vop_setextattr_vp_offsets
[] = {
1654 VOPARG_OFFSETOF(struct vop_setextattr_args
,a_vp
),
1657 const struct vnodeop_desc vop_setextattr_desc
= {
1658 VOP_SETEXTATTR_DESCOFFSET
,
1661 vop_setextattr_vp_offsets
,
1663 VOPARG_OFFSETOF(struct vop_setextattr_args
, a_cred
),
1668 VOP_SETEXTATTR(struct vnode
*vp
,
1676 struct vop_setextattr_args a
;
1677 a
.a_desc
= VDESC(vop_setextattr
);
1679 a
.a_attrnamespace
= attrnamespace
;
1683 mpsafe
= (vp
->v_vflag
& VV_MPSAFE
);
1684 if (!mpsafe
) { KERNEL_LOCK(1, curlwp
); }
1685 error
= (VCALL(vp
, VOFFSET(vop_setextattr
), &a
));
1686 if (!mpsafe
) { KERNEL_UNLOCK_ONE(curlwp
); }
1690 /* End of special cases. */
1692 const struct vnodeop_desc
* const vfs_op_descs
[] = {
1693 &vop_default_desc
, /* MUST BE FIRST */
1694 &vop_bwrite_desc
, /* XXX: SPECIAL CASE */
1736 &vop_closeextattr_desc
,
1737 &vop_getextattr_desc
,
1738 &vop_listextattr_desc
,
1739 &vop_openextattr_desc
,
1740 &vop_deleteextattr_desc
,
1741 &vop_setextattr_desc
,