sys/kern: Add struct file* arg to VOP_{GETATTR,SETATTR,READ,WRITE,FSYNC,READDIR}
[dragonfly.git] / sys / sys / vfsops.h
1 /*
2  * Copyright (c) 2004 The DragonFly Project.  All rights reserved.
3  * 
4  * This code is derived from software contributed to The DragonFly Project
5  * by Matthew Dillon <dillon@backplane.com>
6  * 
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  * 3. Neither the name of The DragonFly Project nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific, prior written permission.
20  * 
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  */
34
35 /*
36  * The vop_ops structure vectors all access to a filesystem.  It contains a
37  * fixed set of vectors.
38  *
39  * In DragonFly the ultimate goal is to thread the VFS, which means that
40  * the dispatch functions will eventually be called from the context of 
41  * a management thread rather then directly called by a process.  This
42  * requires us to divorce direct process dependancies (in particular ioctl
43  * and UIO's).  In addition, it is our intention to implement kernel
44  * level cache management and coherency in the vop_*() interfacing
45  * layer.
46  *
47  * The number of management threads will depend on the VFS.  The idea is
48  * to give a high performance VFS such as UFS at least one thread per cpu,
49  * and a low performance VFS such as CD9660 perhaps just one thread period.
50  * Blocking issues within the management thread are up to the VFS itself,
51  * but DragonFly will introduce a layer above the VFS to handle cacheable
52  * requests without having to enter the VFS (e.g. by making attribute
53  * and VM object information a permanent fixture of the vnode structure
54  * and accessing them directly).
55  *
56  * THE VOPOPS VECTORS SHOULD NEVER BE CALLED DIRECTLY!  Instead always use
57  * the kernel helper procedures vop_*() to call a vopop.  The kernel
58  * helper procedure will be responsible for handling the DragonFly messaging
59  * conversion when it occurs.
60  */
61
62 #ifndef _SYS_VFSOPS_H_
63 #define _SYS_VFSOPS_H_
64
65 #ifndef _SYS_ACL_H_
66 #include <sys/acl.h>
67 #endif
68 #ifndef _SYS_BUF_H_
69 #include <sys/buf.h>    /* buf_cmd_t */
70 #endif
71 #ifndef _SYS_FCNTL_H_
72 #include <sys/fcntl.h>  /* AT_EACCESS */
73 #endif
74
75 struct syslink_desc;
76 struct vnode;
77 struct thread;
78 struct nchandle;
79 struct componentname;
80 struct vattr;
81 struct ucred;
82 struct uio;
83 struct file;
84 struct knote;
85 struct vm_object;
86 struct vm_page;
87 struct vfscache;
88
89 struct vop_generic_args {
90         struct syslink_desc *a_desc;    /* command descriptor for the call */
91         struct vop_ops *a_ops;          /* operations vector for the call */
92         int a_reserved[4];
93 };
94
95 struct vop_old_lookup_args {
96         struct vop_generic_args a_head;
97         struct vnode *a_dvp;
98         struct vnode **a_vpp;
99         struct componentname *a_cnp;
100 };
101
102 struct vop_old_create_args {
103         struct vop_generic_args a_head;
104         struct vnode *a_dvp;
105         struct vnode **a_vpp;
106         struct componentname *a_cnp;
107         struct vattr *a_vap;
108 };
109
110 struct vop_old_whiteout_args {
111         struct vop_generic_args a_head;
112         struct vnode *a_dvp;
113         struct componentname *a_cnp;
114         int a_flags;
115 };
116
117 struct vop_old_mknod_args {
118         struct vop_generic_args a_head;
119         struct vnode *a_dvp;
120         struct vnode **a_vpp;
121         struct componentname *a_cnp;
122         struct vattr *a_vap;
123 };
124
125 struct vop_open_args {
126         struct vop_generic_args a_head;
127         struct vnode *a_vp;
128         int a_mode;
129         struct ucred *a_cred;
130         struct file *a_fp;              /* optional fp for fileops override */
131 };
132
133 struct vop_close_args {
134         struct vop_generic_args a_head;
135         struct vnode *a_vp;
136         int a_fflag;
137         struct file *a_fp;              /* optional fp for fileops override */
138 };
139
140 struct vop_access_args {
141         struct vop_generic_args a_head;
142         struct vnode *a_vp;
143         int a_mode;                             /* V* bitmask */
144         int a_flags;                            /* AT_* bitmask */
145         struct ucred *a_cred;
146 };
147
148 struct vop_getattr_args {
149         struct vop_generic_args a_head;
150         struct vnode *a_vp;
151         struct vattr *a_vap;
152         struct file *a_fp; /* FUSE */
153 };
154
155 struct vop_setattr_args {
156         struct vop_generic_args a_head;
157         struct vnode *a_vp;
158         struct vattr *a_vap;
159         struct ucred *a_cred;
160         struct file *a_fp; /* FUSE */
161 };
162
163 struct vop_read_args {
164         struct vop_generic_args a_head;
165         struct vnode *a_vp;
166         struct uio *a_uio;
167         int a_ioflag;
168         struct ucred *a_cred;
169         struct file *a_fp; /* FUSE */
170 };
171
172 struct vop_write_args {
173         struct vop_generic_args a_head;
174         struct vnode *a_vp;
175         struct uio *a_uio;
176         int a_ioflag;
177         struct ucred *a_cred;
178         struct file *a_fp; /* FUSE */
179 };
180
181 struct vop_ioctl_args {
182         struct vop_generic_args a_head;
183         struct vnode *a_vp;
184         u_long a_command;
185         caddr_t a_data;
186         int a_fflag;
187         struct ucred *a_cred;
188         struct sysmsg *a_sysmsg;
189 };
190
191 struct vop_poll_args {
192         struct vop_generic_args a_head;
193         struct vnode *a_vp;
194         int a_events;
195         struct ucred *a_cred;
196 };
197
198 struct vop_kqfilter_args {
199         struct vop_generic_args a_head;
200         struct vnode *a_vp;
201         struct knote *a_kn;
202 };
203
204 struct vop_mmap_args {
205         struct vop_generic_args a_head;
206         struct vnode *a_vp;
207         int a_fflags;
208         struct ucred *a_cred;
209 };
210
211 struct vop_fsync_args {
212         struct vop_generic_args a_head;
213         struct vnode *a_vp;
214         int a_waitfor;
215         int a_flags;
216         struct file *a_fp; /* FUSE */
217 };
218
219 struct vop_old_remove_args {
220         struct vop_generic_args a_head;
221         struct vnode *a_dvp;
222         struct vnode *a_vp;
223         struct componentname *a_cnp;
224 };
225
226 struct vop_old_link_args {
227         struct vop_generic_args a_head;
228         struct vnode *a_tdvp;
229         struct vnode *a_vp;
230         struct componentname *a_cnp;
231 };
232
233 struct vop_old_rename_args {
234         struct vop_generic_args a_head;
235         struct vnode *a_fdvp;
236         struct vnode *a_fvp;
237         struct componentname *a_fcnp;
238         struct vnode *a_tdvp;
239         struct vnode *a_tvp;
240         struct componentname *a_tcnp;
241 };
242
243 struct vop_old_mkdir_args {
244         struct vop_generic_args a_head;
245         struct vnode *a_dvp;
246         struct vnode **a_vpp;
247         struct componentname *a_cnp;
248         struct vattr *a_vap;
249 };
250
251 struct vop_old_rmdir_args {
252         struct vop_generic_args a_head;
253         struct vnode *a_dvp;
254         struct vnode *a_vp;
255         struct componentname *a_cnp;
256 };
257
258 struct vop_old_symlink_args {
259         struct vop_generic_args a_head;
260         struct vnode *a_dvp;
261         struct vnode **a_vpp;
262         struct componentname *a_cnp;
263         struct vattr *a_vap;
264         char *a_target;
265 };
266
267 struct vop_readdir_args {
268         struct vop_generic_args a_head;
269         struct vnode *a_vp;
270         struct uio *a_uio;
271         struct ucred *a_cred;
272         int *a_eofflag;
273         int *a_ncookies;
274         off_t **a_cookies;
275         struct file *a_fp; /* FUSE */
276 };
277
278 struct vop_readlink_args {
279         struct vop_generic_args a_head;
280         struct vnode *a_vp;
281         struct uio *a_uio;
282         struct ucred *a_cred;
283 };
284
285 struct vop_inactive_args {
286         struct vop_generic_args a_head;
287         struct vnode *a_vp;
288 };
289
290 struct vop_reclaim_args {
291         struct vop_generic_args a_head;
292         struct vnode *a_vp;
293 };
294
295 struct vop_bmap_args {
296         struct vop_generic_args a_head;
297         struct vnode *a_vp;
298         off_t a_loffset;
299         off_t *a_doffsetp;
300         int *a_runp;
301         int *a_runb;
302         buf_cmd_t a_cmd;        /* BUF_CMD_READ, BUF_CMD_WRITE, etc */
303 };
304
305 struct vop_strategy_args {
306         struct vop_generic_args a_head;
307         struct vnode *a_vp;
308         struct bio *a_bio;
309 };
310
311 struct vop_print_args {
312         struct vop_generic_args a_head;
313         struct vnode *a_vp;
314 };
315
316 struct vop_pathconf_args {
317         struct vop_generic_args a_head;
318         struct vnode *a_vp;
319         int a_name;
320         register_t *a_retval;
321 };
322
323 struct vop_advlock_args {
324         struct vop_generic_args a_head;
325         struct vnode *a_vp;
326         caddr_t a_id;
327         int a_op;
328         struct flock *a_fl;
329         int a_flags;
330 };
331
332 struct vop_balloc_args {
333         struct vop_generic_args a_head;
334         struct vnode *a_vp;
335         off_t a_startoffset;
336         int a_size;
337         struct ucred *a_cred;
338         int a_flags;
339         struct buf **a_bpp;
340 };
341
342 struct vop_reallocblks_args {
343         struct vop_generic_args a_head;
344         struct vnode *a_vp;
345         struct cluster_save *a_buflist;
346 };
347
348 struct vop_getpages_args {
349         struct vop_generic_args a_head;
350         struct vnode *a_vp;
351         struct vm_page **a_m;
352         int a_count;
353         int a_reqpage;
354         vm_ooffset_t a_offset;
355         int a_seqaccess;
356 };
357
358 struct vop_putpages_args {
359         struct vop_generic_args a_head;
360         struct vnode *a_vp;
361         struct vm_page **a_m;
362         int a_count;
363         int a_sync;
364         int *a_rtvals;
365         vm_ooffset_t a_offset;
366 };
367
368 struct vop_freeblks_args {
369         struct vop_generic_args a_head;
370         struct vnode *a_vp;
371         off_t a_offset;
372         int a_length;
373 };
374
375 struct vop_getacl_args {
376         struct vop_generic_args a_head;
377         struct vnode *a_vp;
378         acl_type_t a_type;
379         struct acl *a_aclp;
380         struct ucred *a_cred;
381 };
382
383 struct vop_setacl_args {
384         struct vop_generic_args a_head;
385         struct vnode *a_vp;
386         acl_type_t a_type;
387         struct acl *a_aclp;
388         struct ucred *a_cred;
389 };
390
391 struct vop_aclcheck_args {
392         struct vop_generic_args a_head;
393         struct vnode *a_vp;
394         acl_type_t a_type;
395         struct acl *a_aclp;
396         struct ucred *a_cred;
397 };
398
399 struct vop_getextattr_args {
400         struct vop_generic_args a_head;
401         struct vnode *a_vp;
402         int a_attrnamespace;
403         char *a_attrname;
404         struct uio *a_uio;
405         struct ucred *a_cred;
406 };
407
408 struct vop_setextattr_args {
409         struct vop_generic_args a_head;
410         struct vnode *a_vp;
411         int a_attrnamespace;
412         char *a_attrname;
413         struct uio *a_uio;
414         struct ucred *a_cred;
415 };
416
417 struct vop_mountctl_args {
418         struct vop_generic_args a_head;
419         int a_op;
420         struct file *a_fp;
421         const void *a_ctl;
422         int a_ctllen;
423         void *a_buf;
424         int a_buflen;
425         int *a_res;
426         struct vnode *a_vp;
427 };
428
429 struct vop_markatime_args {
430         struct vop_generic_args a_head;
431         int a_op;
432         struct vnode *a_vp;
433         struct ucred *a_cred;
434 };
435
436 /*
437  * NEW API
438  */
439
440 /*
441  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
442  * it.
443  */
444 struct vop_nresolve_args {
445         struct vop_generic_args a_head;
446         struct nchandle *a_nch;
447         struct vnode *a_dvp;
448         struct ucred *a_cred;
449 };
450
451 struct vop_nlookupdotdot_args {
452         struct vop_generic_args a_head;
453         struct vnode *a_dvp;
454         struct vnode **a_vpp;
455         struct ucred *a_cred;
456         char **a_fakename;
457 };
458
459 /*
460  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
461  * it.
462  */
463 struct vop_ncreate_args {
464         struct vop_generic_args a_head;
465         struct nchandle *a_nch;         /* locked namespace */
466         struct vnode *a_dvp;            /* held directory vnode */
467         struct vnode **a_vpp;           /* returned refd & locked */
468         struct ucred *a_cred;
469         struct vattr *a_vap;
470 };
471
472 /*
473  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
474  * it.
475  */
476 struct vop_nmkdir_args {
477         struct vop_generic_args a_head;
478         struct nchandle *a_nch;         /* locked namespace */
479         struct vnode *a_dvp;
480         struct vnode **a_vpp;                   /* returned refd & locked */
481         struct ucred *a_cred;
482         struct vattr *a_vap;
483 };
484
485 /*
486  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
487  * it.
488  */
489 struct vop_nmknod_args {
490         struct vop_generic_args a_head;
491         struct nchandle *a_nch;
492         struct vnode *a_dvp;
493         struct vnode **a_vpp;
494         struct ucred *a_cred;
495         struct vattr *a_vap;
496 };
497
498 /*
499  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
500  * it.
501  */
502 struct vop_nlink_args {
503         struct vop_generic_args a_head;
504         struct nchandle *a_nch;
505         struct vnode *a_dvp;
506         struct vnode *a_vp;
507         struct ucred *a_cred;
508 };
509
510 /*
511  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
512  * it.
513  */
514 struct vop_nsymlink_args {
515         struct vop_generic_args a_head;
516         struct nchandle *a_nch;
517         struct vnode *a_dvp;
518         struct vnode **a_vpp;
519         struct ucred *a_cred;
520         struct vattr *a_vap;
521         char *a_target;
522 };
523
524 /*
525  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
526  * it.
527  */
528 struct vop_nwhiteout_args {
529         struct vop_generic_args a_head;
530         struct nchandle *a_nch;
531         struct vnode *a_dvp;
532         struct ucred *a_cred;
533         int a_flags;
534 };
535
536 /*
537  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
538  * it.
539  */
540 struct vop_nremove_args {
541         struct vop_generic_args a_head;
542         struct nchandle *a_nch;         /* locked namespace */
543         struct vnode *a_dvp;
544         struct ucred *a_cred;
545 };
546
547 /*
548  * Warning: a_dvp is only held, not ref'd.  The target must still vget()
549  * it.
550  */
551 struct vop_nrmdir_args {
552         struct vop_generic_args a_head;
553         struct nchandle *a_nch;         /* locked namespace */
554         struct vnode *a_dvp;
555         struct ucred *a_cred;
556 };
557
558 /*
559  * Warning: a_fdvp and a_tdvp are only held, not ref'd.  The target must
560  * still vget() it.
561  */
562 struct vop_nrename_args {
563         struct vop_generic_args a_head;
564         struct nchandle *a_fnch;                /* locked namespace / from */
565         struct nchandle *a_tnch;                /* locked namespace / to */
566         struct vnode *a_fdvp;
567         struct vnode *a_tdvp;
568         struct ucred *a_cred;
569 };
570
571 /*
572  * This structure is the post-compiled VOP operations vector.  vop_ops are
573  * typically per-mount entities.  The first section is used by our vop_*()
574  * function wrappers to implement hooks for per-mount management functions
575  * such as journaling and cache coherency protocols.  The second section is
576  * the function dispatch for the VFSs.  The functions are supposed to run
577  * in the context of the VFS's thread (if it has one) and should not be 
578  * directly called from random kernel code.  Note that VOCALL()s are direct
579  * calls used for chaining vop_ops structures from a VFS context.
580  */
581 struct vop_ops {
582         struct {
583                 struct mount    *vv_mount;
584         } head;
585
586 #define vop_ops_first_field     vop_default
587         int     (*vop_default)(struct vop_generic_args *);
588         int     (*vop_unused11)(void *);
589         int     (*vop_old_lookup)(struct vop_old_lookup_args *);
590         int     (*vop_unused03)(void *);
591         int     (*vop_old_create)(struct vop_old_create_args *);
592         int     (*vop_old_whiteout)(struct vop_old_whiteout_args *);
593         int     (*vop_old_mknod)(struct vop_old_mknod_args *);
594         int     (*vop_open)(struct vop_open_args *);
595         int     (*vop_close)(struct vop_close_args *);
596         int     (*vop_access)(struct vop_access_args *);
597         int     (*vop_getattr)(struct vop_getattr_args *);
598         int     (*vop_setattr)(struct vop_setattr_args *);
599         int     (*vop_read)(struct vop_read_args *);
600         int     (*vop_write)(struct vop_write_args *);
601         int     (*vop_unused04)(void *);
602         int     (*vop_ioctl)(struct vop_ioctl_args *);
603         int     (*vop_poll)(struct vop_poll_args *);
604         int     (*vop_kqfilter)(struct vop_kqfilter_args *);
605         int     (*vop_unused01)(void *);        /* was vop_revoke */
606         int     (*vop_mmap)(struct vop_mmap_args *);
607         int     (*vop_fsync)(struct vop_fsync_args *);
608         int     (*vop_old_remove)(struct vop_old_remove_args *);
609         int     (*vop_old_link)(struct vop_old_link_args *);
610         int     (*vop_old_rename)(struct vop_old_rename_args *);
611         int     (*vop_old_mkdir)(struct vop_old_mkdir_args *);
612         int     (*vop_old_rmdir)(struct vop_old_rmdir_args *);
613         int     (*vop_old_symlink)(struct vop_old_symlink_args *);
614         int     (*vop_readdir)(struct vop_readdir_args *);
615         int     (*vop_readlink)(struct vop_readlink_args *);
616         int     (*vop_inactive)(struct vop_inactive_args *);
617         int     (*vop_reclaim)(struct vop_reclaim_args *);
618         int     (*vop_unused09)(void *);
619         int     (*vop_unused10)(void *);
620         int     (*vop_bmap)(struct vop_bmap_args *);
621         int     (*vop_strategy)(struct vop_strategy_args *);
622         int     (*vop_print)(struct vop_print_args *);
623         int     (*vop_pathconf)(struct vop_pathconf_args *);
624         int     (*vop_advlock)(struct vop_advlock_args *);
625         int     (*vop_balloc)(struct vop_balloc_args *);
626         int     (*vop_reallocblks)(struct vop_reallocblks_args *);
627         int     (*vop_getpages)(struct vop_getpages_args *);
628         int     (*vop_putpages)(struct vop_putpages_args *);
629         int     (*vop_freeblks)(struct vop_freeblks_args *);
630         int     (*vop_unused05)(void *);
631         int     (*vop_getacl)(struct vop_getacl_args *);
632         int     (*vop_setacl)(struct vop_setacl_args *);
633         int     (*vop_aclcheck)(struct vop_aclcheck_args *);
634         int     (*vop_getextattr)(struct vop_getextattr_args *);
635         int     (*vop_setextattr)(struct vop_setextattr_args *);
636         int     (*vop_unused06)(void *);
637         int     (*vop_unused07)(void *);
638         int     (*vop_unused08)(void *);
639         int     (*vop_mountctl)(struct vop_mountctl_args *);
640         int     (*vop_markatime)(struct vop_markatime_args *);
641
642         int     (*vop_nresolve)(struct vop_nresolve_args *);
643         int     (*vop_nlookupdotdot)(struct vop_nlookupdotdot_args *);
644         int     (*vop_ncreate)(struct vop_ncreate_args *);
645         int     (*vop_nmkdir)(struct vop_nmkdir_args *);
646         int     (*vop_nmknod)(struct vop_nmknod_args *);
647         int     (*vop_nlink)(struct vop_nlink_args *);
648         int     (*vop_nsymlink)(struct vop_nsymlink_args *);
649         int     (*vop_nwhiteout)(struct vop_nwhiteout_args *);
650         int     (*vop_nremove)(struct vop_nremove_args *);
651         int     (*vop_nrmdir)(struct vop_nrmdir_args *);
652         int     (*vop_nrename)(struct vop_nrename_args *);
653 #define vop_ops_last_field      vop_nrename
654 };
655
656 /*
657  * vop_mountctl() operations
658  */
659 #define VFSSET_DETACH           0
660 #define VFSSET_ATTACH           1
661
662 /*
663  * Kernel VOP arguments union, suitable for malloc / embedding in other
664  * structures.  The vop_args_union can hold any VOP call argument structure.
665  * Note that vu_head is broken out.
666  */
667 union vop_args_union {
668         struct vop_generic_args vu_head;
669         struct vop_generic_args vu_default;
670         struct vop_old_lookup_args vu_lookup;
671         struct vop_old_create_args vu_create;
672         struct vop_old_whiteout_args vu_whiteout;
673         struct vop_old_mknod_args vu_mknod;
674         struct vop_open_args vu_open;
675         struct vop_close_args vu_close;
676         struct vop_access_args vu_access;
677         struct vop_getattr_args vu_getattr;
678         struct vop_setattr_args vu_setattr;
679         struct vop_read_args vu_read;
680         struct vop_write_args vu_write;
681         struct vop_ioctl_args vu_ioctl;
682         struct vop_poll_args vu_poll;
683         struct vop_kqfilter_args vu_kqfilter;
684         struct vop_mmap_args vu_mmap;
685         struct vop_fsync_args vu_fsync;
686         struct vop_old_remove_args vu_remove;
687         struct vop_old_link_args vu_link;
688         struct vop_old_rename_args vu_rename;
689         struct vop_old_mkdir_args vu_mkdir;
690         struct vop_old_rmdir_args vu_rmdir;
691         struct vop_old_symlink_args vu_symlink;
692         struct vop_readdir_args vu_readdir;
693         struct vop_readlink_args vu_readlink;
694         struct vop_inactive_args vu_inactive;
695         struct vop_reclaim_args vu_reclaim;
696         struct vop_bmap_args vu_bmap;
697         struct vop_strategy_args vu_strategy;
698         struct vop_print_args vu_print;
699         struct vop_pathconf_args vu_pathconf;
700         struct vop_advlock_args vu_advlock;
701         struct vop_balloc_args vu_balloc;
702         struct vop_reallocblks_args vu_reallocblks;
703         struct vop_getpages_args vu_getpages;
704         struct vop_putpages_args vu_putpages;
705         struct vop_freeblks_args vu_freeblks;
706         struct vop_getacl_args vu_getacl;
707         struct vop_setacl_args vu_setacl;
708         struct vop_aclcheck_args vu_aclcheck;
709         struct vop_getextattr_args vu_getextattr;
710         struct vop_setextattr_args vu_setextattr;
711         struct vop_mountctl_args vu_mountctl;
712         struct vop_markatime_args vu_markatime;
713
714         struct vop_nresolve_args vu_nresolve;
715         struct vop_nlookupdotdot_args vu_nlookupdotdot;
716         struct vop_ncreate_args vu_ncreate;
717         struct vop_nmkdir_args vu_nmkdir;
718         struct vop_nmknod_args vu_nmknod;
719         struct vop_nlink_args vu_nlink;
720         struct vop_nsymlink_args vu_nsymlink;
721         struct vop_nwhiteout_args vu_nwhiteout;
722         struct vop_nremove_args vu_nremove;
723         struct vop_nrmdir_args vu_nrmdir;
724         struct vop_nrename_args vu_nrename;
725 };
726
727 #ifdef _KERNEL
728
729 /*
730  * Kernel VOP call wrappers.  These wrappers are responsible for wrapping
731  * the arguments in the appropriate VOP arguments structure, sending the
732  * message, and waiting for a reply.  All kernel and VFS code should generally
733  * call these wrappers rather then attempt to call the operations vector
734  * routine directly in order to allow DragonFly to properly wrap the operation
735  * in a message and dispatch it to the correct thread.
736  */
737 int vop_old_lookup(struct vop_ops *ops, struct vnode *dvp, 
738                 struct vnode **vpp, struct componentname *cnp);
739 int vop_old_create(struct vop_ops *ops, struct vnode *dvp,
740                 struct vnode **vpp, struct componentname *cnp,
741                 struct vattr *vap);
742 int vop_old_whiteout(struct vop_ops *ops, struct vnode *dvp, 
743                 struct componentname *cnp, int flags);
744 int vop_old_mknod(struct vop_ops *ops, struct vnode *dvp, 
745                 struct vnode **vpp, struct componentname *cnp,
746                 struct vattr *vap);
747 int vop_open(struct vop_ops *ops, struct vnode *vp, int mode,
748                 struct ucred *cred, struct file *file);
749 int vop_close(struct vop_ops *ops, struct vnode *vp, int fflag,
750                 struct file *file);
751 int vop_access(struct vop_ops *ops, struct vnode *vp, int mode, int flags,
752                 struct ucred *cred);
753 int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
754                 struct file *fp);
755 int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
756                 struct ucred *cred, struct file *fp);
757 int vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
758                 int ioflag, struct ucred *cred, struct file *fp);
759 int vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
760                 int ioflag, struct ucred *cred, struct file *fp);
761 int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command,
762                 caddr_t data, int fflag, struct ucred *cred,
763                 struct sysmsg *msg);
764 int vop_poll(struct vop_ops *ops, struct vnode *vp, int events,
765                 struct ucred *cred);
766 int vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn);
767 int vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags,
768                 struct ucred *cred);
769 int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, int flags,
770                 struct file *fp);
771 int vop_old_remove(struct vop_ops *ops, struct vnode *dvp,
772                 struct vnode *vp, struct componentname *cnp);
773 int vop_old_link(struct vop_ops *ops, struct vnode *tdvp,
774                 struct vnode *vp, struct componentname *cnp);
775 int vop_old_rename(struct vop_ops *ops, struct vnode *fdvp,
776                 struct vnode *fvp, struct componentname *fcnp,
777                 struct vnode *tdvp, struct vnode *tvp,
778                 struct componentname *tcnp);
779 int vop_old_mkdir(struct vop_ops *ops, struct vnode *dvp,
780                 struct vnode **vpp, struct componentname *cnp,
781                 struct vattr *vap);
782 int vop_old_rmdir(struct vop_ops *ops, struct vnode *dvp,
783                 struct vnode *vp, struct componentname *cnp);
784 int vop_old_symlink(struct vop_ops *ops, struct vnode *dvp,
785                 struct vnode **vpp, struct componentname *cnp,
786                 struct vattr *vap, char *target);
787 int vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
788                 struct ucred *cred, int *eofflag, 
789                 int *ncookies, off_t **cookies, struct file *fp);
790 int vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
791                 struct ucred *cred);
792 int vop_inactive(struct vop_ops *ops, struct vnode *vp);
793 int vop_reclaim(struct vop_ops *ops, struct vnode *vp);
794 int vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset,
795                 off_t *doffsetp, int *runp, int *runb, buf_cmd_t cmd);
796 int vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio);
797 int vop_print(struct vop_ops *ops, struct vnode *vp);
798 int vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
799                 register_t *retval);
800 int vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
801                 struct flock *fl, int flags);
802 int vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
803                 int size, struct ucred *cred, int flags,
804                 struct buf **bpp);
805 int vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
806                 struct cluster_save *buflist);
807 int vop_getpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
808                 int count, int reqpage, vm_ooffset_t offset, int seqaccess);
809 int vop_putpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
810                 int count, int sync, int *rtvals, vm_ooffset_t offset);
811 int vop_freeblks(struct vop_ops *ops, struct vnode *vp,
812                 off_t offset, int length);
813 int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
814                 struct acl *aclp, struct ucred *cred);
815 int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
816                 struct acl *aclp, struct ucred *cred);
817 int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
818                 struct acl *aclp, struct ucred *cred);
819
820 int vop_getextattr(struct vop_ops *ops, struct vnode *vp, int attrnamespace,
821                 char *attrname, struct uio *uio, struct ucred *cred);
822 int vop_setextattr(struct vop_ops *ops, struct vnode *vp, int attrnamespace,
823                 char *attrname, struct uio *uio, struct ucred *cred);
824 int vop_mountctl(struct vop_ops *ops, struct vnode *vp, int op,
825                 struct file *fp, const void *ctl, int ctllen,
826                 void *buf, int buflen, int *res);
827 int vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred);
828 int vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
829                 struct vnode *dvp, struct ucred *cred);
830 int vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
831                 struct vnode **vpp, struct ucred *cred, char **fakename);
832 int vop_ncreate(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
833                 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
834 int vop_nmkdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
835                 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
836 int vop_nmknod(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
837                 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
838 int vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
839                 struct vnode *vp, struct ucred *cred);
840 int vop_nsymlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
841                 struct vnode **vpp, struct ucred *cred,
842                 struct vattr *vap, char *target);
843 int vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
844                 struct ucred *cred, int flags);
845 int vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
846                 struct ucred *cred);
847 int vop_nrmdir(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
848                 struct ucred *cred);
849 int vop_nrename(struct vop_ops *ops,
850                 struct nchandle *fnch, struct nchandle *tnch,
851                 struct vnode *fdvp, struct vnode *tdvp,
852                 struct ucred *cred);
853
854 /*
855  * Kernel VOP forwarding wrappers.  These are called when a VFS such as
856  * nullfs needs to push down into another VFS, changing the 
857  * a_ops pointer and consequentially necessitating additional 
858  * cache management.
859  *
860  * Note that this is different from vop_ops chaining within the same
861  * filesystem.  When a filesystem chains a vop_ops it just uses VOCALLs.
862  */
863 int vop_vnoperate_ap(struct vop_generic_args *ap);
864 int vop_cache_operate_ap(struct vop_generic_args *ap);
865 int vop_journal_operate_ap(struct vop_generic_args *ap);
866 int vop_old_lookup_ap(struct vop_old_lookup_args *ap);
867 int vop_old_create_ap(struct vop_old_create_args *ap);
868 int vop_old_whiteout_ap(struct vop_old_whiteout_args *ap);
869 int vop_old_mknod_ap(struct vop_old_mknod_args *ap);
870 int vop_open_ap(struct vop_open_args *ap);
871 int vop_close_ap(struct vop_close_args *ap);
872 int vop_access_ap(struct vop_access_args *ap);
873 int vop_getattr_ap(struct vop_getattr_args *ap);
874 int vop_setattr_ap(struct vop_setattr_args *ap);
875 int vop_read_ap(struct vop_read_args *ap);
876 int vop_write_ap(struct vop_write_args *ap);
877 int vop_ioctl_ap(struct vop_ioctl_args *ap);
878 int vop_poll_ap(struct vop_poll_args *ap);
879 int vop_kqfilter_ap(struct vop_kqfilter_args *ap);
880 int vop_mmap_ap(struct vop_mmap_args *ap);
881 int vop_fsync_ap(struct vop_fsync_args *ap);
882 int vop_old_remove_ap(struct vop_old_remove_args *ap);
883 int vop_old_link_ap(struct vop_old_link_args *ap);
884 int vop_old_rename_ap(struct vop_old_rename_args *ap);
885 int vop_old_mkdir_ap(struct vop_old_mkdir_args *ap);
886 int vop_old_rmdir_ap(struct vop_old_rmdir_args *ap);
887 int vop_old_symlink_ap(struct vop_old_symlink_args *ap);
888 int vop_readdir_ap(struct vop_readdir_args *ap);
889 int vop_readlink_ap(struct vop_readlink_args *ap);
890 int vop_inactive_ap(struct vop_inactive_args *ap);
891 int vop_reclaim_ap(struct vop_reclaim_args *ap);
892 int vop_bmap_ap(struct vop_bmap_args *ap);
893 int vop_strategy_ap(struct vop_strategy_args *ap);
894 int vop_print_ap(struct vop_print_args *ap);
895 int vop_pathconf_ap(struct vop_pathconf_args *ap);
896 int vop_advlock_ap(struct vop_advlock_args *ap);
897 int vop_balloc_ap(struct vop_balloc_args *ap);
898 int vop_reallocblks_ap(struct vop_reallocblks_args *ap);
899 int vop_getpages_ap(struct vop_getpages_args *ap);
900 int vop_putpages_ap(struct vop_putpages_args *ap);
901 int vop_freeblks_ap(struct vop_freeblks_args *ap);
902 int vop_getacl_ap(struct vop_getacl_args *ap);
903 int vop_setacl_ap(struct vop_setacl_args *ap);
904 int vop_aclcheck_ap(struct vop_aclcheck_args *ap);
905 int vop_getextattr_ap(struct vop_getextattr_args *ap);
906 int vop_setextattr_ap(struct vop_setextattr_args *ap);
907 int vop_mountctl_ap(struct vop_mountctl_args *ap);
908 int vop_markatime_ap(struct vop_markatime_args *ap);
909
910 int vop_nresolve_ap(struct vop_nresolve_args *ap);
911 int vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap);
912 int vop_ncreate_ap(struct vop_ncreate_args *ap);
913 int vop_nmkdir_ap(struct vop_nmkdir_args *ap);
914 int vop_nmknod_ap(struct vop_nmknod_args *ap);
915 int vop_nlink_ap(struct vop_nlink_args *ap);
916 int vop_nsymlink_ap(struct vop_nsymlink_args *ap);
917 int vop_nwhiteout_ap(struct vop_nwhiteout_args *ap);
918 int vop_nremove_ap(struct vop_nremove_args *ap);
919 int vop_nrmdir_ap(struct vop_nrmdir_args *ap);
920 int vop_nrename_ap(struct vop_nrename_args *ap);
921
922 /*
923  * VOP operations descriptor.  This is used by the vop_ops compiler
924  * to convert VFS vector arrays (typically in vfs/blah/blah_vnops.c)
925  * into a vop_ops operations vector.
926  */
927 extern struct syslink_desc vop_default_desc;
928 extern struct syslink_desc vop_old_lookup_desc;
929 extern struct syslink_desc vop_old_create_desc;
930 extern struct syslink_desc vop_old_whiteout_desc;
931 extern struct syslink_desc vop_old_mknod_desc;
932 extern struct syslink_desc vop_open_desc;
933 extern struct syslink_desc vop_close_desc;
934 extern struct syslink_desc vop_access_desc;
935 extern struct syslink_desc vop_getattr_desc;
936 extern struct syslink_desc vop_setattr_desc;
937 extern struct syslink_desc vop_read_desc;
938 extern struct syslink_desc vop_write_desc;
939 extern struct syslink_desc vop_ioctl_desc;
940 extern struct syslink_desc vop_poll_desc;
941 extern struct syslink_desc vop_kqfilter_desc;
942 extern struct syslink_desc vop_mmap_desc;
943 extern struct syslink_desc vop_fsync_desc;
944 extern struct syslink_desc vop_old_remove_desc;
945 extern struct syslink_desc vop_old_link_desc;
946 extern struct syslink_desc vop_old_rename_desc;
947 extern struct syslink_desc vop_old_mkdir_desc;
948 extern struct syslink_desc vop_old_rmdir_desc;
949 extern struct syslink_desc vop_old_symlink_desc;
950 extern struct syslink_desc vop_readdir_desc;
951 extern struct syslink_desc vop_readlink_desc;
952 extern struct syslink_desc vop_inactive_desc;
953 extern struct syslink_desc vop_reclaim_desc;
954 extern struct syslink_desc vop_bmap_desc;
955 extern struct syslink_desc vop_strategy_desc;
956 extern struct syslink_desc vop_print_desc;
957 extern struct syslink_desc vop_pathconf_desc;
958 extern struct syslink_desc vop_advlock_desc;
959 extern struct syslink_desc vop_balloc_desc;
960 extern struct syslink_desc vop_reallocblks_desc;
961 extern struct syslink_desc vop_getpages_desc;
962 extern struct syslink_desc vop_putpages_desc;
963 extern struct syslink_desc vop_freeblks_desc;
964 extern struct syslink_desc vop_getacl_desc;
965 extern struct syslink_desc vop_setacl_desc;
966 extern struct syslink_desc vop_aclcheck_desc;
967 extern struct syslink_desc vop_getextattr_desc;
968 extern struct syslink_desc vop_setextattr_desc;
969 extern struct syslink_desc vop_mountctl_desc;
970 extern struct syslink_desc vop_markatime_desc;
971
972 extern struct syslink_desc vop_nresolve_desc;
973 extern struct syslink_desc vop_nlookupdotdot_desc;
974 extern struct syslink_desc vop_ncreate_desc;
975 extern struct syslink_desc vop_nmkdir_desc;
976 extern struct syslink_desc vop_nmknod_desc;
977 extern struct syslink_desc vop_nlink_desc;
978 extern struct syslink_desc vop_nsymlink_desc;
979 extern struct syslink_desc vop_nwhiteout_desc;
980 extern struct syslink_desc vop_nremove_desc;
981 extern struct syslink_desc vop_nrmdir_desc;
982 extern struct syslink_desc vop_nrename_desc;
983
984 #endif
985
986 /*
987  * VOP_*() convenience macros extract the operations vector and make the
988  * vop_*() call.
989  */
990 #define VOP_OPEN(vp, mode, cred, fp)                    \
991         vop_open(*(vp)->v_ops, vp, mode, cred, fp)
992 #define VOP_CLOSE(vp, fflag, fp)                        \
993         vop_close(*(vp)->v_ops, vp, fflag, fp)
994 #define VOP_ACCESS(vp, mode, cred)                      \
995         vop_access(*(vp)->v_ops, vp, mode, 0, cred)
996 #define VOP_EACCESS(vp, mode, cred)                     \
997         vop_access(*(vp)->v_ops, vp, mode, AT_EACCESS, cred)
998 #define VOP_ACCESS_FLAGS(vp, mode, flags, cred)         \
999         vop_access(*(vp)->v_ops, vp, mode, flags, cred)
1000 #define VOP_GETATTR_FP(vp, vap, fp)                     \
1001         vop_getattr(*(vp)->v_ops, vp, vap, fp) /* FUSE */
1002 #define VOP_GETATTR(vp, vap)                            \
1003         VOP_GETATTR_FP(vp, vap, NULL)
1004 #define VOP_SETATTR_FP(vp, vap, cred, fp)               \
1005         vop_setattr(*(vp)->v_ops, vp, vap, cred, fp) /* FUSE */
1006 #define VOP_SETATTR(vp, vap, cred)                      \
1007         VOP_SETATTR_FP(vp, vap, cred, NULL)
1008 #define VOP_READ_FP(vp, uio, ioflag, cred, fp)          \
1009         vop_read(*(vp)->v_ops, vp, uio, ioflag, cred, fp) /* FUSE */
1010 #define VOP_READ(vp, uio, ioflag, cred)                 \
1011         VOP_READ_FP(vp, uio, ioflag, cred, NULL)
1012 #define VOP_WRITE_FP(vp, uio, ioflag, cred, fp)         \
1013         vop_write(*(vp)->v_ops, vp, uio, ioflag, cred, fp) /* FUSE */
1014 #define VOP_WRITE(vp, uio, ioflag, cred)                \
1015         VOP_WRITE_FP(vp, uio, ioflag, cred, NULL)
1016 #define VOP_IOCTL(vp, command, data, fflag, cred, msg)  \
1017         vop_ioctl(*(vp)->v_ops, vp, command, data, fflag, cred, msg)
1018 #define VOP_POLL(vp, events, cred)                      \
1019         vop_poll(*(vp)->v_ops, vp, events, cred)
1020 #define VOP_KQFILTER(vp, kn)                            \
1021         vop_kqfilter(*(vp)->v_ops, vp, kn)
1022 #define VOP_MMAP(vp, fflags, cred)                      \
1023         vop_mmap(*(vp)->v_ops, vp, fflags, cred)
1024 #define VOP_FSYNC_FP(vp, waitfor, flags, fp)            \
1025         vop_fsync(*(vp)->v_ops, vp, waitfor, flags, fp) /* FUSE*/
1026 #define VOP_FSYNC(vp, waitfor, flags)                   \
1027         VOP_FSYNC_FP(vp, waitfor, flags, NULL)
1028 #define VOP_READDIR_FP(vp, uio, cred, eofflag, ncookies, cookies, fp)   \
1029         vop_readdir(*(vp)->v_ops, vp, uio, cred, eofflag, ncookies, cookies, fp) /* FUSE */
1030 #define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies)          \
1031         VOP_READDIR_FP(vp, uio, cred, eofflag, ncookies, cookies, NULL)
1032 #define VOP_READLINK(vp, uio, cred)                     \
1033         vop_readlink(*(vp)->v_ops, vp, uio, cred)
1034 #define VOP_INACTIVE(vp)                                \
1035         vop_inactive(*(vp)->v_ops, vp)
1036 #define VOP_RECLAIM(vp)                                 \
1037         vop_reclaim(*(vp)->v_ops, vp)
1038 #define VOP_BMAP(vp, loff, doffp, runp, runb, cmd)      \
1039         vop_bmap(*(vp)->v_ops, vp, loff, doffp, runp, runb, cmd)
1040 #define VOP_PRINT(vp)                                   \
1041         vop_print(*(vp)->v_ops, vp)
1042 #define VOP_PATHCONF(vp, name, retval)                  \
1043         vop_pathconf(*(vp)->v_ops, vp, name, retval)
1044 #define VOP_ADVLOCK(vp, id, op, fl, flags)              \
1045         vop_advlock(*(vp)->v_ops, vp, id, op, fl, flags)
1046 #define VOP_BALLOC(vp, offset, size, cred, flags, bpp)  \
1047         vop_balloc(*(vp)->v_ops, vp, offset, size, cred, flags, bpp)
1048 #define VOP_REALLOCBLKS(vp, buflist)                    \
1049         vop_reallocblks(*(vp)->v_ops, vp, buflist)
1050 #define VOP_GETPAGES(vp, m, count, reqpage, off, seqaccess)             \
1051         vop_getpages(*(vp)->v_ops, vp, m, count, reqpage, off, seqaccess)
1052 #define VOP_PUTPAGES(vp, m, count, sync, rtvals, off)   \
1053         vop_putpages(*(vp)->v_ops, vp, m, count, sync, rtvals, off)
1054 #define VOP_FREEBLKS(vp, offset, length)                \
1055         vop_freeblks(*(vp)->v_ops, vp, offset, length)
1056 #define VOP_GETACL(vp, type, aclp, cred)                \
1057         vop_getacl(*(vp)->v_ops, vp, type, aclp, cred)
1058 #define VOP_SETACL(vp, type, aclp, cred)                \
1059         vop_setacl(*(vp)->v_ops, vp, type, aclp, cred)
1060 #define VOP_ACLCHECK(vp, type, aclp, cred)              \
1061         vop_aclcheck(*(vp)->v_ops, vp, type, aclp, cred)
1062 #define VOP_GETEXTATTR(vp, attrnamespace, attrname, uio, cred) \
1063         vop_getextattr(*(vp)->v_ops, vp, attrnamespace, attrname, uio, cred)
1064 #define VOP_SETEXTATTR(vp, attrnamespace, attrname, uio, cred)  \
1065         vop_setextattr(*(vp)->v_ops, vp, attrnamespace, attrname, uio, cred)
1066 #define VOP_MARKATIME(vp, cred)                 \
1067         vop_markatime(*(vp)->v_ops, vp, cred)
1068 /* no VOP_VFSSET() */
1069 /* VOP_STRATEGY - does not exist, use vn_strategy() */
1070
1071 /*
1072  * 'OLD' VOP calls.  These calls may only be made by the new API
1073  * compatibility functions in kern/vfs_default.c.  Attempting to
1074  * call these functions directly will confuse the namecache.  These
1075  * calls are deprecated and being removed from the system and from
1076  * the VFS's.
1077  */
1078 #define VOP_OLD_LOOKUP(dvp, vpp, cnp)                   \
1079         vop_old_lookup(*(dvp)->v_ops, dvp, vpp, cnp)
1080 #define VOP_OLD_CREATE(dvp, vpp, cnp, vap)              \
1081         vop_old_create(*(dvp)->v_ops, dvp, vpp, cnp, vap)
1082 #define VOP_OLD_MKDIR(dvp, vpp, cnp, vap)               \
1083         vop_old_mkdir(*(dvp)->v_ops, dvp, vpp, cnp, vap)
1084 #define VOP_OLD_MKNOD(dvp, vpp, cnp, vap)               \
1085         vop_old_mknod(*(dvp)->v_ops, dvp, vpp, cnp, vap)
1086 #define VOP_OLD_LINK(tdvp, vp, cnp)                     \
1087         vop_old_link(*(tdvp)->v_ops, tdvp, vp, cnp)
1088 #define VOP_OLD_SYMLINK(dvp, vpp, cnp, vap, target)     \
1089         vop_old_symlink(*(dvp)->v_ops, dvp, vpp, cnp, vap, target)
1090 #define VOP_OLD_WHITEOUT(dvp, cnp, flags)               \
1091         vop_old_whiteout(*(dvp)->v_ops, dvp, cnp, flags)
1092 #define VOP_OLD_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp) \
1093         vop_old_rename(*(fdvp)->v_ops, fdvp, fvp, fcnp, tdvp, tvp, tcnp)
1094 #define VOP_OLD_RMDIR(dvp, vp, cnp)                     \
1095         vop_old_rmdir(*(dvp)->v_ops, dvp, vp, cnp)
1096 #define VOP_OLD_REMOVE(dvp, vp, cnp)                    \
1097         vop_old_remove(*(dvp)->v_ops, dvp, vp, cnp)
1098
1099 /*
1100  * 'NEW' VOP calls.  These calls use namespaces as an operational basis
1101  * rather then vnodes and replace the OLD calls.   Eventually all VFS's
1102  * will support these calls.  Those that do not fall through to compatibility
1103  * code in kern/vfs_default which does the magic required to call the old
1104  * routines.
1105  */
1106 #define VOP_NRESOLVE(nch, dvp, cred)                    \
1107         vop_nresolve((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
1108 #define VOP_NLOOKUPDOTDOT(dvp, vpp, cred, fakename)     \
1109         vop_nlookupdotdot(*(dvp)->v_ops, dvp, vpp, cred, fakename)
1110 #define VOP_NCREATE(nch, dvp, vpp, cred, vap)           \
1111         vop_ncreate((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1112 #define VOP_NMKDIR(nch, dvp, vpp, cred, vap)            \
1113         vop_nmkdir((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1114 #define VOP_NMKNOD(nch, dvp, vpp, cred, vap)            \
1115         vop_nmknod((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap)
1116 #define VOP_NLINK(nch, dvp, vp, cred)                   \
1117         vop_nlink((nch)->mount->mnt_vn_use_ops, nch, dvp, vp, cred)
1118 #define VOP_NSYMLINK(nch, dvp, vpp, cred, vap, target)  \
1119         vop_nsymlink((nch)->mount->mnt_vn_use_ops, nch, dvp, vpp, cred, vap, target)
1120 #define VOP_NWHITEOUT(nch, dvp, cred, flags)            \
1121         vop_nwhiteout((nch)->mount->mnt_vn_use_ops, nch, dvp, cred, flags)
1122 #define VOP_NRENAME(fnch, tnch, fdvp, tdvp, cred)               \
1123         vop_nrename((fnch)->mount->mnt_vn_use_ops, fnch, tnch, fdvp, tdvp, cred)
1124 #define VOP_NRMDIR(nch, dvp, cred)                      \
1125         vop_nrmdir((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
1126 #define VOP_NREMOVE(nch, dvp, cred)                     \
1127         vop_nremove((nch)->mount->mnt_vn_use_ops, nch, dvp, cred)
1128
1129 #endif
1130