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