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