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.27 2006/10/27 04:56:33 dillon Exp $
38 * The vop_ops structure vectors all access to a filesystem. It contains a
39 * fixed set of vectors.
41 * In DragonFly the ultimate goal is to thread the VFS, which means that
42 * the dispatch functions will eventually be called from the context of
43 * a management thread rather then directly called by a process. This
44 * requires us to divorce direct process dependancies (in particular ioctl
45 * and UIO's). In addition, it is our intention to implement kernel
46 * level cache management and coherency in the vop_*() interfacing
49 * The number of management threads will depend on the VFS. The idea is
50 * to give a high performance VFS such as UFS at least one thread per cpu,
51 * and a low performance VFS such as CD9660 perhaps just one thread period.
52 * Blocking issues within the management thread are up to the VFS itself,
53 * but DragonFly will introduce a layer above the VFS to handle cacheable
54 * requests without having to enter the VFS (e.g. by making attribute
55 * and VM object information a permanent fixture of the vnode structure
56 * and accessing them directly).
58 * THE VOPOPS VECTORS SHOULD NEVER BE CALLED DIRECTLY! Instead always use
59 * the kernel helper procedures vop_*() to call a vopop. The kernel
60 * helper procedure will be responsible for handling the DragonFly messaging
61 * conversion when it occurs.
64 #ifndef _SYS_VFSOPS_H_
65 #define _SYS_VFSOPS_H_
85 struct vop_generic_args {
86 struct syslink_desc *a_desc; /* command descriptor for the call */
87 struct vop_ops *a_ops; /* operations vector for the call */
91 struct vop_old_lookup_args {
92 struct vop_generic_args a_head;
95 struct componentname *a_cnp;
98 struct vop_old_create_args {
99 struct vop_generic_args a_head;
101 struct vnode **a_vpp;
102 struct componentname *a_cnp;
106 struct vop_old_whiteout_args {
107 struct vop_generic_args a_head;
109 struct componentname *a_cnp;
113 struct vop_old_mknod_args {
114 struct vop_generic_args a_head;
116 struct vnode **a_vpp;
117 struct componentname *a_cnp;
121 struct vop_open_args {
122 struct vop_generic_args a_head;
125 struct ucred *a_cred;
126 struct file *a_fp; /* optional fp for fileops override */
129 struct vop_close_args {
130 struct vop_generic_args a_head;
135 struct vop_access_args {
136 struct vop_generic_args a_head;
139 struct ucred *a_cred;
142 struct vop_getattr_args {
143 struct vop_generic_args a_head;
148 struct vop_setattr_args {
149 struct vop_generic_args a_head;
152 struct ucred *a_cred;
155 struct vop_read_args {
156 struct vop_generic_args a_head;
160 struct ucred *a_cred;
163 struct vop_write_args {
164 struct vop_generic_args a_head;
168 struct ucred *a_cred;
171 struct vop_ioctl_args {
172 struct vop_generic_args a_head;
177 struct ucred *a_cred;
180 struct vop_poll_args {
181 struct vop_generic_args a_head;
184 struct ucred *a_cred;
187 struct vop_kqfilter_args {
188 struct vop_generic_args a_head;
193 struct vop_revoke_args {
194 struct vop_generic_args a_head;
199 struct vop_mmap_args {
200 struct vop_generic_args a_head;
203 struct ucred *a_cred;
206 struct vop_fsync_args {
207 struct vop_generic_args a_head;
212 struct vop_old_remove_args {
213 struct vop_generic_args a_head;
216 struct componentname *a_cnp;
219 struct vop_old_link_args {
220 struct vop_generic_args a_head;
221 struct vnode *a_tdvp;
223 struct componentname *a_cnp;
226 struct vop_old_rename_args {
227 struct vop_generic_args a_head;
228 struct vnode *a_fdvp;
230 struct componentname *a_fcnp;
231 struct vnode *a_tdvp;
233 struct componentname *a_tcnp;
236 struct vop_old_mkdir_args {
237 struct vop_generic_args a_head;
239 struct vnode **a_vpp;
240 struct componentname *a_cnp;
244 struct vop_old_rmdir_args {
245 struct vop_generic_args a_head;
248 struct componentname *a_cnp;
251 struct vop_old_symlink_args {
252 struct vop_generic_args a_head;
254 struct vnode **a_vpp;
255 struct componentname *a_cnp;
260 struct vop_readdir_args {
261 struct vop_generic_args a_head;
264 struct ucred *a_cred;
270 struct vop_readlink_args {
271 struct vop_generic_args a_head;
274 struct ucred *a_cred;
277 struct vop_inactive_args {
278 struct vop_generic_args a_head;
282 struct vop_reclaim_args {
283 struct vop_generic_args a_head;
287 struct vop_bmap_args {
288 struct vop_generic_args a_head;
291 struct vnode **a_vpp;
297 struct vop_strategy_args {
298 struct vop_generic_args a_head;
303 struct vop_print_args {
304 struct vop_generic_args a_head;
308 struct vop_pathconf_args {
309 struct vop_generic_args a_head;
312 register_t *a_retval;
315 struct vop_advlock_args {
316 struct vop_generic_args a_head;
324 struct vop_balloc_args {
325 struct vop_generic_args a_head;
329 struct ucred *a_cred;
334 struct vop_reallocblks_args {
335 struct vop_generic_args a_head;
337 struct cluster_save *a_buflist;
340 struct vop_getpages_args {
341 struct vop_generic_args a_head;
343 struct vm_page **a_m;
346 vm_ooffset_t a_offset;
349 struct vop_putpages_args {
350 struct vop_generic_args a_head;
352 struct vm_page **a_m;
356 vm_ooffset_t a_offset;
359 struct vop_freeblks_args {
360 struct vop_generic_args a_head;
366 struct vop_getacl_args {
367 struct vop_generic_args a_head;
371 struct ucred *a_cred;
374 struct vop_setacl_args {
375 struct vop_generic_args a_head;
379 struct ucred *a_cred;
382 struct vop_aclcheck_args {
383 struct vop_generic_args a_head;
387 struct ucred *a_cred;
390 struct vop_getextattr_args {
391 struct vop_generic_args a_head;
395 struct ucred *a_cred;
398 struct vop_setextattr_args {
399 struct vop_generic_args a_head;
403 struct ucred *a_cred;
406 struct vop_mountctl_args {
407 struct vop_generic_args a_head;
420 struct vop_nresolve_args {
421 struct vop_generic_args a_head;
422 struct nchandle *a_nch;
423 struct ucred *a_cred;
426 struct vop_nlookupdotdot_args {
427 struct vop_generic_args a_head;
429 struct vnode **a_vpp;
430 struct ucred *a_cred;
433 struct vop_ncreate_args {
434 struct vop_generic_args a_head;
435 struct nchandle *a_nch; /* locked namespace */
436 struct vnode **a_vpp; /* returned refd & locked */
437 struct ucred *a_cred;
441 struct vop_nmkdir_args {
442 struct vop_generic_args a_head;
443 struct nchandle *a_nch; /* locked namespace */
444 struct vnode **a_vpp; /* returned refd & locked */
445 struct ucred *a_cred;
449 struct vop_nmknod_args {
450 struct vop_generic_args a_head;
451 struct nchandle *a_nch;
452 struct vnode **a_vpp;
453 struct ucred *a_cred;
457 struct vop_nlink_args {
458 struct vop_generic_args a_head;
459 struct nchandle *a_nch;
461 struct ucred *a_cred;
464 struct vop_nsymlink_args {
465 struct vop_generic_args a_head;
466 struct nchandle *a_nch;
467 struct vnode **a_vpp;
468 struct ucred *a_cred;
473 struct vop_nwhiteout_args {
474 struct vop_generic_args a_head;
475 struct nchandle *a_nch;
476 struct ucred *a_cred;
480 struct vop_nremove_args {
481 struct vop_generic_args a_head;
482 struct nchandle *a_nch; /* locked namespace */
483 struct ucred *a_cred;
486 struct vop_nrmdir_args {
487 struct vop_generic_args a_head;
488 struct nchandle *a_nch; /* locked namespace */
489 struct ucred *a_cred;
492 struct vop_nrename_args {
493 struct vop_generic_args a_head;
494 struct nchandle *a_fnch; /* locked namespace / from */
495 struct nchandle *a_tnch; /* locked namespace / to */
496 struct ucred *a_cred;
500 * This structure is the post-compiled VOP operations vector. vop_ops are
501 * typically per-mount entities. The first section is used by our vop_*()
502 * function wrappers to implement hooks for per-mount management functions
503 * such as journaling and cache coherency protocols. The second section is
504 * the function dispatch for the VFSs. The functions are supposed to run
505 * in the context of the VFS's thread (if it has one) and should not be
506 * directly called from random kernel code. Note that VOCALL()s are direct
507 * calls used for chaining vop_ops structures from a VFS context.
511 struct mount *vv_mount;
514 #define vop_ops_first_field vop_default
515 int (*vop_default)(struct vop_generic_args *);
516 int (*vop_unused11)(void *);
517 int (*vop_old_lookup)(struct vop_old_lookup_args *);
518 int (*vop_unused03)(void *);
519 int (*vop_old_create)(struct vop_old_create_args *);
520 int (*vop_old_whiteout)(struct vop_old_whiteout_args *);
521 int (*vop_old_mknod)(struct vop_old_mknod_args *);
522 int (*vop_open)(struct vop_open_args *);
523 int (*vop_close)(struct vop_close_args *);
524 int (*vop_access)(struct vop_access_args *);
525 int (*vop_getattr)(struct vop_getattr_args *);
526 int (*vop_setattr)(struct vop_setattr_args *);
527 int (*vop_read)(struct vop_read_args *);
528 int (*vop_write)(struct vop_write_args *);
529 int (*vop_unused04)(void *);
530 int (*vop_ioctl)(struct vop_ioctl_args *);
531 int (*vop_poll)(struct vop_poll_args *);
532 int (*vop_kqfilter)(struct vop_kqfilter_args *);
533 int (*vop_revoke)(struct vop_revoke_args *);
534 int (*vop_mmap)(struct vop_mmap_args *);
535 int (*vop_fsync)(struct vop_fsync_args *);
536 int (*vop_old_remove)(struct vop_old_remove_args *);
537 int (*vop_old_link)(struct vop_old_link_args *);
538 int (*vop_old_rename)(struct vop_old_rename_args *);
539 int (*vop_old_mkdir)(struct vop_old_mkdir_args *);
540 int (*vop_old_rmdir)(struct vop_old_rmdir_args *);
541 int (*vop_old_symlink)(struct vop_old_symlink_args *);
542 int (*vop_readdir)(struct vop_readdir_args *);
543 int (*vop_readlink)(struct vop_readlink_args *);
544 int (*vop_inactive)(struct vop_inactive_args *);
545 int (*vop_reclaim)(struct vop_reclaim_args *);
546 int (*vop_unused09)(void *);
547 int (*vop_unused10)(void *);
548 int (*vop_bmap)(struct vop_bmap_args *);
549 int (*vop_strategy)(struct vop_strategy_args *);
550 int (*vop_print)(struct vop_print_args *);
551 int (*vop_pathconf)(struct vop_pathconf_args *);
552 int (*vop_advlock)(struct vop_advlock_args *);
553 int (*vop_balloc)(struct vop_balloc_args *);
554 int (*vop_reallocblks)(struct vop_reallocblks_args *);
555 int (*vop_getpages)(struct vop_getpages_args *);
556 int (*vop_putpages)(struct vop_putpages_args *);
557 int (*vop_freeblks)(struct vop_freeblks_args *);
558 int (*vop_unused05)(void *);
559 int (*vop_getacl)(struct vop_getacl_args *);
560 int (*vop_setacl)(struct vop_setacl_args *);
561 int (*vop_aclcheck)(struct vop_aclcheck_args *);
562 int (*vop_getextattr)(struct vop_getextattr_args *);
563 int (*vop_setextattr)(struct vop_setextattr_args *);
564 int (*vop_unused06)(void *);
565 int (*vop_unused07)(void *);
566 int (*vop_unused08)(void *);
567 int (*vop_mountctl)(struct vop_mountctl_args *);
569 int (*vop_nresolve)(struct vop_nresolve_args *);
570 int (*vop_nlookupdotdot)(struct vop_nlookupdotdot_args *);
571 int (*vop_ncreate)(struct vop_ncreate_args *);
572 int (*vop_nmkdir)(struct vop_nmkdir_args *);
573 int (*vop_nmknod)(struct vop_nmknod_args *);
574 int (*vop_nlink)(struct vop_nlink_args *);
575 int (*vop_nsymlink)(struct vop_nsymlink_args *);
576 int (*vop_nwhiteout)(struct vop_nwhiteout_args *);
577 int (*vop_nremove)(struct vop_nremove_args *);
578 int (*vop_nrmdir)(struct vop_nrmdir_args *);
579 int (*vop_nrename)(struct vop_nrename_args *);
580 #define vop_ops_last_field vop_nrename
584 * vop_mountctl() operations
586 #define VFSSET_DETACH 0
587 #define VFSSET_ATTACH 1
590 * Kernel VOP arguments union, suitable for malloc / embedding in other
591 * structures. The vop_args_union can hold any VOP call argument structure.
592 * Note that vu_head is broken out.
594 union vop_args_union {
595 struct vop_generic_args vu_head;
596 struct vop_generic_args vu_default;
597 struct vop_old_lookup_args vu_lookup;
598 struct vop_old_create_args vu_create;
599 struct vop_old_whiteout_args vu_whiteout;
600 struct vop_old_mknod_args vu_mknod;
601 struct vop_open_args vu_open;
602 struct vop_close_args vu_close;
603 struct vop_access_args vu_access;
604 struct vop_getattr_args vu_getattr;
605 struct vop_setattr_args vu_setattr;
606 struct vop_read_args vu_read;
607 struct vop_write_args vu_write;
608 struct vop_ioctl_args vu_ioctl;
609 struct vop_poll_args vu_poll;
610 struct vop_kqfilter_args vu_kqfilter;
611 struct vop_revoke_args vu_revoke;
612 struct vop_mmap_args vu_mmap;
613 struct vop_fsync_args vu_fsync;
614 struct vop_old_remove_args vu_remove;
615 struct vop_old_link_args vu_link;
616 struct vop_old_rename_args vu_rename;
617 struct vop_old_mkdir_args vu_mkdir;
618 struct vop_old_rmdir_args vu_rmdir;
619 struct vop_old_symlink_args vu_symlink;
620 struct vop_readdir_args vu_readdir;
621 struct vop_readlink_args vu_readlink;
622 struct vop_inactive_args vu_inactive;
623 struct vop_reclaim_args vu_reclaim;
624 struct vop_bmap_args vu_bmap;
625 struct vop_strategy_args vu_strategy;
626 struct vop_print_args vu_print;
627 struct vop_pathconf_args vu_pathconf;
628 struct vop_advlock_args vu_advlock;
629 struct vop_balloc_args vu_balloc;
630 struct vop_reallocblks_args vu_reallocblks;
631 struct vop_getpages_args vu_getpages;
632 struct vop_putpages_args vu_putpages;
633 struct vop_freeblks_args vu_freeblks;
634 struct vop_getacl_args vu_getacl;
635 struct vop_setacl_args vu_setacl;
636 struct vop_aclcheck_args vu_aclcheck;
637 struct vop_getextattr_args vu_getextattr;
638 struct vop_setextattr_args vu_setextattr;
639 struct vop_mountctl_args vu_mountctl;
641 struct vop_nresolve_args vu_nresolve;
642 struct vop_nlookupdotdot_args vu_nlookupdotdot;
643 struct vop_ncreate_args vu_ncreate;
644 struct vop_nmkdir_args vu_nmkdir;
645 struct vop_nmknod_args vu_nmknod;
646 struct vop_nlink_args vu_nlink;
647 struct vop_nsymlink_args vu_nsymlink;
648 struct vop_nwhiteout_args vu_nwhiteout;
649 struct vop_nremove_args vu_nremove;
650 struct vop_nrmdir_args vu_nrmdir;
651 struct vop_nrename_args vu_nrename;
657 * Kernel VOP call wrappers. These wrappers are responsible for wrapping
658 * the arguments in the appropriate VOP arguments structure, sending the
659 * message, and waiting for a reply. All kernel and VFS code should generally
660 * call these wrappers rather then attempt to call the operations vector
661 * routine directly in order to allow DragonFly to properly wrap the operation
662 * in a message and dispatch it to the correct thread.
664 int vop_old_lookup(struct vop_ops *ops, struct vnode *dvp,
665 struct vnode **vpp, struct componentname *cnp);
666 int vop_old_create(struct vop_ops *ops, struct vnode *dvp,
667 struct vnode **vpp, struct componentname *cnp,
669 int vop_old_whiteout(struct vop_ops *ops, struct vnode *dvp,
670 struct componentname *cnp, int flags);
671 int vop_old_mknod(struct vop_ops *ops, struct vnode *dvp,
672 struct vnode **vpp, struct componentname *cnp,
674 int vop_open(struct vop_ops *ops, struct vnode *vp, int mode,
675 struct ucred *cred, struct file *file);
676 int vop_close(struct vop_ops *ops, struct vnode *vp, int fflag);
677 int vop_access(struct vop_ops *ops, struct vnode *vp, int mode,
679 int vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap);
680 int vop_setattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap,
682 int vop_read(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
683 int ioflag, struct ucred *cred);
684 int vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
685 int ioflag, struct ucred *cred);
686 int vop_ioctl(struct vop_ops *ops, struct vnode *vp, u_long command,
687 caddr_t data, int fflag, struct ucred *cred);
688 int vop_poll(struct vop_ops *ops, struct vnode *vp, int events,
690 int vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn);
691 int vop_revoke(struct vop_ops *ops, struct vnode *vp, int flags);
692 int vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags,
694 int vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor);
695 int vop_old_remove(struct vop_ops *ops, struct vnode *dvp,
696 struct vnode *vp, struct componentname *cnp);
697 int vop_old_link(struct vop_ops *ops, struct vnode *tdvp,
698 struct vnode *vp, struct componentname *cnp);
699 int vop_old_rename(struct vop_ops *ops, struct vnode *fdvp,
700 struct vnode *fvp, struct componentname *fcnp,
701 struct vnode *tdvp, struct vnode *tvp,
702 struct componentname *tcnp);
703 int vop_old_mkdir(struct vop_ops *ops, struct vnode *dvp,
704 struct vnode **vpp, struct componentname *cnp,
706 int vop_old_rmdir(struct vop_ops *ops, struct vnode *dvp,
707 struct vnode *vp, struct componentname *cnp);
708 int vop_old_symlink(struct vop_ops *ops, struct vnode *dvp,
709 struct vnode **vpp, struct componentname *cnp,
710 struct vattr *vap, char *target);
711 int vop_readdir(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
712 struct ucred *cred, int *eofflag,
713 int *ncookies, u_long **cookies);
714 int vop_readlink(struct vop_ops *ops, struct vnode *vp, struct uio *uio,
716 int vop_inactive(struct vop_ops *ops, struct vnode *vp);
717 int vop_reclaim(struct vop_ops *ops, struct vnode *vp);
718 int vop_bmap(struct vop_ops *ops, struct vnode *vp, off_t loffset,
719 struct vnode **vpp, off_t *doffsetp, int *runp, int *runb);
720 int vop_strategy(struct vop_ops *ops, struct vnode *vp, struct bio *bio);
721 int vop_print(struct vop_ops *ops, struct vnode *vp);
722 int vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
724 int vop_advlock(struct vop_ops *ops, struct vnode *vp, caddr_t id, int op,
725 struct flock *fl, int flags);
726 int vop_balloc(struct vop_ops *ops, struct vnode *vp, off_t startoffset,
727 int size, struct ucred *cred, int flags,
729 int vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
730 struct cluster_save *buflist);
731 int vop_getpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
732 int count, int reqpage, vm_ooffset_t offset);
733 int vop_putpages(struct vop_ops *ops, struct vnode *vp, struct vm_page **m,
734 int count, int sync, int *rtvals, vm_ooffset_t offset);
735 int vop_freeblks(struct vop_ops *ops, struct vnode *vp,
736 off_t offset, int length);
737 int vop_getacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
738 struct acl *aclp, struct ucred *cred);
739 int vop_setacl(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
740 struct acl *aclp, struct ucred *cred);
741 int vop_aclcheck(struct vop_ops *ops, struct vnode *vp, acl_type_t type,
742 struct acl *aclp, struct ucred *cred);
743 int vop_getextattr(struct vop_ops *ops, struct vnode *vp, char *name,
744 struct uio *uio, struct ucred *cred);
745 int vop_setextattr(struct vop_ops *ops, struct vnode *vp, char *name,
746 struct uio *uio, struct ucred *cred);
747 int vop_mountctl(struct vop_ops *ops, int op, struct file *fp,
748 const void *ctl, int ctllen, void *buf, int buflen, int *res);
749 int vop_nresolve(struct vop_ops *ops, struct nchandle *nch,
751 int vop_nlookupdotdot(struct vop_ops *ops, struct vnode *dvp,
752 struct vnode **vpp, struct ucred *cred);
753 int vop_ncreate(struct vop_ops *ops, struct nchandle *nch,
754 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
755 int vop_nmkdir(struct vop_ops *ops, struct nchandle *nch,
756 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
757 int vop_nmknod(struct vop_ops *ops, struct nchandle *nch,
758 struct vnode **vpp, struct ucred *cred, struct vattr *vap);
759 int vop_nlink(struct vop_ops *ops, struct nchandle *nch, struct vnode *vp,
761 int vop_nsymlink(struct vop_ops *ops, struct nchandle *nch,
762 struct vnode **vpp, struct ucred *cred,
763 struct vattr *vap, char *target);
764 int vop_nwhiteout(struct vop_ops *ops, struct nchandle *nch,
765 struct ucred *cred, int flags);
766 int vop_nremove(struct vop_ops *ops, struct nchandle *nch,
768 int vop_nrmdir(struct vop_ops *ops, struct nchandle *nch,
770 int vop_nrename(struct vop_ops *ops, struct nchandle *fnch,
771 struct nchandle *tnch, struct ucred *cred);
774 * Kernel VOP forwarding wrappers. These are called when a VFS such as
775 * nullfs or unionfs needs to push down into another VFS, changing the
776 * a_ops pointer and consequentially necessitating additional
779 * Note that this is different from vop_ops chaining within the same
780 * filesystem. When a filesystem chains a vop_ops it just uses VOCALLs.
782 int vop_vnoperate_ap(struct vop_generic_args *ap);
783 int vop_cache_operate_ap(struct vop_generic_args *ap);
784 int vop_journal_operate_ap(struct vop_generic_args *ap);
785 int vop_old_lookup_ap(struct vop_old_lookup_args *ap);
786 int vop_old_create_ap(struct vop_old_create_args *ap);
787 int vop_old_whiteout_ap(struct vop_old_whiteout_args *ap);
788 int vop_old_mknod_ap(struct vop_old_mknod_args *ap);
789 int vop_open_ap(struct vop_open_args *ap);
790 int vop_close_ap(struct vop_close_args *ap);
791 int vop_access_ap(struct vop_access_args *ap);
792 int vop_getattr_ap(struct vop_getattr_args *ap);
793 int vop_setattr_ap(struct vop_setattr_args *ap);
794 int vop_read_ap(struct vop_read_args *ap);
795 int vop_write_ap(struct vop_write_args *ap);
796 int vop_ioctl_ap(struct vop_ioctl_args *ap);
797 int vop_poll_ap(struct vop_poll_args *ap);
798 int vop_kqfilter_ap(struct vop_kqfilter_args *ap);
799 int vop_revoke_ap(struct vop_revoke_args *ap);
800 int vop_mmap_ap(struct vop_mmap_args *ap);
801 int vop_fsync_ap(struct vop_fsync_args *ap);
802 int vop_old_remove_ap(struct vop_old_remove_args *ap);
803 int vop_old_link_ap(struct vop_old_link_args *ap);
804 int vop_old_rename_ap(struct vop_old_rename_args *ap);
805 int vop_old_mkdir_ap(struct vop_old_mkdir_args *ap);
806 int vop_old_rmdir_ap(struct vop_old_rmdir_args *ap);
807 int vop_old_symlink_ap(struct vop_old_symlink_args *ap);
808 int vop_readdir_ap(struct vop_readdir_args *ap);
809 int vop_readlink_ap(struct vop_readlink_args *ap);
810 int vop_inactive_ap(struct vop_inactive_args *ap);
811 int vop_reclaim_ap(struct vop_reclaim_args *ap);
812 int vop_bmap_ap(struct vop_bmap_args *ap);
813 int vop_strategy_ap(struct vop_strategy_args *ap);
814 int vop_print_ap(struct vop_print_args *ap);
815 int vop_pathconf_ap(struct vop_pathconf_args *ap);
816 int vop_advlock_ap(struct vop_advlock_args *ap);
817 int vop_balloc_ap(struct vop_balloc_args *ap);
818 int vop_reallocblks_ap(struct vop_reallocblks_args *ap);
819 int vop_getpages_ap(struct vop_getpages_args *ap);
820 int vop_putpages_ap(struct vop_putpages_args *ap);
821 int vop_freeblks_ap(struct vop_freeblks_args *ap);
822 int vop_getacl_ap(struct vop_getacl_args *ap);
823 int vop_setacl_ap(struct vop_setacl_args *ap);
824 int vop_aclcheck_ap(struct vop_aclcheck_args *ap);
825 int vop_getextattr_ap(struct vop_getextattr_args *ap);
826 int vop_setextattr_ap(struct vop_setextattr_args *ap);
827 int vop_mountctl_ap(struct vop_mountctl_args *ap);
829 int vop_nresolve_ap(struct vop_nresolve_args *ap);
830 int vop_nlookupdotdot_ap(struct vop_nlookupdotdot_args *ap);
831 int vop_ncreate_ap(struct vop_ncreate_args *ap);
832 int vop_nmkdir_ap(struct vop_nmkdir_args *ap);
833 int vop_nmknod_ap(struct vop_nmknod_args *ap);
834 int vop_nlink_ap(struct vop_nlink_args *ap);
835 int vop_nsymlink_ap(struct vop_nsymlink_args *ap);
836 int vop_nwhiteout_ap(struct vop_nwhiteout_args *ap);
837 int vop_nremove_ap(struct vop_nremove_args *ap);
838 int vop_nrmdir_ap(struct vop_nrmdir_args *ap);
839 int vop_nrename_ap(struct vop_nrename_args *ap);
842 * VOP operations descriptor. This is used by the vop_ops compiler
843 * to convert VFS vector arrays (typically in vfs/blah/blah_vnops.c)
844 * into a vop_ops operations vector.
846 extern struct syslink_desc vop_default_desc;
847 extern struct syslink_desc vop_old_lookup_desc;
848 extern struct syslink_desc vop_old_create_desc;
849 extern struct syslink_desc vop_old_whiteout_desc;
850 extern struct syslink_desc vop_old_mknod_desc;
851 extern struct syslink_desc vop_open_desc;
852 extern struct syslink_desc vop_close_desc;
853 extern struct syslink_desc vop_access_desc;
854 extern struct syslink_desc vop_getattr_desc;
855 extern struct syslink_desc vop_setattr_desc;
856 extern struct syslink_desc vop_read_desc;
857 extern struct syslink_desc vop_write_desc;
858 extern struct syslink_desc vop_ioctl_desc;
859 extern struct syslink_desc vop_poll_desc;
860 extern struct syslink_desc vop_kqfilter_desc;
861 extern struct syslink_desc vop_revoke_desc;
862 extern struct syslink_desc vop_mmap_desc;
863 extern struct syslink_desc vop_fsync_desc;
864 extern struct syslink_desc vop_old_remove_desc;
865 extern struct syslink_desc vop_old_link_desc;
866 extern struct syslink_desc vop_old_rename_desc;
867 extern struct syslink_desc vop_old_mkdir_desc;
868 extern struct syslink_desc vop_old_rmdir_desc;
869 extern struct syslink_desc vop_old_symlink_desc;
870 extern struct syslink_desc vop_readdir_desc;
871 extern struct syslink_desc vop_readlink_desc;
872 extern struct syslink_desc vop_inactive_desc;
873 extern struct syslink_desc vop_reclaim_desc;
874 extern struct syslink_desc vop_bmap_desc;
875 extern struct syslink_desc vop_strategy_desc;
876 extern struct syslink_desc vop_print_desc;
877 extern struct syslink_desc vop_pathconf_desc;
878 extern struct syslink_desc vop_advlock_desc;
879 extern struct syslink_desc vop_balloc_desc;
880 extern struct syslink_desc vop_reallocblks_desc;
881 extern struct syslink_desc vop_getpages_desc;
882 extern struct syslink_desc vop_putpages_desc;
883 extern struct syslink_desc vop_freeblks_desc;
884 extern struct syslink_desc vop_getacl_desc;
885 extern struct syslink_desc vop_setacl_desc;
886 extern struct syslink_desc vop_aclcheck_desc;
887 extern struct syslink_desc vop_getextattr_desc;
888 extern struct syslink_desc vop_setextattr_desc;
889 extern struct syslink_desc vop_mountctl_desc;
891 extern struct syslink_desc vop_nresolve_desc;
892 extern struct syslink_desc vop_nlookupdotdot_desc;
893 extern struct syslink_desc vop_ncreate_desc;
894 extern struct syslink_desc vop_nmkdir_desc;
895 extern struct syslink_desc vop_nmknod_desc;
896 extern struct syslink_desc vop_nlink_desc;
897 extern struct syslink_desc vop_nsymlink_desc;
898 extern struct syslink_desc vop_nwhiteout_desc;
899 extern struct syslink_desc vop_nremove_desc;
900 extern struct syslink_desc vop_nrmdir_desc;
901 extern struct syslink_desc vop_nrename_desc;
906 * VOP_*() convenience macros extract the operations vector and make the
909 #define VOP_OPEN(vp, mode, cred, fp) \
910 vop_open(*(vp)->v_ops, vp, mode, cred, fp)
911 #define VOP_CLOSE(vp, fflag) \
912 vop_close(*(vp)->v_ops, vp, fflag)
913 #define VOP_ACCESS(vp, mode, cred) \
914 vop_access(*(vp)->v_ops, vp, mode, cred)
915 #define VOP_GETATTR(vp, vap) \
916 vop_getattr(*(vp)->v_ops, vp, vap)
917 #define VOP_SETATTR(vp, vap, cred) \
918 vop_setattr(*(vp)->v_ops, vp, vap, cred)
919 #define VOP_READ(vp, uio, ioflag, cred) \
920 vop_read(*(vp)->v_ops, vp, uio, ioflag, cred)
921 #define VOP_WRITE(vp, uio, ioflag, cred) \
922 vop_write(*(vp)->v_ops, vp, uio, ioflag, cred)
923 #define VOP_IOCTL(vp, command, data, fflag, cred) \
924 vop_ioctl(*(vp)->v_ops, vp, command, data, fflag, cred)
925 #define VOP_POLL(vp, events, cred) \
926 vop_poll(*(vp)->v_ops, vp, events, cred)
927 #define VOP_KQFILTER(vp, kn) \
928 vop_kqfilter(*(vp)->v_ops, vp, kn)
929 #define VOP_REVOKE(vp, flags) \
930 vop_revoke(*(vp)->v_ops, vp, flags)
931 #define VOP_MMAP(vp, fflags, cred) \
932 vop_mmap(*(vp)->v_ops, vp, fflags, cred)
933 #define VOP_FSYNC(vp, waitfor) \
934 vop_fsync(*(vp)->v_ops, vp, waitfor)
935 #define VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) \
936 vop_readdir(*(vp)->v_ops, vp, uio, cred, eofflag, ncookies, cookies)
937 #define VOP_READLINK(vp, uio, cred) \
938 vop_readlink(*(vp)->v_ops, vp, uio, cred)
939 #define VOP_INACTIVE(vp) \
940 vop_inactive(*(vp)->v_ops, vp)
941 #define VOP_RECLAIM(vp) \
942 vop_reclaim(*(vp)->v_ops, vp)
943 #define VOP_BMAP(vp, loff, vpp, doffp, runp, runb) \
944 vop_bmap(*(vp)->v_ops, vp, loff, vpp, doffp, runp, runb)
945 #define VOP_PRINT(vp) \
946 vop_print(*(vp)->v_ops, vp)
947 #define VOP_PATHCONF(vp, name, retval) \
948 vop_pathconf(*(vp)->v_ops, vp, name, retval)
949 #define VOP_ADVLOCK(vp, id, op, fl, flags) \
950 vop_advlock(*(vp)->v_ops, vp, id, op, fl, flags)
951 #define VOP_BALLOC(vp, offset, size, cred, flags, bpp) \
952 vop_balloc(*(vp)->v_ops, vp, offset, size, cred, flags, bpp)
953 #define VOP_REALLOCBLKS(vp, buflist) \
954 vop_reallocblks(*(vp)->v_ops, vp, buflist)
955 #define VOP_GETPAGES(vp, m, count, reqpage, off) \
956 vop_getpages(*(vp)->v_ops, vp, m, count, reqpage, off)
957 #define VOP_PUTPAGES(vp, m, count, sync, rtvals, off) \
958 vop_putpages(*(vp)->v_ops, vp, m, count, sync, rtvals, off)
959 #define VOP_FREEBLKS(vp, offset, length) \
960 vop_freeblks(*(vp)->v_ops, vp, offset, length)
961 #define VOP_GETACL(vp, type, aclp, cred) \
962 vop_getacl(*(vp)->v_ops, vp, type, aclp, cred)
963 #define VOP_SETACL(vp, type, aclp, cred) \
964 vop_setacl(*(vp)->v_ops, vp, type, aclp, cred)
965 #define VOP_ACLCHECK(vp, type, aclp, cred) \
966 vop_aclcheck(*(vp)->v_ops, vp, type, aclp, cred)
967 #define VOP_GETEXTATTR(vp, name, uio, cred) \
968 vop_getextattr(*(vp)->v_ops, vp, name, uio, cred)
969 #define VOP_SETEXTATTR(vp, name, uio, cred) \
970 vop_setextattr(*(vp)->v_ops, vp, name, uio, cred)
971 /* no VOP_VFSSET() */
972 /* VOP_STRATEGY - does not exist, use vn_strategy() */
975 * 'OLD' VOP calls. These calls may only be made by the new API
976 * compatibility functions in kern/vfs_default.c. Attempting to
977 * call these functions directly will confuse the namecache. These
978 * calls are deprecated and being removed from the system and from
981 #define VOP_OLD_LOOKUP(dvp, vpp, cnp) \
982 vop_old_lookup(*(dvp)->v_ops, dvp, vpp, cnp)
983 #define VOP_OLD_CREATE(dvp, vpp, cnp, vap) \
984 vop_old_create(*(dvp)->v_ops, dvp, vpp, cnp, vap)
985 #define VOP_OLD_MKDIR(dvp, vpp, cnp, vap) \
986 vop_old_mkdir(*(dvp)->v_ops, dvp, vpp, cnp, vap)
987 #define VOP_OLD_MKNOD(dvp, vpp, cnp, vap) \
988 vop_old_mknod(*(dvp)->v_ops, dvp, vpp, cnp, vap)
989 #define VOP_OLD_LINK(tdvp, vp, cnp) \
990 vop_old_link(*(tdvp)->v_ops, tdvp, vp, cnp)
991 #define VOP_OLD_SYMLINK(dvp, vpp, cnp, vap, target) \
992 vop_old_symlink(*(dvp)->v_ops, dvp, vpp, cnp, vap, target)
993 #define VOP_OLD_WHITEOUT(dvp, cnp, flags) \
994 vop_old_whiteout(*(dvp)->v_ops, dvp, cnp, flags)
995 #define VOP_OLD_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp) \
996 vop_old_rename(*(fdvp)->v_ops, fdvp, fvp, fcnp, tdvp, tvp, tcnp)
997 #define VOP_OLD_RMDIR(dvp, vp, cnp) \
998 vop_old_rmdir(*(dvp)->v_ops, dvp, vp, cnp)
999 #define VOP_OLD_REMOVE(dvp, vp, cnp) \
1000 vop_old_remove(*(dvp)->v_ops, dvp, vp, cnp)
1003 * 'NEW' VOP calls. These calls use namespaces as an operational basis
1004 * rather then vnodes and replace the OLD calls. Eventually all VFS's
1005 * will support these calls. Those that do not fall through to compatibility
1006 * code in kern/vfs_default which does the magic required to call the old
1009 #define VOP_NRESOLVE(nch, cred) \
1010 vop_nresolve((nch)->mount->mnt_vn_use_ops, nch, cred)
1011 #define VOP_NCREATE(nch, vpp, cred, vap) \
1012 vop_ncreate((nch)->mount->mnt_vn_use_ops, nch, vpp, cred, vap)
1013 #define VOP_NMKDIR(nch, vpp, cred, vap) \
1014 vop_nmkdir((nch)->mount->mnt_vn_use_ops, nch, vpp, cred, vap)
1015 #define VOP_NMKNOD(nch, vpp, cred, vap) \
1016 vop_nmknod((nch)->mount->mnt_vn_use_ops, nch, vpp, cred, vap)
1017 #define VOP_NLINK(nch, vp, cred) \
1018 vop_nlink((nch)->mount->mnt_vn_use_ops, nch, vp, cred)
1019 #define VOP_NSYMLINK(nch, vpp, cred, vap, target) \
1020 vop_nsymlink((nch)->mount->mnt_vn_use_ops, nch, vpp, cred, vap, target)
1021 #define VOP_NWHITEOUT(nch, cred, flags) \
1022 vop_nwhiteout((nch)->mount->mnt_vn_use_ops, nch, cred, flags)
1023 #define VOP_NRENAME(fnch, tnch, cred) \
1024 vop_nrename((fnch)->mount->mnt_vn_use_ops, fnch, tnch, cred)
1025 #define VOP_NRMDIR(nch, cred) \
1026 vop_nrmdir((nch)->mount->mnt_vn_use_ops, nch, cred)
1027 #define VOP_NREMOVE(nch, cred) \
1028 vop_nremove((nch)->mount->mnt_vn_use_ops, nch, cred)