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