xref: /dragonfly/sys/kern/vfs_vopops.c (revision 63ab6604)
1 /*
2  *
3  * Copyright (c) 2004 The DragonFly Project.  All rights reserved.
4  *
5  * This code is derived from software contributed to The DragonFly Project
6  * by Matthew Dillon <dillon@backplane.com>
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in
16  *    the documentation and/or other materials provided with the
17  *    distribution.
18  * 3. Neither the name of The DragonFly Project nor the names of its
19  *    contributors may be used to endorse or promote products derived
20  *    from this software without specific, prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
26  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.39 2008/06/19 23:27:35 dillon Exp $
36  */
37 
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/buf.h>
41 #include <sys/conf.h>
42 #include <sys/dirent.h>
43 #include <sys/domain.h>
44 #include <sys/eventhandler.h>
45 #include <sys/fcntl.h>
46 #include <sys/kernel.h>
47 #include <sys/kthread.h>
48 #include <sys/malloc.h>
49 #include <sys/mbuf.h>
50 #include <sys/mount.h>
51 #include <sys/proc.h>
52 #include <sys/namei.h>
53 #include <sys/reboot.h>
54 #include <sys/socket.h>
55 #include <sys/stat.h>
56 #include <sys/sysctl.h>
57 #include <sys/syslog.h>
58 #include <sys/vmmeter.h>
59 #include <sys/vnode.h>
60 #include <sys/vfsops.h>
61 
62 #include <machine/limits.h>
63 
64 #include <vm/vm.h>
65 #include <vm/vm_object.h>
66 #include <vm/vm_extern.h>
67 #include <vm/vm_kern.h>
68 #include <vm/pmap.h>
69 #include <vm/vm_map.h>
70 #include <vm/vm_page.h>
71 #include <vm/vm_pager.h>
72 #include <vm/vnode_pager.h>
73 #include <vm/vm_zone.h>
74 
75 #include <sys/buf2.h>
76 #include <sys/thread2.h>
77 
78 #define VDESCNAME(name)	__CONCAT(__CONCAT(vop_,name),_desc)
79 
80 #define VNODEOP_DESC_INIT(name)						\
81 	struct syslink_desc VDESCNAME(name) = {				\
82 		__offsetof(struct vop_ops, __CONCAT(vop_, name)),	\
83 		#name }
84 
85 VNODEOP_DESC_INIT(default);
86 VNODEOP_DESC_INIT(old_lookup);
87 VNODEOP_DESC_INIT(old_create);
88 VNODEOP_DESC_INIT(old_whiteout);
89 VNODEOP_DESC_INIT(old_mknod);
90 VNODEOP_DESC_INIT(open);
91 VNODEOP_DESC_INIT(close);
92 VNODEOP_DESC_INIT(access);
93 VNODEOP_DESC_INIT(getattr);
94 VNODEOP_DESC_INIT(setattr);
95 VNODEOP_DESC_INIT(read);
96 VNODEOP_DESC_INIT(write);
97 VNODEOP_DESC_INIT(ioctl);
98 VNODEOP_DESC_INIT(poll);
99 VNODEOP_DESC_INIT(kqfilter);
100 VNODEOP_DESC_INIT(revoke);
101 VNODEOP_DESC_INIT(mmap);
102 VNODEOP_DESC_INIT(fsync);
103 VNODEOP_DESC_INIT(old_remove);
104 VNODEOP_DESC_INIT(old_link);
105 VNODEOP_DESC_INIT(old_rename);
106 
107 VNODEOP_DESC_INIT(old_mkdir);
108 VNODEOP_DESC_INIT(old_rmdir);
109 VNODEOP_DESC_INIT(old_symlink);
110 VNODEOP_DESC_INIT(readdir);
111 VNODEOP_DESC_INIT(readlink);
112 VNODEOP_DESC_INIT(inactive);
113 VNODEOP_DESC_INIT(reclaim);
114 VNODEOP_DESC_INIT(bmap);
115 VNODEOP_DESC_INIT(strategy);
116 VNODEOP_DESC_INIT(print);
117 VNODEOP_DESC_INIT(pathconf);
118 VNODEOP_DESC_INIT(advlock);
119 VNODEOP_DESC_INIT(balloc);
120 VNODEOP_DESC_INIT(reallocblks);
121 VNODEOP_DESC_INIT(getpages);
122 VNODEOP_DESC_INIT(putpages);
123 VNODEOP_DESC_INIT(freeblks);
124 VNODEOP_DESC_INIT(getacl);
125 VNODEOP_DESC_INIT(setacl);
126 VNODEOP_DESC_INIT(aclcheck);
127 VNODEOP_DESC_INIT(getextattr);
128 VNODEOP_DESC_INIT(setextattr);
129 VNODEOP_DESC_INIT(mountctl);
130 VNODEOP_DESC_INIT(markatime);
131 
132 VNODEOP_DESC_INIT(nresolve);
133 VNODEOP_DESC_INIT(nlookupdotdot);
134 VNODEOP_DESC_INIT(ncreate);
135 VNODEOP_DESC_INIT(nmkdir);
136 VNODEOP_DESC_INIT(nmknod);
137 VNODEOP_DESC_INIT(nlink);
138 VNODEOP_DESC_INIT(nsymlink);
139 VNODEOP_DESC_INIT(nwhiteout);
140 VNODEOP_DESC_INIT(nremove);
141 VNODEOP_DESC_INIT(nrmdir);
142 VNODEOP_DESC_INIT(nrename);
143 
144 #define DO_OPS(ops, error, ap, vop_field)	\
145 	error = ops->vop_field(ap);
146 
147 /************************************************************************
148  *		PRIMARY HIGH LEVEL VNODE OPERATIONS CALLS		*
149  ************************************************************************
150  *
151  * These procedures are called directly from the kernel and/or fileops
152  * code to perform file/device operations on the system.
153  *
154  * NOTE: The old namespace api functions such as vop_rename() are no longer
155  * available for general use and have been renamed to vop_old_*().  Only
156  * the code in vfs_default.c is allowed to call those ops.
157  */
158 
159 int
160 vop_old_lookup(struct vop_ops *ops, struct vnode *dvp,
161 	struct vnode **vpp, struct componentname *cnp)
162 {
163 	struct vop_old_lookup_args ap;
164 	int error;
165 
166 	ap.a_head.a_desc = &vop_old_lookup_desc;
167 	ap.a_head.a_ops = ops;
168 	ap.a_dvp = dvp;
169 	ap.a_vpp = vpp;
170 	ap.a_cnp = cnp;
171 
172 	DO_OPS(ops, error, &ap, vop_old_lookup);
173 	return(error);
174 }
175 
176 int
177 vop_old_create(struct vop_ops *ops, struct vnode *dvp,
178 	struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
179 {
180 	struct vop_old_create_args ap;
181 	int error;
182 
183 	ap.a_head.a_desc = &vop_old_create_desc;
184 	ap.a_head.a_ops = ops;
185 	ap.a_dvp = dvp;
186 	ap.a_vpp = vpp;
187 	ap.a_cnp = cnp;
188 	ap.a_vap = vap;
189 
190 	DO_OPS(ops, error, &ap, vop_old_create);
191 	return(error);
192 }
193 
194 int
195 vop_old_whiteout(struct vop_ops *ops, struct vnode *dvp,
196 	struct componentname *cnp, int flags)
197 {
198 	struct vop_old_whiteout_args ap;
199 	int error;
200 
201 	ap.a_head.a_desc = &vop_old_whiteout_desc;
202 	ap.a_head.a_ops = ops;
203 	ap.a_dvp = dvp;
204 	ap.a_cnp = cnp;
205 	ap.a_flags = flags;
206 
207 	DO_OPS(ops, error, &ap, vop_old_whiteout);
208 	return(error);
209 }
210 
211 int
212 vop_old_mknod(struct vop_ops *ops, struct vnode *dvp,
213 	struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
214 {
215 	struct vop_old_mknod_args ap;
216 	int error;
217 
218 	ap.a_head.a_desc = &vop_old_mknod_desc;
219 	ap.a_head.a_ops = ops;
220 	ap.a_dvp = dvp;
221 	ap.a_vpp = vpp;
222 	ap.a_cnp = cnp;
223 	ap.a_vap = vap;
224 
225 	DO_OPS(ops, error, &ap, vop_old_mknod);
226 	return(error);
227 }
228 
229 int
230 vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred,
231 	struct file *fp)
232 {
233 	struct vop_open_args ap;
234 	int error;
235 
236 	ap.a_head.a_desc = &vop_open_desc;
237 	ap.a_head.a_ops = ops;
238 	ap.a_vp = vp;
239 	ap.a_fp = fp;
240 	ap.a_mode = mode;
241 	ap.a_cred = cred;
242 
243 	DO_OPS(ops, error, &ap, vop_open);
244 	return(error);
245 }
246 
247 int
248 vop_close(struct vop_ops *ops, struct vnode *vp, int fflag)
249 {
250 	struct vop_close_args ap;
251 	int error;
252 
253 	ap.a_head.a_desc = &vop_close_desc;
254 	ap.a_head.a_ops = ops;
255 	ap.a_vp = vp;
256 	ap.a_fflag = fflag;
257 
258 	DO_OPS(ops, error, &ap, vop_close);
259 	return(error);
260 }
261 
262 int
263 vop_access(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred)
264 {
265 	struct vop_access_args ap;
266 	int error;
267 
268 	ap.a_head.a_desc = &vop_access_desc;
269 	ap.a_head.a_ops = ops;
270 	ap.a_vp = vp;
271 	ap.a_mode = mode;
272 	ap.a_cred = cred;
273 
274 	DO_OPS(ops, error, &ap, vop_access);
275 	return(error);
276 }
277 
278 int
279 vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap)
280 {
281 	struct vop_getattr_args ap;
282 	int error;
283 
284 	ap.a_head.a_desc = &vop_getattr_desc;
285 	ap.a_head.a_ops = ops;
286 	ap.a_vp = vp;
287 	ap.a_vap = vap;
288 
289 	DO_OPS(ops, error, &ap, vop_getattr);
290 
291 	/*
292 	 * mount pointer may be NULL if vnode is dead.
293 	 */
294 	if (ops->head.vv_mount &&
295 	    (ops->head.vv_mount->mnt_kern_flag & MNTK_FSMID) == 0) {
296 		vap->va_fsmid = cache_sync_fsmid_vp(vp);
297 	}
298 	return(error);
299 }
300 
301 int
302 vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
303 	struct ucred *cred)
304 {
305 	struct vop_setattr_args ap;
306 	int error;
307 
308 	ap.a_head.a_desc = &vop_setattr_desc;
309 	ap.a_head.a_ops = ops;
310 	ap.a_vp = vp;
311 	ap.a_vap = vap;
312 	ap.a_cred = cred;
313 
314 	DO_OPS(ops, error, &ap, vop_setattr);
315 	if (error == 0)
316 		cache_update_fsmid_vp(vp);
317 	return(error);
318 }
319 
320 int
321 vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
322 	struct ucred *cred)
323 {
324 	struct vop_read_args ap;
325 	int error;
326 
327 	ap.a_head.a_desc = &vop_read_desc;
328 	ap.a_head.a_ops = ops;
329 	ap.a_vp = vp;
330 	ap.a_uio = uio;
331 	ap.a_ioflag = ioflag;
332 	ap.a_cred = cred;
333 
334 	DO_OPS(ops, error, &ap, vop_read);
335 	return(error);
336 }
337 
338 int
339 vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
340 	struct ucred *cred)
341 {
342 	struct vop_write_args ap;
343 	int error;
344 
345 	ap.a_head.a_desc = &vop_write_desc;
346 	ap.a_head.a_ops = ops;
347 	ap.a_vp = vp;
348 	ap.a_uio = uio;
349 	ap.a_ioflag = ioflag;
350 	ap.a_cred = cred;
351 
352 	DO_OPS(ops, error, &ap, vop_write);
353 	if (error == 0)
354 		cache_update_fsmid_vp(vp);
355 	return(error);
356 }
357 
358 int
359 vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command, caddr_t data,
360 	int fflag, struct ucred *cred)
361 {
362 	struct vop_ioctl_args ap;
363 	int error;
364 
365 	ap.a_head.a_desc = &vop_ioctl_desc;
366 	ap.a_head.a_ops = ops;
367 	ap.a_vp = vp;
368 	ap.a_command = command;
369 	ap.a_data = data;
370 	ap.a_fflag = fflag;
371 	ap.a_cred = cred;
372 
373 	DO_OPS(ops, error, &ap, vop_ioctl);
374 	return(error);
375 }
376 
377 int
378 vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred)
379 {
380 	struct vop_poll_args ap;
381 	int error;
382 
383 	ap.a_head.a_desc = &vop_poll_desc;
384 	ap.a_head.a_ops = ops;
385 	ap.a_vp = vp;
386 	ap.a_events = events;
387 	ap.a_cred = cred;
388 
389 	DO_OPS(ops, error, &ap, vop_poll);
390 	return(error);
391 }
392 
393 int
394 vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn)
395 {
396 	struct vop_kqfilter_args ap;
397 	int error;
398 
399 	ap.a_head.a_desc = &vop_kqfilter_desc;
400 	ap.a_head.a_ops = ops;
401 	ap.a_vp = vp;
402 	ap.a_kn = kn;
403 
404 	DO_OPS(ops, error, &ap, vop_kqfilter);
405 	return(error);
406 }
407 
408 int
409 vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags)
410 {
411 	struct vop_revoke_args ap;
412 	int error;
413 
414 	ap.a_head.a_desc = &vop_revoke_desc;
415 	ap.a_head.a_ops = ops;
416 	ap.a_vp = vp;
417 	ap.a_flags = flags;
418 
419 	DO_OPS(ops, error, &ap, vop_revoke);
420 	return(error);
421 }
422 
423 int
424 vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred)
425 {
426 	struct vop_mmap_args ap;
427 	int error;
428 
429 	ap.a_head.a_desc = &vop_mmap_desc;
430 	ap.a_head.a_ops = ops;
431 	ap.a_vp = vp;
432 	ap.a_fflags = fflags;
433 	ap.a_cred = cred;
434 
435 	DO_OPS(ops, error, &ap, vop_mmap);
436 	return(error);
437 }
438 
439 int
440 vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor)
441 {
442 	struct vop_fsync_args ap;
443 	int error;
444 
445 	ap.a_head.a_desc = &vop_fsync_desc;
446 	ap.a_head.a_ops = ops;
447 	ap.a_vp = vp;
448 	ap.a_waitfor = waitfor;
449 
450 	DO_OPS(ops, error, &ap, vop_fsync);
451 	return(error);
452 }
453 
454 int
455 vop_old_remove(struct vop_ops *ops, struct vnode *dvp,
456 	struct vnode *vp, struct componentname *cnp)
457 {
458 	struct vop_old_remove_args ap;
459 	int error;
460 
461 	ap.a_head.a_desc = &vop_old_remove_desc;
462 	ap.a_head.a_ops = ops;
463 	ap.a_dvp = dvp;
464 	ap.a_vp = vp;
465 	ap.a_cnp = cnp;
466 
467 	DO_OPS(ops, error, &ap, vop_old_remove);
468 	return(error);
469 }
470 
471 int
472 vop_old_link(struct vop_ops *ops, struct vnode *tdvp,
473 	struct vnode *vp, struct componentname *cnp)
474 {
475 	struct vop_old_link_args ap;
476 	int error;
477 
478 	ap.a_head.a_desc = &vop_old_link_desc;
479 	ap.a_head.a_ops = ops;
480 	ap.a_tdvp = tdvp;
481 	ap.a_vp = vp;
482 	ap.a_cnp = cnp;
483 
484 	DO_OPS(ops, error, &ap, vop_old_link);
485 	return(error);
486 }
487 
488 int
489 vop_old_rename(struct vop_ops *ops,
490 	   struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp,
491 	   struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp)
492 {
493 	struct vop_old_rename_args ap;
494 	int error;
495 
496 	ap.a_head.a_desc = &vop_old_rename_desc;
497 	ap.a_head.a_ops = ops;
498 	ap.a_fdvp = fdvp;
499 	ap.a_fvp = fvp;
500 	ap.a_fcnp = fcnp;
501 	ap.a_tdvp = tdvp;
502 	ap.a_tvp = tvp;
503 	ap.a_tcnp = tcnp;
504 
505 	DO_OPS(ops, error, &ap, vop_old_rename);
506 	return(error);
507 }
508 
509 int
510 vop_old_mkdir(struct vop_ops *ops, struct vnode *dvp,
511 	struct vnode **vpp, struct componentname *cnp, struct vattr *vap)
512 {
513 	struct vop_old_mkdir_args ap;
514 	int error;
515 
516 	ap.a_head.a_desc = &vop_old_mkdir_desc;
517 	ap.a_head.a_ops = ops;
518 	ap.a_dvp = dvp;
519 	ap.a_vpp = vpp;
520 	ap.a_cnp = cnp;
521 	ap.a_vap = vap;
522 
523 	DO_OPS(ops, error, &ap, vop_old_mkdir);
524 	return(error);
525 }
526 
527 int
528 vop_old_rmdir(struct vop_ops *ops, struct vnode *dvp,
529 	struct vnode *vp, struct componentname *cnp)
530 {
531 	struct vop_old_rmdir_args ap;
532 	int error;
533 
534 	ap.a_head.a_desc = &vop_old_rmdir_desc;
535 	ap.a_head.a_ops = ops;
536 	ap.a_dvp = dvp;
537 	ap.a_vp = vp;
538 	ap.a_cnp = cnp;
539 
540 	DO_OPS(ops, error, &ap, vop_old_rmdir);
541 	return(error);
542 }
543 
544 int
545 vop_old_symlink(struct vop_ops *ops, struct vnode *dvp,
546 	struct vnode **vpp, struct componentname *cnp,
547 	struct vattr *vap, char *target)
548 {
549 	struct vop_old_symlink_args ap;
550 	int error;
551 
552 	ap.a_head.a_desc = &vop_old_symlink_desc;
553 	ap.a_head.a_ops = ops;
554 	ap.a_dvp = dvp;
555 	ap.a_vpp = vpp;
556 	ap.a_cnp = cnp;
557 	ap.a_vap = vap;
558 	ap.a_target = target;
559 
560 	DO_OPS(ops, error, &ap, vop_old_symlink);
561 	return(error);
562 }
563 
564 int
565 vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
566 	struct ucred *cred, int *eofflag, int *ncookies, off_t **cookies)
567 {
568 	struct vop_readdir_args ap;
569 	int error;
570 
571 	ap.a_head.a_desc = &vop_readdir_desc;
572 	ap.a_head.a_ops = ops;
573 	ap.a_vp = vp;
574 	ap.a_uio = uio;
575 	ap.a_cred = cred;
576 	ap.a_eofflag = eofflag;
577 	ap.a_ncookies = ncookies;
578 	ap.a_cookies = cookies;
579 
580 	DO_OPS(ops, error, &ap, vop_readdir);
581 	return(error);
582 }
583 
584 int
585 vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
586 	struct ucred *cred)
587 {
588 	struct vop_readlink_args ap;
589 	int error;
590 
591 	ap.a_head.a_desc = &vop_readlink_desc;
592 	ap.a_head.a_ops = ops;
593 	ap.a_vp = vp;
594 	ap.a_uio = uio;
595 	ap.a_cred = cred;
596 
597 	DO_OPS(ops, error, &ap, vop_readlink);
598 	return(error);
599 }
600 
601 int
602 vop_inactive(struct vop_ops *ops, struct vnode *vp)
603 {
604 	struct vop_inactive_args ap;
605 	int error;
606 
607 	ap.a_head.a_desc = &vop_inactive_desc;
608 	ap.a_head.a_ops = ops;
609 	ap.a_vp = vp;
610 
611 	DO_OPS(ops, error, &ap, vop_inactive);
612 	return(error);
613 }
614 
615 int
616 vop_reclaim(struct vop_ops *ops, struct vnode *vp)
617 {
618 	struct vop_reclaim_args ap;
619 	int error;
620 
621 	ap.a_head.a_desc = &vop_reclaim_desc;
622 	ap.a_head.a_ops = ops;
623 	ap.a_vp = vp;
624 
625 	DO_OPS(ops, error, &ap, vop_reclaim);
626 	return(error);
627 }
628 
629 int
630 vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset,
631 	off_t *doffsetp, int *runp, int *runb, buf_cmd_t cmd)
632 {
633 	struct vop_bmap_args ap;
634 	int error;
635 
636 	ap.a_head.a_desc = &vop_bmap_desc;
637 	ap.a_head.a_ops = ops;
638 	ap.a_vp = vp;
639 	ap.a_loffset = loffset;
640 	ap.a_doffsetp = doffsetp;
641 	ap.a_runp = runp;
642 	ap.a_runb = runb;
643 	ap.a_cmd = cmd;
644 
645 	DO_OPS(ops, error, &ap, vop_bmap);
646 	return(error);
647 }
648 
649 int
650 vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio)
651 {
652 	struct vop_strategy_args ap;
653 	int error;
654 
655 	ap.a_head.a_desc = &vop_strategy_desc;
656 	ap.a_head.a_ops = ops;
657 	ap.a_vp = vp;
658 	ap.a_bio = bio;
659 
660 	DO_OPS(ops, error, &ap, vop_strategy);
661 	if (error == 0 && bio->bio_buf->b_cmd != BUF_CMD_READ)
662 		cache_update_fsmid_vp(vp);
663 	return(error);
664 }
665 
666 int
667 vop_print(struct vop_ops *ops, struct vnode *vp)
668 {
669 	struct vop_print_args ap;
670 	int error;
671 
672 	ap.a_head.a_desc = &vop_print_desc;
673 	ap.a_head.a_ops = ops;
674 	ap.a_vp = vp;
675 
676 	DO_OPS(ops, error, &ap, vop_print);
677 	return(error);
678 }
679 
680 int
681 vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
682 	register_t *retval)
683 {
684 	struct vop_pathconf_args ap;
685 	int error;
686 
687 	ap.a_head.a_desc = &vop_pathconf_desc;
688 	ap.a_head.a_ops = ops;
689 	ap.a_vp = vp;
690 	ap.a_name = name;
691 	ap.a_retval = retval;
692 
693 	DO_OPS(ops, error, &ap, vop_pathconf);
694 	return(error);
695 }
696 
697 int
698 vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
699 	struct flock *fl, int flags)
700 {
701 	struct vop_advlock_args ap;
702 	int error;
703 
704 	ap.a_head.a_desc = &vop_advlock_desc;
705 	ap.a_head.a_ops = ops;
706 	ap.a_vp = vp;
707 	ap.a_id = id;
708 	ap.a_op = op;
709 	ap.a_fl = fl;
710 	ap.a_flags = flags;
711 
712 	DO_OPS(ops, error, &ap, vop_advlock);
713 	return(error);
714 }
715 
716 int
717 vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
718 	int size, struct ucred *cred, int flags,
719 	struct buf **bpp)
720 {
721 	struct vop_balloc_args ap;
722 	int error;
723 
724 	ap.a_head.a_desc = &vop_balloc_desc;
725 	ap.a_head.a_ops = ops;
726 	ap.a_vp = vp;
727 	ap.a_startoffset = startoffset;
728 	ap.a_size = size;
729 	ap.a_cred = cred;
730 	ap.a_flags = flags;
731 	ap.a_bpp = bpp;
732 
733 	DO_OPS(ops, error, &ap, vop_balloc);
734 	return(error);
735 }
736 
737 int
738 vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
739 	struct cluster_save *buflist)
740 {
741 	struct vop_reallocblks_args ap;
742 	int error;
743 
744 	ap.a_head.a_desc = &vop_reallocblks_desc;
745 	ap.a_head.a_ops = ops;
746 	ap.a_vp = vp;
747 	ap.a_buflist = buflist;
748 
749 	DO_OPS(ops, error, &ap, vop_reallocblks);
750 	return(error);
751 }
752 
753 int
754 vop_getpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
755 	int reqpage, vm_ooffset_t offset)
756 {
757 	struct vop_getpages_args ap;
758 	int error;
759 
760 	ap.a_head.a_desc = &vop_getpages_desc;
761 	ap.a_head.a_ops = ops;
762 	ap.a_vp = vp;
763 	ap.a_m = m;
764 	ap.a_count = count;
765 	ap.a_reqpage = reqpage;
766 	ap.a_offset = offset;
767 
768 	DO_OPS(ops, error, &ap, vop_getpages);
769 	return(error);
770 }
771 
772 int
773 vop_putpages(struct vop_ops *ops, struct vnode *vp, vm_page_t *m, int count,
774 	int sync, int *rtvals, vm_ooffset_t offset)
775 {
776 	struct vop_putpages_args ap;
777 	int error;
778 
779 	ap.a_head.a_desc = &vop_putpages_desc;
780 	ap.a_head.a_ops = ops;
781 	ap.a_vp = vp;
782 	ap.a_m = m;
783 	ap.a_count = count;
784 	ap.a_sync = sync;
785 	ap.a_rtvals = rtvals;
786 	ap.a_offset = offset;
787 
788 	DO_OPS(ops, error, &ap, vop_putpages);
789 	if (error == 0)
790 		cache_update_fsmid_vp(vp);
791 	return(error);
792 }
793 
794 int
795 vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length)
796 {
797 	struct vop_freeblks_args ap;
798 	int error;
799 
800 	ap.a_head.a_desc = &vop_freeblks_desc;
801 	ap.a_head.a_ops = ops;
802 	ap.a_vp = vp;
803 	ap.a_offset = offset;
804 	ap.a_length = length;
805 
806 	DO_OPS(ops, error, &ap, vop_freeblks);
807 	return(error);
808 }
809 
810 int
811 vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
812 	struct acl *aclp, struct ucred *cred)
813 {
814 	struct vop_getacl_args ap;
815 	int error;
816 
817 	ap.a_head.a_desc = &vop_getacl_desc;
818 	ap.a_head.a_ops = ops;
819 	ap.a_vp = vp;
820 	ap.a_type = type;
821 	ap.a_aclp = aclp;
822 	ap.a_cred = cred;
823 
824 	DO_OPS(ops, error, &ap, vop_getacl);
825 	return(error);
826 }
827 
828 int
829 vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
830 	struct acl *aclp, struct ucred *cred)
831 {
832 	struct vop_setacl_args ap;
833 	int error;
834 
835 	ap.a_head.a_desc = &vop_setacl_desc;
836 	ap.a_head.a_ops = ops;
837 	ap.a_vp = vp;
838 	ap.a_type = type;
839 	ap.a_aclp = aclp;
840 	ap.a_cred = cred;
841 
842 	DO_OPS(ops, error, &ap, vop_setacl);
843 	if (error == 0)
844 		cache_update_fsmid_vp(vp);
845 	return(error);
846 }
847 
848 int
849 vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
850 	struct acl *aclp, struct ucred *cred)
851 {
852 	struct vop_aclcheck_args ap;
853 	int error;
854 
855 	ap.a_head.a_desc = &vop_aclcheck_desc;
856 	ap.a_head.a_ops = ops;
857 	ap.a_vp = vp;
858 	ap.a_type = type;
859 	ap.a_aclp = aclp;
860 	ap.a_cred = cred;
861 
862 	DO_OPS(ops, error, &ap, vop_aclcheck);
863 	return(error);
864 }
865 
866 int
867 vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
868 	struct uio *uio, struct ucred *cred)
869 {
870 	struct vop_getextattr_args ap;
871 	int error;
872 
873 	ap.a_head.a_desc = &vop_getextattr_desc;
874 	ap.a_head.a_ops = ops;
875 	ap.a_vp = vp;
876 	ap.a_name = name;
877 	ap.a_uio = uio;
878 	ap.a_cred = cred;
879 
880 	DO_OPS(ops, error, &ap, vop_getextattr);
881 	return(error);
882 }
883 
884 int
885 vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
886 	struct uio *uio, struct ucred *cred)
887 {
888 	struct vop_setextattr_args ap;
889 	int error;
890 
891 	ap.a_head.a_desc = &vop_setextattr_desc;
892 	ap.a_head.a_ops = ops;
893 	ap.a_vp = vp;
894 	ap.a_name = name;
895 	ap.a_uio = uio;
896 	ap.a_cred = cred;
897 
898 	DO_OPS(ops, error, &ap, vop_setextattr);
899 	if (error == 0)
900 		cache_update_fsmid_vp(vp);
901 	return(error);
902 }
903 
904 int
905 vop_mountctl(struct vop_ops *ops, int op, struct file *fp,
906 	const void *ctl, int ctllen, void *buf, int buflen, int *res)
907 {
908 	struct vop_mountctl_args ap;
909 	int error;
910 
911 	ap.a_head.a_desc = &vop_mountctl_desc;
912 	ap.a_head.a_ops = ops;
913 	ap.a_op = op;
914 	ap.a_ctl = ctl;
915 	ap.a_fp = fp;
916 	ap.a_ctllen = ctllen;
917 	ap.a_buf = buf;
918 	ap.a_buflen = buflen;
919 	ap.a_res = res;
920 
921 	DO_OPS(ops, error, &ap, vop_mountctl);
922 	return(error);
923 }
924 
925 int
926 vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred)
927 {
928 	struct vop_markatime_args ap;
929 	int error;
930 
931 	ap.a_head.a_desc = &vop_markatime_desc;
932 	ap.a_head.a_ops = ops;
933 	ap.a_vp = vp;
934 	ap.a_cred = cred;
935 
936 	DO_OPS(ops, error, &ap, vop_markatime);
937 	return(error);
938 }
939 
940 /*
941  * NEW API FUNCTIONS
942  *
943  * nresolve takes a locked ncp, a referenced but unlocked dvp, and a cred,
944  * and resolves the ncp into a positive or negative hit.
945  *
946  * The namecache is automatically adjusted by this function.  The ncp
947  * is left locked on return.
948  */
949 int
950 vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
951 	     struct vnode *dvp, struct ucred *cred)
952 {
953 	struct vop_nresolve_args ap;
954 	int error;
955 
956 	ap.a_head.a_desc = &vop_nresolve_desc;
957 	ap.a_head.a_ops = ops;
958 	ap.a_nch = nch;
959 	ap.a_dvp = dvp;
960 	ap.a_cred = cred;
961 
962 	DO_OPS(ops, error, &ap, vop_nresolve);
963 	return(error);
964 }
965 
966 /*
967  * nlookupdotdot takes an unlocked directory, referenced dvp, and looks
968  * up "..", returning a locked parent directory in *vpp.  If an error
969  * occurs *vpp will be NULL.
970  */
971 int
972 vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
973 	struct vnode **vpp, struct ucred *cred, char **fakename)
974 {
975 	struct vop_nlookupdotdot_args ap;
976 	int error;
977 
978 	ap.a_head.a_desc = &vop_nlookupdotdot_desc;
979 	ap.a_head.a_ops = ops;
980 	ap.a_dvp = dvp;
981 	ap.a_vpp = vpp;
982 	ap.a_cred = cred;
983 	ap.a_fakename = fakename;
984 
985 	DO_OPS(ops, error, &ap, vop_nlookupdotdot);
986 	return(error);
987 }
988 
989 /*
990  * ncreate takes a locked, resolved ncp that typically represents a negative
991  * cache hit and creates the file or node specified by the ncp, cred, and
992  * vattr.  If no error occurs a locked vnode is returned in *vpp.
993  *
994  * The dvp passed in is referenced but unlocked.
995  *
996  * The namecache is automatically adjusted by this function.  The ncp
997  * is left locked on return.
998  */
999 int
1000 vop_ncreate(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1001 	struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1002 {
1003 	struct vop_ncreate_args ap;
1004 	int error;
1005 
1006 	ap.a_head.a_desc = &vop_ncreate_desc;
1007 	ap.a_head.a_ops = ops;
1008 	ap.a_nch = nch;
1009 	ap.a_dvp = dvp;
1010 	ap.a_vpp = vpp;
1011 	ap.a_cred = cred;
1012 	ap.a_vap = vap;
1013 
1014 	DO_OPS(ops, error, &ap, vop_ncreate);
1015 	if (error == 0 && *vpp)
1016 		cache_update_fsmid_vp(*vpp);
1017 	return(error);
1018 }
1019 
1020 /*
1021  * nmkdir takes a locked, resolved ncp that typically represents a negative
1022  * cache hit and creates the directory specified by the ncp, cred, and
1023  * vattr.  If no error occurs a locked vnode is returned in *vpp.
1024  *
1025  * The dvp passed in is referenced but unlocked.
1026  *
1027  * The namecache is automatically adjusted by this function.  The ncp
1028  * is left locked on return.
1029  */
1030 int
1031 vop_nmkdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1032 	struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1033 {
1034 	struct vop_nmkdir_args ap;
1035 	int error;
1036 
1037 	ap.a_head.a_desc = &vop_nmkdir_desc;
1038 	ap.a_head.a_ops = ops;
1039 	ap.a_nch = nch;
1040 	ap.a_dvp = dvp;
1041 	ap.a_vpp = vpp;
1042 	ap.a_cred = cred;
1043 	ap.a_vap = vap;
1044 
1045 	DO_OPS(ops, error, &ap, vop_nmkdir);
1046 	if (error == 0 && *vpp)
1047 		cache_update_fsmid_vp(*vpp);
1048 	return(error);
1049 }
1050 
1051 /*
1052  * nmknod takes a locked, resolved ncp that typically represents a negative
1053  * cache hit and creates the node specified by the ncp, cred, and
1054  * vattr.  If no error occurs a locked vnode is returned in *vpp.
1055  *
1056  * The dvp passed in is referenced but unlocked.
1057  *
1058  * The namecache is automatically adjusted by this function.  The ncp
1059  * is left locked on return.
1060  */
1061 int
1062 vop_nmknod(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1063 	struct vnode **vpp, struct ucred *cred, struct vattr *vap)
1064 {
1065 	struct vop_nmknod_args ap;
1066 	int error;
1067 
1068 	ap.a_head.a_desc = &vop_nmknod_desc;
1069 	ap.a_head.a_ops = ops;
1070 	ap.a_nch = nch;
1071 	ap.a_dvp = dvp;
1072 	ap.a_vpp = vpp;
1073 	ap.a_cred = cred;
1074 	ap.a_vap = vap;
1075 
1076 	DO_OPS(ops, error, &ap, vop_nmknod);
1077 	if (error == 0 && *vpp)
1078 		cache_update_fsmid_vp(*vpp);
1079 	return(error);
1080 }
1081 
1082 /*
1083  * nlink takes a locked, resolved ncp that typically represents a negative
1084  * cache hit and creates the node specified by the ncp, cred, and
1085  * existing vnode.  The passed vp must be locked and will remain locked
1086  * on return, as does the ncp, whether an error occurs or not.
1087  *
1088  * The dvp passed in is referenced but unlocked.
1089  *
1090  * The namecache is automatically adjusted by this function.  The ncp
1091  * is left locked on return.
1092  */
1093 int
1094 vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1095 	  struct vnode *vp, struct ucred *cred)
1096 {
1097 	struct vop_nlink_args ap;
1098 	int error;
1099 
1100 	ap.a_head.a_desc = &vop_nlink_desc;
1101 	ap.a_head.a_ops = ops;
1102 	ap.a_nch = nch;
1103 	ap.a_dvp = dvp;
1104 	ap.a_vp = vp;
1105 	ap.a_cred = cred;
1106 
1107 	DO_OPS(ops, error, &ap, vop_nlink);
1108 	if (error == 0)
1109 		cache_update_fsmid(nch);
1110 	return(error);
1111 }
1112 
1113 /*
1114  * nsymlink takes a locked, resolved ncp that typically represents a negative
1115  * cache hit and creates a symbolic link based on cred, vap, and target (the
1116  * contents of the link).  If no error occurs a locked vnode is returned in
1117  * *vpp.
1118  *
1119  * The dvp passed in is referenced but unlocked.
1120  *
1121  * The namecache is automatically adjusted by this function.  The ncp
1122  * is left locked on return.
1123  */
1124 int
1125 vop_nsymlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1126 	struct vnode **vpp, struct ucred *cred,
1127 	struct vattr *vap, char *target)
1128 {
1129 	struct vop_nsymlink_args ap;
1130 	int error;
1131 
1132 	ap.a_head.a_desc = &vop_nsymlink_desc;
1133 	ap.a_head.a_ops = ops;
1134 	ap.a_nch = nch;
1135 	ap.a_dvp = dvp;
1136 	ap.a_vpp = vpp;
1137 	ap.a_cred = cred;
1138 	ap.a_vap = vap;
1139 	ap.a_target = target;
1140 
1141 	DO_OPS(ops, error, &ap, vop_nsymlink);
1142 	if (error == 0)
1143 		cache_update_fsmid(nch);
1144 	return(error);
1145 }
1146 
1147 /*
1148  * nwhiteout takes a locked, resolved ncp that can represent a positive or
1149  * negative hit and executes the whiteout function specified in flags.
1150  *
1151  * The dvp passed in is referenced but unlocked.
1152  *
1153  * The namecache is automatically adjusted by this function.  The ncp
1154  * is left locked on return.
1155  */
1156 int
1157 vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1158 	struct ucred *cred, int flags)
1159 {
1160 	struct vop_nwhiteout_args ap;
1161 	int error;
1162 
1163 	ap.a_head.a_desc = &vop_nwhiteout_desc;
1164 	ap.a_head.a_ops = ops;
1165 	ap.a_nch = nch;
1166 	ap.a_dvp = dvp;
1167 	ap.a_cred = cred;
1168 	ap.a_flags = flags;
1169 
1170 	DO_OPS(ops, error, &ap, vop_nwhiteout);
1171 	if (error == 0)
1172 		cache_update_fsmid(nch);
1173 	return(error);
1174 }
1175 
1176 /*
1177  * nremove takes a locked, resolved ncp that generally represents a
1178  * positive hit and removes the file.
1179  *
1180  * The dvp passed in is referenced but unlocked.
1181  *
1182  * The namecache is automatically adjusted by this function.  The ncp
1183  * is left locked on return.
1184  */
1185 int
1186 vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1187 	    struct ucred *cred)
1188 {
1189 	struct vop_nremove_args ap;
1190 	int error;
1191 
1192 	ap.a_head.a_desc = &vop_nremove_desc;
1193 	ap.a_head.a_ops = ops;
1194 	ap.a_nch = nch;
1195 	ap.a_dvp = dvp;
1196 	ap.a_cred = cred;
1197 
1198 	DO_OPS(ops, error, &ap, vop_nremove);
1199 	if (error == 0)
1200 		cache_update_fsmid(nch);
1201 	return(error);
1202 }
1203 
1204 /*
1205  * nrmdir takes a locked, resolved ncp that generally represents a
1206  * directory and removes the directory.
1207  *
1208  * The dvp passed in is referenced but unlocked.
1209  *
1210  * The namecache is automatically adjusted by this function.  The ncp
1211  * is left locked on return.
1212  */
1213 int
1214 vop_nrmdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
1215 	   struct ucred *cred)
1216 {
1217 	struct vop_nrmdir_args ap;
1218 	int error;
1219 
1220 	ap.a_head.a_desc = &vop_nrmdir_desc;
1221 	ap.a_head.a_ops = ops;
1222 	ap.a_nch = nch;
1223 	ap.a_dvp = dvp;
1224 	ap.a_cred = cred;
1225 
1226 	DO_OPS(ops, error, &ap, vop_nrmdir);
1227 	if (error == 0)
1228 		cache_update_fsmid(nch);
1229 	return(error);
1230 }
1231 
1232 /*
1233  * nrename takes TWO locked, resolved ncp's and the cred of the caller
1234  * and renames the source ncp to the target ncp.  The target ncp may
1235  * represent a positive or negative hit.
1236  *
1237  * The fdvp and tdvp passed in are referenced but unlocked.
1238  *
1239  * The namecache is automatically adjusted by this function.  The ncp
1240  * is left locked on return.  The source ncp is typically changed to
1241  * a negative cache hit and the target ncp typically takes on the
1242  * source ncp's underlying file.
1243  */
1244 int
1245 vop_nrename(struct vop_ops *ops,
1246 	    struct nchandle *fnch, struct nchandle *tnch,
1247 	    struct vnode *fdvp, struct vnode *tdvp,
1248 	    struct ucred *cred)
1249 {
1250 	struct vop_nrename_args ap;
1251 	int error;
1252 
1253 	ap.a_head.a_desc = &vop_nrename_desc;
1254 	ap.a_head.a_ops = ops;
1255 	ap.a_fnch = fnch;
1256 	ap.a_tnch = tnch;
1257 	ap.a_fdvp = fdvp;
1258 	ap.a_tdvp = tdvp;
1259 	ap.a_cred = cred;
1260 
1261 	DO_OPS(ops, error, &ap, vop_nrename);
1262 	if (error == 0) {
1263 		cache_update_fsmid(fnch);
1264 		cache_update_fsmid(tnch);
1265 	}
1266 	return(error);
1267 }
1268 
1269 /************************************************************************
1270  *		PRIMARY VNODE OPERATIONS FORWARDING CALLS		*
1271  ************************************************************************
1272  *
1273  * These procedures are called from VFSs such as unionfs and nullfs
1274  * when they wish to forward an operation on one VFS to another.  The
1275  * argument structure/message is modified and then directly passed to the
1276  * appropriate routine.  This routines may also be called by initiators
1277  * who have an argument structure in hand rather then discreet arguments.
1278  */
1279 int
1280 vop_vnoperate_ap(struct vop_generic_args *ap)
1281 {
1282 	struct vop_ops *ops;
1283 	int error;
1284 
1285 	ops = ap->a_ops;
1286 	error = VOCALL(ops, ap);
1287 
1288 	return (error);
1289 }
1290 
1291 /*
1292  * This routine is called by the cache coherency layer to execute the actual
1293  * VFS operation.  If a journaling layer is present we call though it, else
1294  * we call the native VOP functions.
1295  */
1296 int
1297 vop_cache_operate_ap(struct vop_generic_args *ap)
1298 {
1299 	struct vop_ops *ops;
1300 	int error;
1301 
1302 	ops = ap->a_ops;
1303 	if (ops->head.vv_mount->mnt_vn_journal_ops)
1304 		error = VOCALL(ops->head.vv_mount->mnt_vn_journal_ops, ap);
1305 	else
1306 		error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
1307 	return (error);
1308 }
1309 
1310 
1311 /*
1312  * This routine is called by the journaling layer to execute the actual
1313  * VFS operation.
1314  */
1315 int
1316 vop_journal_operate_ap(struct vop_generic_args *ap)
1317 {
1318 	struct vop_ops *ops;
1319 	int error;
1320 
1321 	ops = ap->a_ops;
1322 	error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
1323 
1324 	return (error);
1325 }
1326 
1327 int
1328 vop_open_ap(struct vop_open_args *ap)
1329 {
1330 	int error;
1331 
1332 	DO_OPS(ap->a_head.a_ops, error, ap, vop_open);
1333 	return(error);
1334 }
1335 
1336 int
1337 vop_close_ap(struct vop_close_args *ap)
1338 {
1339 	int error;
1340 
1341 	DO_OPS(ap->a_head.a_ops, error, ap, vop_close);
1342 	return(error);
1343 }
1344 
1345 int
1346 vop_access_ap(struct vop_access_args *ap)
1347 {
1348 	int error;
1349 
1350 	DO_OPS(ap->a_head.a_ops, error, ap, vop_access);
1351 	return(error);
1352 }
1353 
1354 int
1355 vop_getattr_ap(struct vop_getattr_args *ap)
1356 {
1357 	int error;
1358 
1359 	DO_OPS(ap->a_head.a_ops, error, ap, vop_getattr);
1360 	return(error);
1361 }
1362 
1363 int
1364 vop_setattr_ap(struct vop_setattr_args *ap)
1365 {
1366 	int error;
1367 
1368 	DO_OPS(ap->a_head.a_ops, error, ap, vop_setattr);
1369 	return(error);
1370 }
1371 
1372 int
1373 vop_read_ap(struct vop_read_args *ap)
1374 {
1375 	int error;
1376 
1377 	DO_OPS(ap->a_head.a_ops, error, ap, vop_read);
1378 	return(error);
1379 }
1380 
1381 int
1382 vop_write_ap(struct vop_write_args *ap)
1383 {
1384 	int error;
1385 
1386 	DO_OPS(ap->a_head.a_ops, error, ap, vop_write);
1387 	return(error);
1388 }
1389 
1390 int
1391 vop_ioctl_ap(struct vop_ioctl_args *ap)
1392 {
1393 	int error;
1394 
1395 	DO_OPS(ap->a_head.a_ops, error, ap, vop_ioctl);
1396 	return(error);
1397 }
1398 
1399 int
1400 vop_poll_ap(struct vop_poll_args *ap)
1401 {
1402 	int error;
1403 
1404 	DO_OPS(ap->a_head.a_ops, error, ap, vop_poll);
1405 	return(error);
1406 }
1407 
1408 int
1409 vop_kqfilter_ap(struct vop_kqfilter_args *ap)
1410 {
1411 	int error;
1412 
1413 	DO_OPS(ap->a_head.a_ops, error, ap, vop_kqfilter);
1414 	return(error);
1415 }
1416 
1417 int
1418 vop_revoke_ap(struct vop_revoke_args *ap)
1419 {
1420 	int error;
1421 
1422 	DO_OPS(ap->a_head.a_ops, error, ap, vop_revoke);
1423 	return(error);
1424 }
1425 
1426 int
1427 vop_mmap_ap(struct vop_mmap_args *ap)
1428 {
1429 	int error;
1430 
1431 	DO_OPS(ap->a_head.a_ops, error, ap, vop_mmap);
1432 	return(error);
1433 }
1434 
1435 int
1436 vop_fsync_ap(struct vop_fsync_args *ap)
1437 {
1438 	int error;
1439 
1440 	DO_OPS(ap->a_head.a_ops, error, ap, vop_fsync);
1441 	return(error);
1442 }
1443 
1444 int
1445 vop_readdir_ap(struct vop_readdir_args *ap)
1446 {
1447 	int error;
1448 
1449 	DO_OPS(ap->a_head.a_ops, error, ap, vop_readdir);
1450 	return(error);
1451 }
1452 
1453 int
1454 vop_readlink_ap(struct vop_readlink_args *ap)
1455 {
1456 	int error;
1457 
1458 	DO_OPS(ap->a_head.a_ops, error, ap, vop_readlink);
1459 	return(error);
1460 }
1461 
1462 int
1463 vop_inactive_ap(struct vop_inactive_args *ap)
1464 {
1465 	int error;
1466 
1467 	DO_OPS(ap->a_head.a_ops, error, ap, vop_inactive);
1468 	return(error);
1469 }
1470 
1471 int
1472 vop_reclaim_ap(struct vop_reclaim_args *ap)
1473 {
1474 	int error;
1475 
1476 	DO_OPS(ap->a_head.a_ops, error, ap, vop_reclaim);
1477 	return(error);
1478 }
1479 
1480 int
1481 vop_bmap_ap(struct vop_bmap_args *ap)
1482 {
1483 	int error;
1484 
1485 	DO_OPS(ap->a_head.a_ops, error, ap, vop_bmap);
1486 	return(error);
1487 }
1488 
1489 int
1490 vop_strategy_ap(struct vop_strategy_args *ap)
1491 {
1492 	int error;
1493 
1494 	DO_OPS(ap->a_head.a_ops, error, ap, vop_strategy);
1495 	return(error);
1496 }
1497 
1498 int
1499 vop_print_ap(struct vop_print_args *ap)
1500 {
1501 	int error;
1502 
1503 	DO_OPS(ap->a_head.a_ops, error, ap, vop_print);
1504 	return(error);
1505 }
1506 
1507 int
1508 vop_pathconf_ap(struct vop_pathconf_args *ap)
1509 {
1510 	int error;
1511 
1512 	DO_OPS(ap->a_head.a_ops, error, ap, vop_pathconf);
1513 	return(error);
1514 }
1515 
1516 int
1517 vop_advlock_ap(struct vop_advlock_args *ap)
1518 {
1519 	int error;
1520 
1521 	DO_OPS(ap->a_head.a_ops, error, ap, vop_advlock);
1522 	return(error);
1523 }
1524 
1525 int
1526 vop_balloc_ap(struct vop_balloc_args *ap)
1527 {
1528 	int error;
1529 
1530 	DO_OPS(ap->a_head.a_ops, error, ap, vop_balloc);
1531 	return(error);
1532 }
1533 
1534 int
1535 vop_reallocblks_ap(struct vop_reallocblks_args *ap)
1536 {
1537 	int error;
1538 
1539 	DO_OPS(ap->a_head.a_ops, error, ap, vop_reallocblks);
1540 	return(error);
1541 }
1542 
1543 int
1544 vop_getpages_ap(struct vop_getpages_args *ap)
1545 {
1546 	int error;
1547 
1548 	DO_OPS(ap->a_head.a_ops, error, ap, vop_getpages);
1549 	return(error);
1550 }
1551 
1552 int
1553 vop_putpages_ap(struct vop_putpages_args *ap)
1554 {
1555 	int error;
1556 
1557 	DO_OPS(ap->a_head.a_ops, error, ap, vop_putpages);
1558 	return(error);
1559 }
1560 
1561 int
1562 vop_freeblks_ap(struct vop_freeblks_args *ap)
1563 {
1564 	int error;
1565 
1566 	DO_OPS(ap->a_head.a_ops, error, ap, vop_freeblks);
1567 	return(error);
1568 }
1569 
1570 int
1571 vop_getacl_ap(struct vop_getacl_args *ap)
1572 {
1573 	int error;
1574 
1575 	DO_OPS(ap->a_head.a_ops, error, ap, vop_getacl);
1576 	return(error);
1577 }
1578 
1579 int
1580 vop_setacl_ap(struct vop_setacl_args *ap)
1581 {
1582 	int error;
1583 
1584 	DO_OPS(ap->a_head.a_ops, error, ap, vop_setacl);
1585 	return(error);
1586 }
1587 
1588 int
1589 vop_aclcheck_ap(struct vop_aclcheck_args *ap)
1590 {
1591 	int error;
1592 
1593 	DO_OPS(ap->a_head.a_ops, error, ap, vop_aclcheck);
1594 	return(error);
1595 }
1596 
1597 int
1598 vop_getextattr_ap(struct vop_getextattr_args *ap)
1599 {
1600 	int error;
1601 
1602 	DO_OPS(ap->a_head.a_ops, error, ap, vop_getextattr);
1603 	return(error);
1604 }
1605 
1606 int
1607 vop_setextattr_ap(struct vop_setextattr_args *ap)
1608 {
1609 	int error;
1610 
1611 	DO_OPS(ap->a_head.a_ops, error, ap, vop_setextattr);
1612 	return(error);
1613 }
1614 
1615 int
1616 vop_mountctl_ap(struct vop_mountctl_args *ap)
1617 {
1618 	int error;
1619 
1620 	DO_OPS(ap->a_head.a_ops, error, ap, vop_mountctl);
1621 	return(error);
1622 }
1623 
1624 int
1625 vop_markatime_ap(struct vop_markatime_args *ap)
1626 {
1627 	int error;
1628 
1629 	DO_OPS(ap->a_head.a_ops, error, ap, vop_markatime);
1630 	return(error);
1631 }
1632 
1633 int
1634 vop_nresolve_ap(struct vop_nresolve_args *ap)
1635 {
1636 	int error;
1637 
1638 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nresolve);
1639 	return(error);
1640 }
1641 
1642 int
1643 vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap)
1644 {
1645 	int error;
1646 
1647 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nlookupdotdot);
1648 	return(error);
1649 }
1650 
1651 int
1652 vop_ncreate_ap(struct vop_ncreate_args *ap)
1653 {
1654 	int error;
1655 
1656 	DO_OPS(ap->a_head.a_ops, error, ap, vop_ncreate);
1657 	return(error);
1658 }
1659 
1660 int
1661 vop_nmkdir_ap(struct vop_nmkdir_args *ap)
1662 {
1663 	int error;
1664 
1665 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nmkdir);
1666 	return(error);
1667 }
1668 
1669 int
1670 vop_nmknod_ap(struct vop_nmknod_args *ap)
1671 {
1672 	int error;
1673 
1674 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nmknod);
1675 	return(error);
1676 }
1677 
1678 int
1679 vop_nlink_ap(struct vop_nlink_args *ap)
1680 {
1681 	int error;
1682 
1683 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nlink);
1684 	return(error);
1685 }
1686 
1687 int
1688 vop_nsymlink_ap(struct vop_nsymlink_args *ap)
1689 {
1690 	int error;
1691 
1692 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nsymlink);
1693 	return(error);
1694 }
1695 
1696 int
1697 vop_nwhiteout_ap(struct vop_nwhiteout_args *ap)
1698 {
1699 	int error;
1700 
1701 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nwhiteout);
1702 	return(error);
1703 }
1704 
1705 int
1706 vop_nremove_ap(struct vop_nremove_args *ap)
1707 {
1708 	int error;
1709 
1710 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nremove);
1711 	return(error);
1712 }
1713 
1714 int
1715 vop_nrmdir_ap(struct vop_nrmdir_args *ap)
1716 {
1717 	int error;
1718 
1719 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nrmdir);
1720 	return(error);
1721 }
1722 
1723 int
1724 vop_nrename_ap(struct vop_nrename_args *ap)
1725 {
1726 	int error;
1727 
1728 	DO_OPS(ap->a_head.a_ops, error, ap, vop_nrename);
1729 	return(error);
1730 }
1731 
1732