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