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