2 * Copyright (c) 2004 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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
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.
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
34 * $DragonFly: src/sys/sys/vfsops.h,v 1.3 2004/08/25 19:14:40 dillon Exp $
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".
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
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).
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.
65 #ifndef _SYS_VFSOPS_H_
66 #define _SYS_VFSOPS_H_
84 struct vop_generic_args {
85 struct vnodeop_desc *a_desc; /* command descriptor for the call */
86 struct vop_ops *a_ops; /* operations vector for the call */
90 struct vop_islocked_args {
91 struct vop_generic_args a_head;
96 struct vop_lookup_args {
97 struct vop_generic_args a_head;
99 struct namecache *a_par;
100 struct vnode **a_vpp;
101 struct namecache **a_ncpp;
102 struct componentname *a_cnp;
105 struct vop_cachedlookup_args {
106 struct vop_generic_args a_head;
108 struct namecache *a_par;
109 struct vnode **a_vpp;
110 struct namecache **a_ncpp;
111 struct componentname *a_cnp;
114 struct vop_create_args {
115 struct vop_generic_args a_head;
117 struct namecache *a_par;
118 struct vnode **a_vpp;
119 struct componentname *a_cnp;
123 struct vop_whiteout_args {
124 struct vop_generic_args a_head;
126 struct namecache *a_par;
127 struct componentname *a_cnp;
131 struct vop_mknod_args {
132 struct vop_generic_args a_head;
134 struct namecache *a_par;
135 struct vnode **a_vpp;
136 struct componentname *a_cnp;
140 struct vop_open_args {
141 struct vop_generic_args a_head;
144 struct ucred *a_cred;
148 struct vop_close_args {
149 struct vop_generic_args a_head;
155 struct vop_access_args {
156 struct vop_generic_args a_head;
159 struct ucred *a_cred;
163 struct vop_getattr_args {
164 struct vop_generic_args a_head;
170 struct vop_setattr_args {
171 struct vop_generic_args a_head;
174 struct ucred *a_cred;
178 struct vop_read_args {
179 struct vop_generic_args a_head;
183 struct ucred *a_cred;
186 struct vop_write_args {
187 struct vop_generic_args a_head;
191 struct ucred *a_cred;
194 struct vop_lease_args {
195 struct vop_generic_args a_head;
198 struct ucred *a_cred;
202 struct vop_ioctl_args {
203 struct vop_generic_args a_head;
208 struct ucred *a_cred;
212 struct vop_poll_args {
213 struct vop_generic_args a_head;
216 struct ucred *a_cred;
220 struct vop_kqfilter_args {
221 struct vop_generic_args a_head;
226 struct vop_revoke_args {
227 struct vop_generic_args a_head;
232 struct vop_mmap_args {
233 struct vop_generic_args a_head;
236 struct ucred *a_cred;
240 struct vop_fsync_args {
241 struct vop_generic_args a_head;
247 struct vop_remove_args {
248 struct vop_generic_args a_head;
250 struct namecache *a_par;
252 struct componentname *a_cnp;
255 struct vop_link_args {
256 struct vop_generic_args a_head;
257 struct vnode *a_tdvp;
258 struct namecache *a_par;
260 struct componentname *a_cnp;
263 struct vop_rename_args {
264 struct vop_generic_args a_head;
265 struct vnode *a_fdvp;
266 struct namecache *a_fpar;
268 struct componentname *a_fcnp;
269 struct vnode *a_tdvp;
270 struct namecache *a_tpar;
272 struct componentname *a_tcnp;
275 struct vop_mkdir_args {
276 struct vop_generic_args a_head;
278 struct namecache *a_par;
279 struct vnode **a_vpp;
280 struct componentname *a_cnp;
284 struct vop_rmdir_args {
285 struct vop_generic_args a_head;
287 struct namecache *a_par;
289 struct componentname *a_cnp;
292 struct vop_symlink_args {
293 struct vop_generic_args a_head;
295 struct namecache *a_par;
296 struct vnode **a_vpp;
297 struct componentname *a_cnp;
302 struct vop_readdir_args {
303 struct vop_generic_args a_head;
306 struct ucred *a_cred;
312 struct vop_readlink_args {
313 struct vop_generic_args a_head;
316 struct ucred *a_cred;
319 struct vop_inactive_args {
320 struct vop_generic_args a_head;
325 struct vop_reclaim_args {
326 struct vop_generic_args a_head;
331 struct vop_lock_args {
332 struct vop_generic_args a_head;
334 struct lwkt_tokref *a_vlock;
339 struct vop_unlock_args {
340 struct vop_generic_args a_head;
342 struct lwkt_tokref *a_vlock;
347 struct vop_bmap_args {
348 struct vop_generic_args a_head;
351 struct vnode **a_vpp;
357 struct vop_strategy_args {
358 struct vop_generic_args a_head;
363 struct vop_print_args {
364 struct vop_generic_args a_head;
368 struct vop_pathconf_args {
369 struct vop_generic_args a_head;
372 register_t *a_retval;
375 struct vop_advlock_args {
376 struct vop_generic_args a_head;
384 struct vop_balloc_args {
385 struct vop_generic_args a_head;
389 struct ucred *a_cred;
394 struct vop_reallocblks_args {
395 struct vop_generic_args a_head;
397 struct cluster_save *a_buflist;
400 struct vop_getpages_args {
401 struct vop_generic_args a_head;
403 struct vm_page **a_m;
406 vm_ooffset_t a_offset;
409 struct vop_putpages_args {
410 struct vop_generic_args a_head;
412 struct vm_page **a_m;
416 vm_ooffset_t a_offset;
419 struct vop_freeblks_args {
420 struct vop_generic_args a_head;
426 struct vop_bwrite_args {
427 struct vop_generic_args a_head;
432 struct vop_getacl_args {
433 struct vop_generic_args a_head;
437 struct ucred *a_cred;
441 struct vop_setacl_args {
442 struct vop_generic_args a_head;
446 struct ucred *a_cred;
450 struct vop_aclcheck_args {
451 struct vop_generic_args a_head;
455 struct ucred *a_cred;
459 struct vop_getextattr_args {
460 struct vop_generic_args a_head;
464 struct ucred *a_cred;
468 struct vop_setextattr_args {
469 struct vop_generic_args a_head;
473 struct ucred *a_cred;
477 struct vop_createvobject_args {
478 struct vop_generic_args a_head;
483 struct vop_destroyvobject_args {
484 struct vop_generic_args a_head;
488 struct vop_getvobject_args {
489 struct vop_generic_args a_head;
491 struct vm_object **a_objpp;
494 struct vop_vfsset_args {
495 struct vop_generic_args a_head;
501 * This structure is the post-compiled VOP operations vector. vop_ops are
502 * typically per-mount entities. The first section is used by our vop_*()
503 * function wrappers to implement hooks for per-mount management functions
504 * such as journaling and cache coherency protocols. The second section is
505 * the function dispatch for the VFSs. The functions are supposed to run
506 * in the context of the VFS's thread (if it has one) and should not be
507 * directly called from random kernel code. Note that VOCALL()s are direct
508 * calls used for chaining vop_ops structures from a VFS context.
511 struct vop_ops *vv_new; /* vfs_recalc_vnodeops() only */
512 struct mount *vv_mount; /* may be NULL */
514 int vv_flags; /* see VVF_* flags below */
516 struct vop_ops *vv_jops; /* VVF_JOURNAL_HOOK */
517 struct vop_ops *vv_cops; /* VVF_CCOHERENCY_HOOK */
519 /* XXX Journaling control */
520 /* XXX Cache Coherency functions (local/remote/clustered) */
522 int vv_reserved[62]; /* (temporary) reduce recompile pain */
524 #define vop_ops_first_field vop_default
525 int (*vop_default)(struct vop_generic_args *);
526 int (*vop_islocked)(struct vop_islocked_args *);
527 int (*vop_lookup)(struct vop_lookup_args *);
528 int (*vop_cachedlookup)(struct vop_cachedlookup_args *);
529 int (*vop_create)(struct vop_create_args *);
530 int (*vop_whiteout)(struct vop_whiteout_args *);
531 int (*vop_mknod)(struct vop_mknod_args *);
532 int (*vop_open)(struct vop_open_args *);
533 int (*vop_close)(struct vop_close_args *);
534 int (*vop_access)(struct vop_access_args *);
535 int (*vop_getattr)(struct vop_getattr_args *);
536 int (*vop_setattr)(struct vop_setattr_args *);
537 int (*vop_read)(struct vop_read_args *);
538 int (*vop_write)(struct vop_write_args *);
539 int (*vop_lease)(struct vop_lease_args *);
540 int (*vop_ioctl)(struct vop_ioctl_args *);
541 int (*vop_poll)(struct vop_poll_args *);
542 int (*vop_kqfilter)(struct vop_kqfilter_args *);
543 int (*vop_revoke)(struct vop_revoke_args *);
544 int (*vop_mmap)(struct vop_mmap_args *);
545 int (*vop_fsync)(struct vop_fsync_args *);
546 int (*vop_remove)(struct vop_remove_args *);
547 int (*vop_link)(struct vop_link_args *);
548 int (*vop_rename)(struct vop_rename_args *);
549 int (*vop_mkdir)(struct vop_mkdir_args *);
550 int (*vop_rmdir)(struct vop_rmdir_args *);
551 int (*vop_symlink)(struct vop_symlink_args *);
552 int (*vop_readdir)(struct vop_readdir_args *);
553 int (*vop_readlink)(struct vop_readlink_args *);
554 int (*vop_inactive)(struct vop_inactive_args *);
555 int (*vop_reclaim)(struct vop_reclaim_args *);
556 int (*vop_lock)(struct vop_lock_args *);
557 int (*vop_unlock)(struct vop_unlock_args *);
558 int (*vop_bmap)(struct vop_bmap_args *);
559 int (*vop_strategy)(struct vop_strategy_args *);
560 int (*vop_print)(struct vop_print_args *);
561 int (*vop_pathconf)(struct vop_pathconf_args *);
562 int (*vop_advlock)(struct vop_advlock_args *);
563 int (*vop_balloc)(struct vop_balloc_args *);
564 int (*vop_reallocblks)(struct vop_reallocblks_args *);
565 int (*vop_getpages)(struct vop_getpages_args *);
566 int (*vop_putpages)(struct vop_putpages_args *);
567 int (*vop_freeblks)(struct vop_freeblks_args *);
568 int (*vop_bwrite)(struct vop_bwrite_args *);
569 int (*vop_getacl)(struct vop_getacl_args *);
570 int (*vop_setacl)(struct vop_setacl_args *);
571 int (*vop_aclcheck)(struct vop_aclcheck_args *);
572 int (*vop_getextattr)(struct vop_getextattr_args *);
573 int (*vop_setextattr)(struct vop_setextattr_args *);
574 int (*vop_createvobject)(struct vop_createvobject_args *);
575 int (*vop_destroyvobject)(struct vop_destroyvobject_args *);
576 int (*vop_getvobject)(struct vop_getvobject_args *);
577 int (*vop_vfsset)(struct vop_vfsset_args *);
578 #define vop_ops_last_field vop_vfsset
581 #define VVF_JOURNAL_HOOK 0x0001 /* FUTURE */
582 #define VVF_CCOHERENCY_HOOK 0x0002 /* FUTURE */
583 #define VVF_UNUSED_04 0x0004
584 #define VVF_UNUSED_08 0x0008
585 #define VVF_NOATIME 0x0010 /* FUTURE */
586 #define VVF_RDONLY 0x0020 /* FUTURE */
587 #define VVF_NOCLUSTER 0x0040 /* FUTURE */
588 #define VVF_SUIDDIR 0x0080 /* FUTURE */
590 #define VVF_HOOK_MASK (VVF_JOURNAL_HOOK|VVF_CCOHERENCY_HOOK)
593 * vop_vfsset() operations
595 #define VFSSET_DETACH 0
596 #define VFSSET_ATTACH 1
599 * Kernel VOP arguments union, suitable for malloc / embedding in other
600 * structures. The vop_args_union can hold any VOP call argument structure.
601 * Note that vu_head is broken out.
603 union vop_args_union {
604 struct vop_generic_args vu_head;
605 struct vop_generic_args vu_default;
606 struct vop_islocked_args vu_islocked;
607 struct vop_lookup_args vu_lookup;
608 struct vop_cachedlookup_args vu_cachedlookup;
609 struct vop_create_args vu_create;
610 struct vop_whiteout_args vu_whiteout;
611 struct vop_mknod_args vu_mknod;
612 struct vop_open_args vu_open;
613 struct vop_close_args vu_close;
614 struct vop_access_args vu_access;
615 struct vop_getattr_args vu_getattr;
616 struct vop_setattr_args vu_setattr;
617 struct vop_read_args vu_read;
618 struct vop_write_args vu_write;
619 struct vop_lease_args vu_lease;
620 struct vop_ioctl_args vu_ioctl;
621 struct vop_poll_args vu_poll;
622 struct vop_kqfilter_args vu_kqfilter;
623 struct vop_revoke_args vu_revoke;
624 struct vop_mmap_args vu_mmap;
625 struct vop_fsync_args vu_fsync;
626 struct vop_remove_args vu_remove;
627 struct vop_link_args vu_link;
628 struct vop_rename_args vu_rename;
629 struct vop_mkdir_args vu_mkdir;
630 struct vop_rmdir_args vu_rmdir;
631 struct vop_symlink_args vu_symlink;
632 struct vop_readdir_args vu_readdir;
633 struct vop_readlink_args vu_readlink;
634 struct vop_inactive_args vu_inactive;
635 struct vop_reclaim_args vu_reclaim;
636 struct vop_lock_args vu_lock;
637 struct vop_unlock_args vu_unlock;
638 struct vop_bmap_args vu_bmap;
639 struct vop_strategy_args vu_strategy;
640 struct vop_print_args vu_print;
641 struct vop_pathconf_args vu_pathconf;
642 struct vop_advlock_args vu_advlock;
643 struct vop_balloc_args vu_balloc;
644 struct vop_reallocblks_args vu_reallocblks;
645 struct vop_getpages_args vu_getpages;
646 struct vop_putpages_args vu_putpages;
647 struct vop_freeblks_args vu_freeblks;
648 struct vop_bwrite_args vu_bwrite;
649 struct vop_getacl_args vu_getacl;
650 struct vop_setacl_args vu_setacl;
651 struct vop_aclcheck_args vu_aclcheck;
652 struct vop_getextattr_args vu_getextattr;
653 struct vop_setextattr_args vu_setextattr;
654 struct vop_createvobject_args vu_createvobject;
655 struct vop_destroyvobject_args vu_destroyvobject;
656 struct vop_getvobject_args vu_getvobject;
657 struct vop_vfsset_args vu_vfsset;
663 * Kernel VOP call wrappers. These wrappers are responsible for wrapping
664 * the arguments in the appropriate VOP arguments structure, sending the
665 * message, and waiting for a reply. All kernel and VFS code should generally
666 * call these wrappers rather then attempt to call the operations vector
667 * routine directly in order to allow DragonFly to properly wrap the operation
668 * in a message and dispatch it to the correct thread.
670 int vop_islocked(struct vop_ops *ops, struct vnode *vp, struct thread *td);
671 int vop_lookup(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
672 struct vnode **vpp, struct namecache **ncpp,
673 struct componentname *cnp);
674 int vop_cachedlookup(struct vop_ops *ops, struct vnode *dvp,
675 struct namecache *par, struct vnode **vpp,
676 struct namecache **ncpp, struct componentname *cnp);
677 int vop_create(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
678 struct vnode **vpp, struct componentname *cnp,
680 int vop_whiteout(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
681 struct componentname *cnp, int flags);
682 int vop_mknod(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
683 struct vnode **vpp, struct componentname *cnp,
685 int vop_open(struct vop_ops *ops, struct vnode *vp, int mode,
686 struct ucred *cred, struct thread *td);
687 int vop_close(struct vop_ops *ops, struct vnode *vp,
688 int fflag, struct thread *td);
689 int vop_access(struct vop_ops *ops, struct vnode *vp, int mode,
690 struct ucred *cred, struct thread *td);
691 int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
693 int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
694 struct ucred *cred, struct thread *td);
695 int vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
696 int ioflag, struct ucred *cred);
697 int vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
698 int ioflag, struct ucred *cred);
699 int vop_lease(struct vop_ops *ops, struct vnode *vp, struct thread *td,
700 struct ucred *cred, int flag);
701 int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command,
702 caddr_t data, int fflag,
703 struct ucred *cred, struct thread *td);
704 int vop_poll(struct vop_ops *ops, struct vnode *vp, int events,
705 struct ucred *cred, struct thread *td);
706 int vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn);
707 int vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags);
708 int vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags,
709 struct ucred *cred, struct thread *td);
710 int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor,
712 int vop_remove(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
713 struct vnode *vp, struct componentname *cnp);
714 int vop_link(struct vop_ops *ops, struct vnode *tdvp, struct namecache *par,
715 struct vnode *vp, struct componentname *cnp);
716 int vop_rename(struct vop_ops *ops, struct vnode *fdvp, struct namecache *fpar,
717 struct vnode *fvp, struct componentname *fcnp,
718 struct vnode *tdvp, struct namecache *tpar,
719 struct vnode *tvp, struct componentname *tcnp);
720 int vop_mkdir(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
721 struct vnode **vpp, struct componentname *cnp,
723 int vop_rmdir(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
724 struct vnode *vp, struct componentname *cnp);
725 int vop_symlink(struct vop_ops *ops, struct vnode *dvp, struct namecache *par,
726 struct vnode **vpp, struct componentname *cnp,
727 struct vattr *vap, char *target);
728 int vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
729 struct ucred *cred, int *eofflag,
730 int *ncookies, u_long **cookies);
731 int vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
733 int vop_inactive(struct vop_ops *ops, struct vnode *vp, struct thread *td);
734 int vop_reclaim(struct vop_ops *ops, struct vnode *vp, struct thread *td);
735 int vop_lock(struct vop_ops *ops, struct vnode *vp,
736 struct lwkt_tokref *vlock, int flags, struct thread *td);
737 int vop_unlock(struct vop_ops *ops, struct vnode *vp,
738 struct lwkt_tokref *vlock, int flags, struct thread *td);
739 int vop_bmap(struct vop_ops *ops, struct vnode *vp, daddr_t bn,
740 struct vnode **vpp, daddr_t *bnp, int *runp, int *runb);
741 int vop_strategy(struct vop_ops *ops, struct vnode *vp, struct buf *bp);
742 int vop_print(struct vop_ops *ops, struct vnode *vp);
743 int vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
745 int vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
746 struct flock *fl, int flags);
747 int vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
748 int size, struct ucred *cred, int flags,
750 int vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
751 struct cluster_save *buflist);
752 int vop_getpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
753 int count, int reqpage, vm_ooffset_t offset);
754 int vop_putpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
755 int count, int sync, int *rtvals, vm_ooffset_t offset);
756 int vop_freeblks(struct vop_ops *ops, struct vnode *vp,
757 daddr_t addr, daddr_t length);
758 int vop_bwrite(struct vop_ops *ops, struct vnode *vp, struct buf *bp);
759 int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
760 struct acl *aclp, struct ucred *cred, struct thread *td);
761 int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
762 struct acl *aclp, struct ucred *cred, struct thread *td);
763 int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
764 struct acl *aclp, struct ucred *cred, struct thread *td);
765 int vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
766 struct uio *uio, struct ucred *cred, struct thread *td);
767 int vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
768 struct uio *uio, struct ucred *cred, struct thread *td);
769 int vop_createvobject(struct vop_ops *ops,
770 struct vnode *vp, struct thread *td);
771 int vop_destroyvobject(struct vop_ops *ops, struct vnode *vp);
772 int vop_getvobject(struct vop_ops *ops,
773 struct vnode *vp, struct vm_object **objpp);
774 int vop_vfsset(struct vop_ops *ops, int op, const char *opstr);
777 * Kernel VOP forwarding wrappers. These are called when a VFS such as
778 * nullfs or unionfs needs to push down into another VFS, changing the
779 * a_ops pointer and consequentially necessitating additional
782 * Note that this is different from vop_ops chaining within the same
783 * filesystem. When a filesystem chains a vop_ops it just uses VOCALLs.
785 int vop_vnoperate_ap(struct vop_generic_args *ap);
786 int vop_islocked_ap(struct vop_islocked_args *ap);
787 int vop_lookup_ap(struct vop_lookup_args *ap);
788 int vop_cachedlookup_ap(struct vop_cachedlookup_args *ap);
789 int vop_create_ap(struct vop_create_args *ap);
790 int vop_whiteout_ap(struct vop_whiteout_args *ap);
791 int vop_mknod_ap(struct vop_mknod_args *ap);
792 int vop_open_ap(struct vop_open_args *ap);
793 int vop_close_ap(struct vop_close_args *ap);
794 int vop_access_ap(struct vop_access_args *ap);
795 int vop_getattr_ap(struct vop_getattr_args *ap);
796 int vop_setattr_ap(struct vop_setattr_args *ap);
797 int vop_read_ap(struct vop_read_args *ap);
798 int vop_write_ap(struct vop_write_args *ap);
799 int vop_lease_ap(struct vop_lease_args *ap);
800 int vop_ioctl_ap(struct vop_ioctl_args *ap);
801 int vop_poll_ap(struct vop_poll_args *ap);
802 int vop_kqfilter_ap(struct vop_kqfilter_args *ap);
803 int vop_revoke_ap(struct vop_revoke_args *ap);
804 int vop_mmap_ap(struct vop_mmap_args *ap);
805 int vop_fsync_ap(struct vop_fsync_args *ap);
806 int vop_remove_ap(struct vop_remove_args *ap);
807 int vop_link_ap(struct vop_link_args *ap);
808 int vop_rename_ap(struct vop_rename_args *ap);
809 int vop_mkdir_ap(struct vop_mkdir_args *ap);
810 int vop_rmdir_ap(struct vop_rmdir_args *ap);
811 int vop_symlink_ap(struct vop_symlink_args *ap);
812 int vop_readdir_ap(struct vop_readdir_args *ap);
813 int vop_readlink_ap(struct vop_readlink_args *ap);
814 int vop_inactive_ap(struct vop_inactive_args *ap);
815 int vop_reclaim_ap(struct vop_reclaim_args *ap);
816 int vop_lock_ap(struct vop_lock_args *ap);
817 int vop_unlock_ap(struct vop_unlock_args *ap);
818 int vop_bmap_ap(struct vop_bmap_args *ap);
819 int vop_strategy_ap(struct vop_strategy_args *ap);
820 int vop_print_ap(struct vop_print_args *ap);
821 int vop_pathconf_ap(struct vop_pathconf_args *ap);
822 int vop_advlock_ap(struct vop_advlock_args *ap);
823 int vop_balloc_ap(struct vop_balloc_args *ap);
824 int vop_reallocblks_ap(struct vop_reallocblks_args *ap);
825 int vop_getpages_ap(struct vop_getpages_args *ap);
826 int vop_putpages_ap(struct vop_putpages_args *ap);
827 int vop_freeblks_ap(struct vop_freeblks_args *ap);
828 int vop_bwrite_ap(struct vop_bwrite_args *ap);
829 int vop_getacl_ap(struct vop_getacl_args *ap);
830 int vop_setacl_ap(struct vop_setacl_args *ap);
831 int vop_aclcheck_ap(struct vop_aclcheck_args *ap);
832 int vop_getextattr_ap(struct vop_getextattr_args *ap);
833 int vop_setextattr_ap(struct vop_setextattr_args *ap);
834 int vop_createvobject_ap(struct vop_createvobject_args *ap);
835 int vop_destroyvobject_ap(struct vop_destroyvobject_args *ap);
836 int vop_getvobject_ap(struct vop_getvobject_args *ap);
837 int vop_vfsset_ap(struct vop_vfsset_args *ap);
840 * VOP operations descriptor. This is used by the vop_ops compiler
841 * to convert VFS vector arrays (typically in vfs/blah/blah_vnops.c)
842 * into a vop_ops operations vector.
844 extern struct vnodeop_desc vop_default_desc;
845 extern struct vnodeop_desc vop_islocked_desc;
846 extern struct vnodeop_desc vop_lookup_desc;
847 extern struct vnodeop_desc vop_cachedlookup_desc;
848 extern struct vnodeop_desc vop_create_desc;
849 extern struct vnodeop_desc vop_whiteout_desc;
850 extern struct vnodeop_desc vop_mknod_desc;
851 extern struct vnodeop_desc vop_open_desc;
852 extern struct vnodeop_desc vop_close_desc;
853 extern struct vnodeop_desc vop_access_desc;
854 extern struct vnodeop_desc vop_getattr_desc;
855 extern struct vnodeop_desc vop_setattr_desc;
856 extern struct vnodeop_desc vop_read_desc;
857 extern struct vnodeop_desc vop_write_desc;
858 extern struct vnodeop_desc vop_lease_desc;
859 extern struct vnodeop_desc vop_ioctl_desc;
860 extern struct vnodeop_desc vop_poll_desc;
861 extern struct vnodeop_desc vop_kqfilter_desc;
862 extern struct vnodeop_desc vop_revoke_desc;
863 extern struct vnodeop_desc vop_mmap_desc;
864 extern struct vnodeop_desc vop_fsync_desc;
865 extern struct vnodeop_desc vop_remove_desc;
866 extern struct vnodeop_desc vop_link_desc;
867 extern struct vnodeop_desc vop_rename_desc;
868 extern struct vnodeop_desc vop_mkdir_desc;
869 extern struct vnodeop_desc vop_rmdir_desc;
870 extern struct vnodeop_desc vop_symlink_desc;
871 extern struct vnodeop_desc vop_readdir_desc;
872 extern struct vnodeop_desc vop_readlink_desc;
873 extern struct vnodeop_desc vop_inactive_desc;
874 extern struct vnodeop_desc vop_reclaim_desc;
875 extern struct vnodeop_desc vop_lock_desc;
876 extern struct vnodeop_desc vop_unlock_desc;
877 extern struct vnodeop_desc vop_bmap_desc;
878 extern struct vnodeop_desc vop_strategy_desc;
879 extern struct vnodeop_desc vop_print_desc;
880 extern struct vnodeop_desc vop_pathconf_desc;
881 extern struct vnodeop_desc vop_advlock_desc;
882 extern struct vnodeop_desc vop_balloc_desc;
883 extern struct vnodeop_desc vop_reallocblks_desc;
884 extern struct vnodeop_desc vop_getpages_desc;
885 extern struct vnodeop_desc vop_putpages_desc;
886 extern struct vnodeop_desc vop_freeblks_desc;
887 extern struct vnodeop_desc vop_bwrite_desc;
888 extern struct vnodeop_desc vop_getacl_desc;
889 extern struct vnodeop_desc vop_setacl_desc;
890 extern struct vnodeop_desc vop_aclcheck_desc;
891 extern struct vnodeop_desc vop_getextattr_desc;
892 extern struct vnodeop_desc vop_setextattr_desc;
893 extern struct vnodeop_desc vop_createvobject_desc;
894 extern struct vnodeop_desc vop_destroyvobject_desc;
895 extern struct vnodeop_desc vop_getvobject_desc;
896 extern struct vnodeop_desc vop_vfsset_desc;
901 * VOP_ macro compatibility. Remove these as we get rid of the VOP macros.
902 * We have to convert the VOP macros into the vop_*() version that requires
903 * the appropriate v_ops structure pointer for the first arg.
905 #define VOP_ISLOCKED(vp, td) \
906 vop_islocked((vp)->v_ops, vp, td)
907 #define VOP_LOOKUP(dvp, par, vpp, ncpp, cnp) \
908 vop_lookup((dvp)->v_ops, dvp, par, vpp, ncpp, cnp)
909 #define VOP_CACHEDLOOKUP(dvp, par, vpp, ncpp, cnp) \
910 vop_cachedlookup((dvp)->v_ops, dvp, par, vpp, ncpp, cnp)
911 #define VOP_CREATE(dvp, par, vpp, cnp, vap) \
912 vop_create((dvp)->v_ops, dvp, par, vpp, cnp, vap)
913 #define VOP_WHITEOUT(dvp, par, cnp, flags) \
914 vop_whiteout((dvp)->v_ops, dvp, par, cnp, flags)
915 #define VOP_MKNOD(dvp, par, vpp, cnp, vap) \
916 vop_mknod((dvp)->v_ops, dvp, par, vpp, cnp, vap)
917 #define VOP_OPEN(vp, mode, cred, td) \
918 vop_open((vp)->v_ops, vp, mode, cred, td)
919 #define VOP_CLOSE(vp, fflag, td) \
920 vop_close((vp)->v_ops, vp, fflag, td)
921 #define VOP_ACCESS(vp, mode, cred, td) \
922 vop_access((vp)->v_ops, vp, mode, cred, td)
923 #define VOP_GETATTR(vp, vap, td) \
924 vop_getattr((vp)->v_ops, vp, vap, td)
925 #define VOP_SETATTR(vp, vap, cred, td) \
926 vop_setattr((vp)->v_ops, vp, vap, cred, td)
927 #define VOP_READ(vp, uio, ioflag, cred) \
928 vop_read((vp)->v_ops, vp, uio, ioflag, cred)
929 #define VOP_WRITE(vp, uio, ioflag, cred) \
930 vop_write((vp)->v_ops, vp, uio, ioflag, cred)
931 #define VOP_LEASE(vp, td, cred, flag) \
932 vop_lease((vp)->v_ops, vp, td, cred, flag)
933 #define VOP_IOCTL(vp, command, data, fflag, cred, td) \
934 vop_ioctl((vp)->v_ops, vp, command, data, fflag, cred, td)
935 #define VOP_POLL(vp, events, cred, td) \
936 vop_poll((vp)->v_ops, vp, events, cred, td)
937 #define VOP_KQFILTER(vp, kn) \
938 vop_kqfilter((vp)->v_ops, vp, kn)
939 #define VOP_REVOKE(vp, flags) \
940 vop_revoke((vp)->v_ops, vp, flags)
941 #define VOP_MMAP(vp, fflags, cred, td) \
942 vop_mmap((vp)->v_ops, vp, fflags, cred, td)
943 #define VOP_FSYNC(vp, waitfor, td) \
944 vop_fsync((vp)->v_ops, vp, waitfor, td)
945 #define VOP_REMOVE(dvp, par, vp, cnp) \
946 vop_remove((dvp)->v_ops, dvp, par, vp, cnp)
947 #define VOP_LINK(tdvp, par, vp, cnp) \
948 vop_link((tdvp)->v_ops, tdvp, par, vp, cnp)
949 #define VOP_RENAME(fdvp, fpar, fvp, fcnp, tdvp, tpar, tvp, tcnp) \
950 vop_rename((fdvp)->v_ops, fdvp, fpar, fvp, fcnp, tdvp, tpar, tvp, tcnp)
951 #define VOP_MKDIR(dvp, par, vpp, cnp, vap) \
952 vop_mkdir((dvp)->v_ops, dvp, par, vpp, cnp, vap)
953 #define VOP_RMDIR(dvp, par, vp, cnp) \
954 vop_rmdir((dvp)->v_ops, dvp, par, vp, cnp)
955 #define VOP_SYMLINK(dvp, par, vpp, cnp, vap, target) \
956 vop_symlink((dvp)->v_ops, dvp, par, vpp, cnp, vap, target)
957 #define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) \
958 vop_readdir((vp)->v_ops, vp, uio, cred, eofflag, ncookies, cookies)
959 #define VOP_READLINK(vp, uio, cred) \
960 vop_readlink((vp)->v_ops, vp, uio, cred)
961 #define VOP_INACTIVE(vp, td) \
962 vop_inactive((vp)->v_ops, vp, td)
963 #define VOP_RECLAIM(vp, td) \
964 vop_reclaim((vp)->v_ops, vp, td)
965 #define VOP_LOCK(vp, vlock, flags, td) \
966 vop_lock((vp)->v_ops, vp, vlock, flags, td)
967 #define VOP_UNLOCK(vp, vlock, flags, td) \
968 vop_unlock((vp)->v_ops, vp, vlock, flags, td)
969 #define VOP_BMAP(vp, bn, vpp, bnp, runp, runb) \
970 vop_bmap((vp)->v_ops, vp, bn, vpp, bnp, runp, runb)
971 #define VOP_STRATEGY(vp, bp) \
972 vop_strategy((vp)->v_ops, vp, bp)
973 #define VOP_PRINT(vp) \
974 vop_print((vp)->v_ops, vp)
975 #define VOP_PATHCONF(vp, name, retval) \
976 vop_pathconf((vp)->v_ops, vp, name, retval)
977 #define VOP_ADVLOCK(vp, id, op, fl, flags) \
978 vop_advlock((vp)->v_ops, vp, id, op, fl, flags)
979 #define VOP_BALLOC(vp, offset, size, cred, flags, bpp) \
980 vop_balloc((vp)->v_ops, vp, offset, size, cred, flags, bpp)
981 #define VOP_REALLOCBLKS(vp, buflist) \
982 vop_reallocblks((vp)->v_ops, vp, buflist)
983 #define VOP_GETPAGES(vp, m, count, reqpage, off) \
984 vop_getpages((vp)->v_ops, vp, m, count, reqpage, off)
985 #define VOP_PUTPAGES(vp, m, count, sync, rtvals, off) \
986 vop_putpages((vp)->v_ops, vp, m, count, sync, rtvals, off)
987 #define VOP_FREEBLKS(vp, addr, length) \
988 vop_freeblks((vp)->v_ops, vp, addr, length)
989 #define VOP_BWRITE(vp, bp) \
990 vop_bwrite((vp)->v_ops, vp, bp)
991 #define VOP_GETACL(vp, type, aclp, cred, td) \
992 vop_getacl((vp)->v_ops, vp, type, aclp, cred, td)
993 #define VOP_SETACL(vp, type, aclp, cred, td) \
994 vop_setacl((vp)->v_ops, vp, type, aclp, cred, td)
995 #define VOP_ACLCHECK(vp, type, aclp, cred, td) \
996 vop_aclcheck((vp)->v_ops, vp, type, aclp, cred, td)
997 #define VOP_GETEXTATTR(vp, name, uio, cred, td) \
998 vop_getextattr((vp)->v_ops, vp, name, uio, cred, td)
999 #define VOP_SETEXTATTR(vp, name, uio, cred, td) \
1000 vop_setextattr((vp)->v_ops, vp, name, uio, cred, td)
1001 #define VOP_CREATEVOBJECT(vp, td) \
1002 vop_createvobject((vp)->v_ops, vp, td)
1003 #define VOP_DESTROYVOBJECT(vp) \
1004 vop_destroyvobject((vp)->v_ops, vp)
1005 #define VOP_GETVOBJECT(vp, objpp) \
1006 vop_getvobject((vp)->v_ops, vp, objpp)
1007 /* no VOP_VFSSET() */