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