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