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