2 * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
3 * Copyright (c) 1992, 1993, 1994, 1995
4 * The Regents of the University of California. All rights reserved.
6 * This code is derived from software contributed to Berkeley by
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
38 * $FreeBSD: src/sys/miscfs/union/union_vnops.c,v 1.72 1999/12/15 23:02:14 eivind Exp $
39 * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.33 2006/08/12 00:26:22 dillon Exp $
42 #include <sys/param.h>
43 #include <sys/systm.h>
45 #include <sys/fcntl.h>
47 #include <sys/kernel.h>
48 #include <sys/vnode.h>
49 #include <sys/mount.h>
50 #include <sys/namei.h>
51 #include <sys/malloc.h>
54 #include <sys/sysctl.h>
58 #include <vm/vnode_pager.h>
60 #include <vm/vm_page.h>
61 #include <vm/vm_object.h>
66 SYSCTL_INT(_vfs, OID_AUTO, uniondebug, CTLFLAG_RW, &uniondebug, 0, "");
68 SYSCTL_INT(_vfs, OID_AUTO, uniondebug, CTLFLAG_RD, &uniondebug, 0, "");
71 static int union_access (struct vop_access_args *ap);
72 static int union_advlock (struct vop_advlock_args *ap);
73 static int union_bmap (struct vop_bmap_args *ap);
74 static int union_close (struct vop_close_args *ap);
75 static int union_create (struct vop_old_create_args *ap);
76 static int union_fsync (struct vop_fsync_args *ap);
77 static int union_getattr (struct vop_getattr_args *ap);
78 static int union_inactive (struct vop_inactive_args *ap);
79 static int union_ioctl (struct vop_ioctl_args *ap);
80 static int union_link (struct vop_old_link_args *ap);
81 static int union_lookup (struct vop_old_lookup_args *ap);
82 static int union_lookup1 (struct vnode *udvp, struct vnode **dvp,
84 struct componentname *cnp);
85 static int union_mkdir (struct vop_old_mkdir_args *ap);
86 static int union_mknod (struct vop_old_mknod_args *ap);
87 static int union_mmap (struct vop_mmap_args *ap);
88 static int union_open (struct vop_open_args *ap);
89 static int union_pathconf (struct vop_pathconf_args *ap);
90 static int union_print (struct vop_print_args *ap);
91 static int union_read (struct vop_read_args *ap);
92 static int union_readdir (struct vop_readdir_args *ap);
93 static int union_readlink (struct vop_readlink_args *ap);
94 static int union_reclaim (struct vop_reclaim_args *ap);
95 static int union_remove (struct vop_old_remove_args *ap);
96 static int union_rename (struct vop_old_rename_args *ap);
97 static int union_revoke (struct vop_revoke_args *ap);
98 static int union_rmdir (struct vop_old_rmdir_args *ap);
99 static int union_poll (struct vop_poll_args *ap);
100 static int union_setattr (struct vop_setattr_args *ap);
101 static int union_strategy (struct vop_strategy_args *ap);
102 static int union_getpages (struct vop_getpages_args *ap);
103 static int union_putpages (struct vop_putpages_args *ap);
104 static int union_symlink (struct vop_old_symlink_args *ap);
105 static int union_whiteout (struct vop_old_whiteout_args *ap);
106 static int union_write (struct vop_read_args *ap);
110 union_lock_upper(struct union_node *un, struct thread *td)
112 struct vnode *uppervp;
114 if ((uppervp = un->un_uppervp) != NULL) {
116 vn_lock(uppervp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY);
118 KASSERT((uppervp == NULL || uppervp->v_usecount > 0), ("uppervp usecount is 0"));
124 union_unlock_upper(struct vnode *uppervp, struct thread *td)
131 union_lock_other(struct union_node *un, struct thread *td)
135 if (un->un_uppervp != NULL) {
136 vp = union_lock_upper(un, td);
137 } else if ((vp = un->un_lowervp) != NULL) {
139 vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY);
146 union_unlock_other(struct vnode *vp, struct thread *td)
154 * udvp must be exclusively locked on call and will remain
155 * exclusively locked on return. This is the mount point
156 * for out filesystem.
158 * dvp Our base directory, locked and referenced.
159 * The passed dvp will be dereferenced and unlocked on return
160 * and a new dvp will be returned which is locked and
161 * referenced in the same variable.
163 * vpp is filled in with the result if no error occured,
166 * If an error is returned, *vpp is set to NULLVP. If no
167 * error occurs, *vpp is returned with a reference and an
172 union_lookup1(struct vnode *udvp, struct vnode **pdvp, struct vnode **vpp,
173 struct componentname *cnp)
176 struct thread *td = cnp->cn_td;
177 struct vnode *dvp = *pdvp;
182 * If stepping up the directory tree, check for going
183 * back across the mount point, in which case do what
184 * lookup would do by stepping back down the mount
187 if (cnp->cn_flags & CNP_ISDOTDOT) {
188 while ((dvp != udvp) && (dvp->v_flag & VROOT)) {
190 * Don't do the NOCROSSMOUNT check
191 * at this level. By definition,
192 * union fs deals with namespaces, not
196 dvp = dvp->v_mount->mnt_vnodecovered;
199 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
204 * Set return dvp to be the upperdvp 'parent directory.
209 * If the VOP_LOOKUP call generates an error, tdvp is invalid and no
210 * changes will have been made to dvp, so we are set to return.
213 error = VOP_LOOKUP(dvp, &tdvp, cnp);
215 UDEBUG(("dvp %p error %d flags %lx\n", dvp, error, cnp->cn_flags));
221 * The parent directory will have been unlocked, unless lookup
222 * found the last component or if dvp == tdvp (tdvp must be locked).
224 * We want our dvp to remain locked and ref'd. We also want tdvp
225 * to remain locked and ref'd.
227 UDEBUG(("parentdir %p result %p flag %lx\n", dvp, tdvp, cnp->cn_flags));
230 if (dvp != tdvp && (cnp->cn_flags & CNP_XXXISLASTCN) == 0)
231 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
235 * Lastly check if the current node is a mount point in
236 * which case walk up the mount hierarchy making sure not to
237 * bump into the root of the mount tree (ie. dvp != udvp).
239 * We use dvp as a temporary variable here, it is no longer related
240 * to the dvp above. However, we have to ensure that both *pdvp and
241 * tdvp are locked on return.
247 (dvp->v_type == VDIR) &&
248 (mp = dvp->v_mountedhere)
259 error = VFS_ROOT(mp, &dvp);
264 vn_lock(*pdvp, LK_EXCLUSIVE | LK_RETRY);
276 * union_lookup(struct vnode *a_dvp, struct vnode **a_vpp,
277 * struct componentname *a_cnp)
280 union_lookup(struct vop_old_lookup_args *ap)
284 struct vnode *uppervp, *lowervp;
285 struct vnode *upperdvp, *lowerdvp;
286 struct vnode *dvp = ap->a_dvp; /* starting dir */
287 struct union_node *dun = VTOUNION(dvp); /* associated union node */
288 struct componentname *cnp = ap->a_cnp;
289 struct thread *td = cnp->cn_td;
290 int lockparent = cnp->cn_flags & CNP_LOCKPARENT;
291 struct union_mount *um = MOUNTTOUNIONMOUNT(dvp->v_mount);
292 struct ucred *saved_cred = NULL;
299 * Disallow write attemps to the filesystem mounted read-only.
301 if ((dvp->v_mount->mnt_flag & MNT_RDONLY) &&
302 (cnp->cn_nameiop == NAMEI_DELETE || cnp->cn_nameiop == NAMEI_RENAME)) {
307 * For any lookup's we do, always return with the parent locked
309 cnp->cn_flags |= CNP_LOCKPARENT;
311 lowerdvp = dun->un_lowervp;
320 * Get a private lock on uppervp and a reference, effectively
321 * taking it out of the union_node's control.
323 * We must lock upperdvp while holding our lock on dvp
324 * to avoid a deadlock.
326 upperdvp = union_lock_upper(dun, td);
329 * do the lookup in the upper level.
330 * if that level comsumes additional pathnames,
331 * then assume that something special is going
332 * on and just return that vnode.
334 if (upperdvp != NULLVP) {
336 * We do not have to worry about the DOTDOT case, we've
337 * already unlocked dvp.
339 UDEBUG(("A %p\n", upperdvp));
342 * Do the lookup. We must supply a locked and referenced
343 * upperdvp to the function and will get a new locked and
344 * referenced upperdvp back with the old having been
347 * If an error is returned, uppervp will be NULLVP. If no
348 * error occurs, uppervp will be the locked and referenced
349 * return vnode or possibly NULL, depending on what is being
350 * requested. It is possible that the returned uppervp
351 * will be the same as upperdvp.
353 uerror = union_lookup1(um->um_uppervp, &upperdvp, &uppervp, cnp);
355 "uerror %d upperdvp %p %d/%d, uppervp %p ref=%d/lck=%d\n",
358 upperdvp->v_usecount,
359 vn_islocked(upperdvp),
361 (uppervp ? uppervp->v_usecount : -99),
362 (uppervp ? vn_islocked(uppervp) : -99)
366 * Disallow write attemps to the filesystem mounted read-only.
368 if (uerror == EJUSTRETURN &&
369 (dvp->v_mount->mnt_flag & MNT_RDONLY) &&
370 (cnp->cn_nameiop == NAMEI_CREATE || cnp->cn_nameiop == NAMEI_RENAME)) {
376 * Special case. If cn_consume != 0 skip out. The result
377 * of the lookup is transfered to our return variable. If
378 * an error occured we have to throw away the results.
381 if (cnp->cn_consume != 0) {
382 if ((error = uerror) == 0) {
383 *ap->a_vpp = uppervp;
390 * Calculate whiteout, fall through
393 if (uerror == ENOENT || uerror == EJUSTRETURN) {
394 if (cnp->cn_flags & CNP_ISWHITEOUT) {
396 } else if (lowerdvp != NULLVP) {
399 terror = VOP_GETATTR(upperdvp, &va);
400 if (terror == 0 && (va.va_flags & OPAQUE))
407 * in a similar way to the upper layer, do the lookup
408 * in the lower layer. this time, if there is some
409 * component magic going on, then vput whatever we got
410 * back from the upper layer and return the lower vnode
414 if (lowerdvp != NULLVP && !iswhiteout) {
417 UDEBUG(("B %p\n", lowerdvp));
420 * Force only LOOKUPs on the lower node, since
421 * we won't be making changes to it anyway.
423 nameiop = cnp->cn_nameiop;
424 cnp->cn_nameiop = NAMEI_LOOKUP;
425 if (um->um_op == UNMNT_BELOW) {
426 saved_cred = cnp->cn_cred;
427 cnp->cn_cred = um->um_cred;
431 * We shouldn't have to worry about locking interactions
432 * between the lower layer and our union layer (w.r.t.
433 * `..' processing) because we don't futz with lowervp
434 * locks in the union-node instantiation code path.
436 * union_lookup1() requires lowervp to be locked on entry,
437 * and it will be unlocked on return. The ref count will
438 * not change. On return lowervp doesn't represent anything
439 * to us so we NULL it out.
442 vn_lock(lowerdvp, LK_EXCLUSIVE | LK_RETRY);
443 lerror = union_lookup1(um->um_lowervp, &lowerdvp, &lowervp, cnp);
444 if (lowerdvp == lowervp)
448 lowerdvp = NULL; /* lowerdvp invalid after vput */
450 if (um->um_op == UNMNT_BELOW)
451 cnp->cn_cred = saved_cred;
452 cnp->cn_nameiop = nameiop;
454 if (cnp->cn_consume != 0 || lerror == EACCES) {
455 if ((error = lerror) == 0) {
456 *ap->a_vpp = lowervp;
462 UDEBUG(("C %p\n", lowerdvp));
463 if ((cnp->cn_flags & CNP_ISDOTDOT) && dun->un_pvp != NULLVP) {
464 if ((lowervp = LOWERVP(dun->un_pvp)) != NULL) {
466 vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY);
473 * Ok. Now we have uerror, uppervp, upperdvp, lerror, and lowervp.
475 * 1. If both layers returned an error, select the upper layer.
477 * 2. If the upper layer faile and the bottom layer succeeded,
478 * two subcases occur:
480 * a. The bottom vnode is not a directory, in which case
481 * just return a new union vnode referencing an
482 * empty top layer and the existing bottom layer.
484 * b. The button vnode is a directory, in which case
485 * create a new directory in the top layer and
486 * and fall through to case 3.
488 * 3. If the top layer succeeded then return a new union
489 * vnode referencing whatever the new top layer and
490 * whatever the bottom layer returned.
494 if ((uerror != 0) && (lerror != 0)) {
500 if (uerror != 0 /* && (lerror == 0) */ ) {
501 if (lowervp->v_type == VDIR) { /* case 2b. */
502 KASSERT(uppervp == NULL, ("uppervp unexpectedly non-NULL"));
504 * oops, uppervp has a problem, we may have to shadow.
506 uerror = union_mkshadow(um, upperdvp, cnp, &uppervp);
515 * Must call union_allocvp with both the upper and lower vnodes
516 * referenced and the upper vnode locked. ap->a_vpp is returned
517 * referenced and locked. lowervp, uppervp, and upperdvp are
518 * absorbed by union_allocvp() whether it succeeds or fails.
520 * upperdvp is the parent directory of uppervp which may be
521 * different, depending on the path, from dvp->un_uppervp. That's
522 * why it is a separate argument. Note that it must be unlocked.
524 * dvp must be locked on entry to the call and will be locked on
528 if (uppervp && uppervp != upperdvp)
535 error = union_allocvp(ap->a_vpp, dvp->v_mount, dvp, upperdvp, cnp,
536 uppervp, lowervp, 1);
538 UDEBUG(("Create %p = %p %p refs=%d\n", *ap->a_vpp, uppervp, lowervp, (*ap->a_vpp) ? ((*ap->a_vpp)->v_usecount) : -99));
547 * - put away any extra junk laying around. Note that lowervp
548 * (if not NULL) will never be the same as *ap->a_vp and
549 * neither will uppervp, because when we set that state we
550 * NULL-out lowervp or uppervp. On the otherhand, upperdvp
551 * may match uppervp or *ap->a_vpp.
553 * - relock/unlock dvp if appropriate.
558 if (upperdvp == uppervp || upperdvp == *ap->a_vpp)
571 * Restore LOCKPARENT state
575 cnp->cn_flags &= ~CNP_LOCKPARENT;
577 UDEBUG(("Out %d vpp %p/%d lower %p upper %p\n", error, *ap->a_vpp,
578 ((*ap->a_vpp) ? (*ap->a_vpp)->v_usecount : -99),
582 * dvp lock state, determine whether to relock dvp. dvp is expected
583 * to be locked on return if:
585 * - there was an error (except not EJUSTRETURN), or
586 * - we hit the last component and lockparent is true
588 * dvp_is_locked is the current state of the dvp lock, not counting
589 * the possibility that *ap->a_vpp == dvp (in which case it is locked
590 * anyway). Note that *ap->a_vpp == dvp only if no error occured.
593 if (*ap->a_vpp != dvp) {
594 if ((error == 0 || error == EJUSTRETURN) && !lockparent) {
604 if (cnp->cn_namelen == 1 &&
605 cnp->cn_nameptr[0] == '.' &&
607 panic("union_lookup returning . (%p) not same as startdir (%p)", ap->a_vpp, dvp);
617 * a_dvp is locked on entry and remains locked on return. a_vpp is returned
618 * locked if no error occurs, otherwise it is garbage.
620 * union_create(struct vnode *a_dvp, struct vnode **a_vpp,
621 * struct componentname *a_cnp, struct vattr *a_vap)
624 union_create(struct vop_old_create_args *ap)
626 struct union_node *dun = VTOUNION(ap->a_dvp);
627 struct componentname *cnp = ap->a_cnp;
628 struct thread *td = cnp->cn_td;
632 if ((dvp = union_lock_upper(dun, td)) != NULL) {
636 error = VOP_CREATE(dvp, &vp, cnp, ap->a_vap);
638 mp = ap->a_dvp->v_mount;
640 UDEBUG(("ALLOCVP-1 FROM %p REFS %d\n", vp, vp->v_usecount));
641 error = union_allocvp(ap->a_vpp, mp, NULLVP, NULLVP,
643 UDEBUG(("ALLOCVP-2B FROM %p REFS %d\n", *ap->a_vpp, vp->v_usecount));
645 union_unlock_upper(dvp, td);
651 * union_whiteout(struct vnode *a_dvp, struct componentname *a_cnp,
655 union_whiteout(struct vop_old_whiteout_args *ap)
657 struct union_node *un = VTOUNION(ap->a_dvp);
658 struct componentname *cnp = ap->a_cnp;
659 struct vnode *uppervp;
660 int error = EOPNOTSUPP;
662 if ((uppervp = union_lock_upper(un, cnp->cn_td)) != NULLVP) {
663 error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags);
664 union_unlock_upper(uppervp, cnp->cn_td);
672 * a_dvp is locked on entry and should remain locked on return.
673 * a_vpp is garbagre whether an error occurs or not.
675 * union_mknod(struct vnode *a_dvp, struct vnode **a_vpp,
676 * struct componentname *a_cnp, struct vattr *a_vap)
679 union_mknod(struct vop_old_mknod_args *ap)
681 struct union_node *dun = VTOUNION(ap->a_dvp);
682 struct componentname *cnp = ap->a_cnp;
686 if ((dvp = union_lock_upper(dun, cnp->cn_td)) != NULL) {
687 error = VOP_MKNOD(dvp, ap->a_vpp, cnp, ap->a_vap);
688 union_unlock_upper(dvp, cnp->cn_td);
696 * run open VOP. When opening the underlying vnode we have to mimic
697 * vn_open. What we *really* need to do to avoid screwups if the
698 * open semantics change is to call vn_open(). For example, ufs blows
699 * up if you open a file but do not vmio it prior to writing.
701 * union_open(struct vnode *a_vp, int a_mode,
702 * struct ucred *a_cred, struct thread *a_td)
705 union_open(struct vop_open_args *ap)
707 struct union_node *un = VTOUNION(ap->a_vp);
709 int mode = ap->a_mode;
710 struct ucred *cred = ap->a_cred;
711 struct thread *td = ap->a_td;
716 * If there is an existing upper vp then simply open that.
717 * The upper vp takes precedence over the lower vp. When opening
718 * a lower vp for writing copy it to the uppervp and then open the
721 * At the end of this section tvp will be left locked.
723 if ((tvp = union_lock_upper(un, td)) == NULLVP) {
725 * If the lower vnode is being opened for writing, then
726 * copy the file contents to the upper vnode and open that,
727 * otherwise can simply open the lower vnode.
729 tvp = un->un_lowervp;
730 if ((ap->a_mode & FWRITE) && (tvp->v_type == VREG)) {
731 int docopy = !(mode & O_TRUNC);
732 error = union_copyup(un, docopy, cred, td);
733 tvp = union_lock_upper(un, td);
737 vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY);
743 * We are holding the correct vnode, open it. Note
744 * that in DragonFly, VOP_OPEN is responsible for associating
745 * a VM object with the vnode if the vnode is mappable or the
746 * underlying filesystem uses buffer cache calls on it.
749 error = VOP_OPEN(tvp, mode, cred, NULL);
752 * Release any locks held
756 union_unlock_upper(tvp, td);
766 * It is unclear whether a_vp is passed locked or unlocked. Whatever
767 * the case we do not change it.
769 * union_close(struct vnode *a_vp, int a_fflag, struct ucred *a_cred,
770 * struct thread *a_td)
773 union_close(struct vop_close_args *ap)
775 struct union_node *un = VTOUNION(ap->a_vp);
778 if ((vp = un->un_uppervp) == NULLVP) {
779 #ifdef UNION_DIAGNOSTIC
780 if (un->un_openl <= 0)
781 panic("union: un_openl cnt");
786 ap->a_head.a_ops = *vp->v_ops;
788 return(vop_close_ap(ap));
792 * Check access permission on the union vnode.
793 * The access check being enforced is to check
794 * against both the underlying vnode, and any
795 * copied vnode. This ensures that no additional
796 * file permissions are given away simply because
797 * the user caused an implicit file copy.
799 * union_access(struct vnode *a_vp, int a_mode,
800 * struct ucred *a_cred, struct thread *a_td)
803 union_access(struct vop_access_args *ap)
805 struct union_node *un = VTOUNION(ap->a_vp);
806 struct thread *td = ap->a_td;
811 * Disallow write attempts on filesystems mounted read-only.
813 if ((ap->a_mode & VWRITE) &&
814 (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) {
815 switch (ap->a_vp->v_type) {
825 if ((vp = union_lock_upper(un, td)) != NULLVP) {
826 ap->a_head.a_ops = *vp->v_ops;
828 error = vop_access_ap(ap);
829 union_unlock_upper(vp, td);
833 if ((vp = un->un_lowervp) != NULLVP) {
834 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
835 ap->a_head.a_ops = *vp->v_ops;
839 * Remove VWRITE from a_mode if our mount point is RW, because
840 * we want to allow writes and lowervp may be read-only.
842 if ((un->un_vnode->v_mount->mnt_flag & MNT_RDONLY) == 0)
843 ap->a_mode &= ~VWRITE;
845 error = vop_access_ap(ap);
847 struct union_mount *um;
849 um = MOUNTTOUNIONMOUNT(un->un_vnode->v_mount);
851 if (um->um_op == UNMNT_BELOW) {
852 ap->a_cred = um->um_cred;
853 error = vop_access_ap(ap);
862 * We handle getattr only to change the fsid and
865 * It's not clear whether VOP_GETATTR is to be
866 * called with the vnode locked or not. stat() calls
867 * it with (vp) locked, and fstat calls it with
870 * Because of this we cannot use our normal locking functions
871 * if we do not intend to lock the main a_vp node. At the moment
872 * we are running without any specific locking at all, but beware
873 * to any programmer that care must be taken if locking is added
876 * union_getattr(struct vnode *a_vp, struct vattr *a_vap,
877 * struct ucred *a_cred, struct thread *a_td)
880 union_getattr(struct vop_getattr_args *ap)
883 struct union_node *un = VTOUNION(ap->a_vp);
889 * Some programs walk the filesystem hierarchy by counting
890 * links to directories to avoid stat'ing all the time.
891 * This means the link count on directories needs to be "correct".
892 * The only way to do that is to call getattr on both layers
893 * and fix up the link count. The link count will not necessarily
894 * be accurate but will be large enough to defeat the tree walkers.
899 if ((vp = un->un_uppervp) != NULLVP) {
900 error = VOP_GETATTR(vp, vap);
903 /* XXX isn't this dangerouso without a lock? */
904 union_newsize(ap->a_vp, vap->va_size, VNOVAL);
909 } else if (vp->v_type == VDIR && un->un_lowervp != NULLVP) {
917 error = VOP_GETATTR(vp, vap);
920 /* XXX isn't this dangerous without a lock? */
921 union_newsize(ap->a_vp, VNOVAL, vap->va_size);
924 if ((vap != ap->a_vap) && (vap->va_type == VDIR))
925 ap->a_vap->va_nlink += vap->va_nlink;
930 * union_setattr(struct vnode *a_vp, struct vattr *a_vap,
931 * struct ucred *a_cred, struct thread *a_td)
934 union_setattr(struct vop_setattr_args *ap)
936 struct union_node *un = VTOUNION(ap->a_vp);
937 struct thread *td = ap->a_td;
938 struct vattr *vap = ap->a_vap;
939 struct vnode *uppervp;
943 * Disallow write attempts on filesystems mounted read-only.
945 if ((ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) &&
946 (vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL ||
947 vap->va_gid != (gid_t)VNOVAL || vap->va_atime.tv_sec != VNOVAL ||
948 vap->va_mtime.tv_sec != VNOVAL ||
949 vap->va_mode != (mode_t)VNOVAL)) {
954 * Handle case of truncating lower object to zero size,
955 * by creating a zero length upper object. This is to
956 * handle the case of open with O_TRUNC and O_CREAT.
958 if (un->un_uppervp == NULLVP && (un->un_lowervp->v_type == VREG)) {
959 error = union_copyup(un, (ap->a_vap->va_size != 0),
960 ap->a_cred, ap->a_td);
966 * Try to set attributes in upper layer,
967 * otherwise return read-only filesystem error.
970 if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
971 error = VOP_SETATTR(un->un_uppervp, ap->a_vap, ap->a_cred);
972 if ((error == 0) && (ap->a_vap->va_size != VNOVAL))
973 union_newsize(ap->a_vp, ap->a_vap->va_size, VNOVAL);
974 union_unlock_upper(uppervp, td);
984 union_getpages(struct vop_getpages_args *ap)
988 r = vnode_pager_generic_getpages(ap->a_vp, ap->a_m,
989 ap->a_count, ap->a_reqpage);
998 union_putpages(struct vop_putpages_args *ap)
1002 r = vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count,
1003 ap->a_sync, ap->a_rtvals);
1008 * union_read(struct vnode *a_vp, struct uio *a_uio, int a_ioflag,
1009 * struct ucred *a_cred)
1012 union_read(struct vop_read_args *ap)
1014 struct union_node *un = VTOUNION(ap->a_vp);
1015 struct thread *td = ap->a_uio->uio_td;
1019 uvp = union_lock_other(un, td);
1020 KASSERT(uvp != NULL, ("union_read: backing vnode missing!"));
1022 if (ap->a_vp->v_flag & VOBJBUF)
1023 union_vm_coherency(ap->a_vp, ap->a_uio, 0);
1025 error = VOP_READ(uvp, ap->a_uio, ap->a_ioflag, ap->a_cred);
1026 union_unlock_other(uvp, td);
1030 * perhaps the size of the underlying object has changed under
1031 * our feet. take advantage of the offset information present
1032 * in the uio structure.
1035 struct union_node *un = VTOUNION(ap->a_vp);
1036 off_t cur = ap->a_uio->uio_offset;
1038 if (uvp == un->un_uppervp) {
1039 if (cur > un->un_uppersz)
1040 union_newsize(ap->a_vp, cur, VNOVAL);
1042 if (cur > un->un_lowersz)
1043 union_newsize(ap->a_vp, VNOVAL, cur);
1050 * union_write(struct vnode *a_vp, struct uio *a_uio, int a_ioflag,
1051 * struct ucred *a_cred)
1054 union_write(struct vop_read_args *ap)
1056 struct union_node *un = VTOUNION(ap->a_vp);
1057 struct thread *td = ap->a_uio->uio_td;
1058 struct vnode *uppervp;
1061 if ((uppervp = union_lock_upper(un, td)) == NULLVP)
1062 panic("union: missing upper layer in write");
1065 * Since our VM pages are associated with our vnode rather then
1066 * the real vnode, and since we do not run our reads and writes
1067 * through our own VM cache, we have a VM/VFS coherency problem.
1068 * We solve them by invalidating or flushing the associated VM
1069 * pages prior to allowing a normal read or write to occur.
1071 * VM-backed writes (UIO_NOCOPY) have to be converted to normal
1072 * writes because we are not cache-coherent. Normal writes need
1073 * to be made coherent with our VM-backing store, which we do by
1074 * first flushing any dirty VM pages associated with the write
1075 * range, and then destroying any clean VM pages associated with
1079 if (ap->a_uio->uio_segflg == UIO_NOCOPY) {
1080 ap->a_uio->uio_segflg = UIO_SYSSPACE;
1081 } else if (ap->a_vp->v_flag & VOBJBUF) {
1082 union_vm_coherency(ap->a_vp, ap->a_uio, 1);
1085 error = VOP_WRITE(uppervp, ap->a_uio, ap->a_ioflag, ap->a_cred);
1088 * the size of the underlying object may be changed by the
1092 off_t cur = ap->a_uio->uio_offset;
1094 if (cur > un->un_uppersz)
1095 union_newsize(ap->a_vp, cur, VNOVAL);
1097 union_unlock_upper(uppervp, td);
1102 * union_ioctl(struct vnode *a_vp, int a_command, caddr_t a_data, int a_fflag,
1103 * struct ucred *a_cred, struct thread *a_td)
1106 union_ioctl(struct vop_ioctl_args *ap)
1108 struct vnode *ovp = OTHERVP(ap->a_vp);
1110 ap->a_head.a_ops = *ovp->v_ops;
1112 return(vop_ioctl_ap(ap));
1116 * union_poll(struct vnode *a_vp, int a_events, struct ucred *a_cred,
1117 * struct thread *a_td)
1120 union_poll(struct vop_poll_args *ap)
1122 struct vnode *ovp = OTHERVP(ap->a_vp);
1124 ap->a_head.a_ops = *ovp->v_ops;
1126 return(vop_poll_ap(ap));
1130 * union_revoke(struct vnode *a_vp, int a_flags, struct thread *a_td)
1133 union_revoke(struct vop_revoke_args *ap)
1135 struct vnode *vp = ap->a_vp;
1138 if ((vx = UPPERVP(vp)) != NULL) {
1140 VOP_REVOKE(vx, ap->a_flags);
1143 if ((vx = LOWERVP(vp)) != NULL) {
1145 VOP_REVOKE(vx, ap->a_flags);
1153 * union_mmap(struct vnode *a_vp, int a_fflags, struct ucred *a_cred,
1154 * struct thread *a_td)
1157 union_mmap(struct vop_mmap_args *ap)
1159 struct vnode *ovp = OTHERVP(ap->a_vp);
1161 ap->a_head.a_ops = *ovp->v_ops;
1163 return (vop_mmap_ap(ap));
1167 * union_fsync(struct vnode *a_vp, struct ucred *a_cred, int a_waitfor,
1168 * struct thread *a_td)
1171 union_fsync(struct vop_fsync_args *ap)
1174 struct thread *td = ap->a_td;
1175 struct vnode *targetvp;
1176 struct union_node *un = VTOUNION(ap->a_vp);
1178 if ((targetvp = union_lock_other(un, td)) != NULLVP) {
1179 error = VOP_FSYNC(targetvp, ap->a_waitfor);
1180 union_unlock_other(targetvp, td);
1189 * Remove the specified cnp. The dvp and vp are passed to us locked
1190 * and must remain locked on return.
1192 * union_remove(struct vnode *a_dvp, struct vnode *a_vp,
1193 * struct componentname *a_cnp)
1196 union_remove(struct vop_old_remove_args *ap)
1198 struct union_node *dun = VTOUNION(ap->a_dvp);
1199 struct union_node *un = VTOUNION(ap->a_vp);
1200 struct componentname *cnp = ap->a_cnp;
1201 struct thread *td = cnp->cn_td;
1202 struct vnode *uppervp;
1203 struct vnode *upperdvp;
1206 if ((upperdvp = union_lock_upper(dun, td)) == NULLVP)
1207 panic("union remove: null upper vnode");
1209 if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
1210 if (union_dowhiteout(un, cnp->cn_cred, td))
1211 cnp->cn_flags |= CNP_DOWHITEOUT;
1212 error = VOP_REMOVE(upperdvp, uppervp, cnp);
1216 union_removed_upper(un);
1218 union_unlock_upper(uppervp, td);
1220 error = union_mkwhiteout(
1221 MOUNTTOUNIONMOUNT(ap->a_dvp->v_mount),
1222 upperdvp, ap->a_cnp, un->un_path);
1224 union_unlock_upper(upperdvp, td);
1231 * tdvp will be locked on entry, vp will not be locked on entry.
1232 * tdvp should remain locked on return and vp should remain unlocked
1235 * union_link(struct vnode *a_tdvp, struct vnode *a_vp,
1236 * struct componentname *a_cnp)
1239 union_link(struct vop_old_link_args *ap)
1241 struct componentname *cnp = ap->a_cnp;
1242 struct thread *td = cnp->cn_td;
1243 struct union_node *dun = VTOUNION(ap->a_tdvp);
1248 if (ap->a_tdvp->v_ops != ap->a_vp->v_ops) {
1251 struct union_node *tun = VTOUNION(ap->a_vp);
1253 if (tun->un_uppervp == NULLVP) {
1254 vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY);
1256 if (dun->un_uppervp == tun->un_dirvp) {
1257 if (dun->un_flags & UN_ULOCK) {
1258 dun->un_flags &= ~UN_ULOCK;
1259 vn_unlock(dun->un_uppervp);
1263 error = union_copyup(tun, 1, cnp->cn_cred, td);
1265 if (dun->un_uppervp == tun->un_dirvp) {
1266 vn_lock(dun->un_uppervp,
1267 LK_EXCLUSIVE | LK_RETRY);
1268 dun->un_flags |= UN_ULOCK;
1271 vn_unlock(ap->a_vp);
1273 vp = tun->un_uppervp;
1280 * Make sure upper is locked, then unlock the union directory we were
1281 * called with to avoid a deadlock while we are calling VOP_LINK on
1282 * the upper (with tdvp locked and vp not locked). Our ap->a_tdvp
1283 * is expected to be locked on return.
1286 if ((tdvp = union_lock_upper(dun, td)) == NULLVP)
1289 vn_unlock(ap->a_tdvp); /* unlock calling node */
1290 error = VOP_LINK(tdvp, vp, cnp); /* call link on upper */
1293 * We have to unlock tdvp prior to relocking our calling node in
1294 * order to avoid a deadlock.
1296 union_unlock_upper(tdvp, td);
1297 vn_lock(ap->a_tdvp, LK_EXCLUSIVE | LK_RETRY);
1302 * union_rename(struct vnode *a_fdvp, struct vnode *a_fvp,
1303 * struct componentname *a_fcnp, struct vnode *a_tdvp,
1304 * struct vnode *a_tvp, struct componentname *a_tcnp)
1307 union_rename(struct vop_old_rename_args *ap)
1310 struct vnode *fdvp = ap->a_fdvp;
1311 struct vnode *fvp = ap->a_fvp;
1312 struct vnode *tdvp = ap->a_tdvp;
1313 struct vnode *tvp = ap->a_tvp;
1316 * Figure out what fdvp to pass to our upper or lower vnode. If we
1317 * replace the fdvp, release the original one and ref the new one.
1320 if (fdvp->v_tag == VT_UNION) { /* always true */
1321 struct union_node *un = VTOUNION(fdvp);
1322 if (un->un_uppervp == NULLVP) {
1324 * this should never happen in normal
1325 * operation but might if there was
1326 * a problem creating the top-level shadow
1332 fdvp = un->un_uppervp;
1338 * Figure out what fvp to pass to our upper or lower vnode. If we
1339 * replace the fvp, release the original one and ref the new one.
1342 if (fvp->v_tag == VT_UNION) { /* always true */
1343 struct union_node *un = VTOUNION(fvp);
1345 struct union_mount *um = MOUNTTOUNIONMOUNT(fvp->v_mount);
1348 if (un->un_uppervp == NULLVP) {
1349 switch(fvp->v_type) {
1351 vn_lock(un->un_vnode, LK_EXCLUSIVE | LK_RETRY);
1352 error = union_copyup(un, 1, ap->a_fcnp->cn_cred, ap->a_fcnp->cn_td);
1353 vn_unlock(un->un_vnode);
1361 * There is only one way to rename a directory
1362 * based in the lowervp, and that is to copy
1363 * the entire directory hierarchy. Otherwise
1364 * it would not last across a reboot.
1369 vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
1370 error = union_mkshadow(um, fdvp,
1371 ap->a_fcnp, &un->un_uppervp);
1374 vn_unlock(un->un_uppervp);
1385 if (un->un_lowervp != NULLVP)
1386 ap->a_fcnp->cn_flags |= CNP_DOWHITEOUT;
1387 fvp = un->un_uppervp;
1393 * Figure out what tdvp (destination directory) to pass to the
1394 * lower level. If we replace it with uppervp, we need to vput the
1395 * old one. The exclusive lock is transfered to what we will pass
1396 * down in the VOP_RENAME and we replace uppervp with a simple
1400 if (tdvp->v_tag == VT_UNION) {
1401 struct union_node *un = VTOUNION(tdvp);
1403 if (un->un_uppervp == NULLVP) {
1405 * this should never happen in normal
1406 * operation but might if there was
1407 * a problem creating the top-level shadow
1415 * new tdvp is a lock and reference on uppervp, put away
1418 tdvp = union_lock_upper(un, ap->a_tcnp->cn_td);
1423 * Figure out what tvp (destination file) to pass to the
1426 * If the uppervp file does not exist put away the (wrong)
1427 * file and change tvp to NULL.
1430 if (tvp != NULLVP && tvp->v_tag == VT_UNION) {
1431 struct union_node *un = VTOUNION(tvp);
1433 tvp = union_lock_upper(un, ap->a_tcnp->cn_td);
1435 /* note: tvp may be NULL */
1439 * VOP_RENAME releases/vputs prior to returning, so we have no
1443 return (VOP_RENAME(fdvp, fvp, ap->a_fcnp, tdvp, tvp, ap->a_tcnp));
1446 * Error. We still have to release / vput the various elements.
1454 if (tvp != NULLVP) {
1464 * union_mkdir(struct vnode *a_dvp, struct vnode **a_vpp,
1465 * struct componentname *a_cnp, struct vattr *a_vap)
1468 union_mkdir(struct vop_old_mkdir_args *ap)
1470 struct union_node *dun = VTOUNION(ap->a_dvp);
1471 struct componentname *cnp = ap->a_cnp;
1472 struct thread *td = cnp->cn_td;
1473 struct vnode *upperdvp;
1476 if ((upperdvp = union_lock_upper(dun, td)) != NULLVP) {
1479 error = VOP_MKDIR(upperdvp, &vp, cnp, ap->a_vap);
1480 union_unlock_upper(upperdvp, td);
1484 UDEBUG(("ALLOCVP-2 FROM %p REFS %d\n", vp, vp->v_usecount));
1485 error = union_allocvp(ap->a_vpp, ap->a_dvp->v_mount,
1486 ap->a_dvp, NULLVP, cnp, vp, NULLVP, 1);
1487 UDEBUG(("ALLOCVP-2B FROM %p REFS %d\n", *ap->a_vpp, vp->v_usecount));
1494 * union_rmdir(struct vnode *a_dvp, struct vnode *a_vp,
1495 * struct componentname *a_cnp)
1498 union_rmdir(struct vop_old_rmdir_args *ap)
1500 struct union_node *dun = VTOUNION(ap->a_dvp);
1501 struct union_node *un = VTOUNION(ap->a_vp);
1502 struct componentname *cnp = ap->a_cnp;
1503 struct thread *td = cnp->cn_td;
1504 struct vnode *upperdvp;
1505 struct vnode *uppervp;
1508 if ((upperdvp = union_lock_upper(dun, td)) == NULLVP)
1509 panic("union rmdir: null upper vnode");
1511 if ((uppervp = union_lock_upper(un, td)) != NULLVP) {
1512 if (union_dowhiteout(un, cnp->cn_cred, td))
1513 cnp->cn_flags |= CNP_DOWHITEOUT;
1514 error = VOP_RMDIR(upperdvp, uppervp, ap->a_cnp);
1515 union_unlock_upper(uppervp, td);
1517 error = union_mkwhiteout(
1518 MOUNTTOUNIONMOUNT(ap->a_dvp->v_mount),
1519 dun->un_uppervp, ap->a_cnp, un->un_path);
1521 union_unlock_upper(upperdvp, td);
1528 * dvp is locked on entry and remains locked on return. a_vpp is garbage
1531 * union_symlink(struct vnode *a_dvp, struct vnode **a_vpp,
1532 * struct componentname *a_cnp, struct vattr *a_vap,
1536 union_symlink(struct vop_old_symlink_args *ap)
1538 struct union_node *dun = VTOUNION(ap->a_dvp);
1539 struct componentname *cnp = ap->a_cnp;
1540 struct thread *td = cnp->cn_td;
1544 if ((dvp = union_lock_upper(dun, td)) != NULLVP) {
1545 error = VOP_SYMLINK(dvp, ap->a_vpp, cnp, ap->a_vap,
1547 union_unlock_upper(dvp, td);
1553 * union_readdir works in concert with getdirentries and
1554 * readdir(3) to provide a list of entries in the unioned
1555 * directories. getdirentries is responsible for walking
1556 * down the union stack. readdir(3) is responsible for
1557 * eliminating duplicate names from the returned data stream.
1559 * union_readdir(struct vnode *a_vp, struct uio *a_uio, struct ucred *a_cred,
1560 * int *a_eofflag, u_long *a_cookies, int a_ncookies)
1563 union_readdir(struct vop_readdir_args *ap)
1565 struct union_node *un = VTOUNION(ap->a_vp);
1566 struct thread *td = ap->a_uio->uio_td;
1570 if ((uvp = union_lock_upper(un, td)) != NULLVP) {
1571 ap->a_head.a_ops = *uvp->v_ops;
1573 error = vop_readdir_ap(ap);
1574 union_unlock_upper(uvp, td);
1580 * union_readlink(struct vnode *a_vp, struct uio *a_uio, struct ucred *a_cred)
1583 union_readlink(struct vop_readlink_args *ap)
1586 struct union_node *un = VTOUNION(ap->a_vp);
1587 struct uio *uio = ap->a_uio;
1588 struct thread *td = uio->uio_td;
1591 vp = union_lock_other(un, td);
1592 KASSERT(vp != NULL, ("union_readlink: backing vnode missing!"));
1594 ap->a_head.a_ops = *vp->v_ops;
1596 error = vop_readlink_ap(ap);
1597 union_unlock_other(vp, td);
1605 * Called with the vnode locked. We are expected to unlock the vnode.
1607 * union_inactive(struct vnode *a_vp, struct thread *a_td)
1610 union_inactive(struct vop_inactive_args *ap)
1612 struct vnode *vp = ap->a_vp;
1613 /*struct thread *td = ap->a_td;*/
1614 struct union_node *un = VTOUNION(vp);
1618 * Do nothing (and _don't_ bypass).
1619 * Wait to vrele lowervp until reclaim,
1620 * so that until then our union_node is in the
1621 * cache and reusable.
1623 * NEEDSWORK: Someday, consider inactive'ing
1624 * the lowervp and then trying to reactivate it
1625 * with capabilities (v_id)
1626 * like they do in the name lookup cache code.
1627 * That's too much work for now.
1630 if (un->un_dircache != 0) {
1631 for (vpp = un->un_dircache; *vpp != NULLVP; vpp++)
1633 free (un->un_dircache, M_TEMP);
1634 un->un_dircache = 0;
1638 if ((un->un_flags & UN_ULOCK) && un->un_uppervp) {
1639 un->un_flags &= ~UN_ULOCK;
1640 vn_unlock(un->un_uppervp);
1644 if ((un->un_flags & UN_CACHED) == 0)
1651 * union_reclaim(struct vnode *a_vp)
1654 union_reclaim(struct vop_reclaim_args *ap)
1656 union_freevp(ap->a_vp);
1664 * There isn't much we can do. We cannot push through to the real vnode
1665 * to get to the underlying device because this will bypass data
1666 * cached by the real vnode.
1668 * For some reason we cannot return the 'real' vnode either, it seems
1669 * to blow up memory maps.
1671 * union_bmap(struct vnode *a_vp, off_t a_loffset, struct vnode **a_vpp,
1672 * off_t *a_doffsetp, int *a_runp, int *a_runb)
1675 union_bmap(struct vop_bmap_args *ap)
1681 * union_print(struct vnode *a_vp)
1684 union_print(struct vop_print_args *ap)
1686 struct vnode *vp = ap->a_vp;
1688 printf("\ttag VT_UNION, vp=%p, uppervp=%p, lowervp=%p\n",
1689 vp, UPPERVP(vp), LOWERVP(vp));
1690 if (UPPERVP(vp) != NULLVP)
1691 vprint("union: upper", UPPERVP(vp));
1692 if (LOWERVP(vp) != NULLVP)
1693 vprint("union: lower", LOWERVP(vp));
1699 * union_pathconf(struct vnode *a_vp, int a_name, int *a_retval)
1702 union_pathconf(struct vop_pathconf_args *ap)
1705 struct thread *td = curthread; /* XXX */
1706 struct union_node *un = VTOUNION(ap->a_vp);
1709 vp = union_lock_other(un, td);
1710 KASSERT(vp != NULL, ("union_pathconf: backing vnode missing!"));
1712 ap->a_head.a_ops = *vp->v_ops;
1714 error = vop_pathconf_ap(ap);
1715 union_unlock_other(vp, td);
1721 * union_advlock(struct vnode *a_vp, caddr_t a_id, int a_op,
1722 * struct flock *a_fl, int a_flags)
1725 union_advlock(struct vop_advlock_args *ap)
1727 struct vnode *ovp = OTHERVP(ap->a_vp);
1729 ap->a_head.a_ops = *ovp->v_ops;
1731 return (vop_advlock_ap(ap));
1736 * XXX - vop_strategy must be hand coded because it has no
1737 * YYY - and it is not coherent with anything
1739 * vnode in its arguments.
1740 * This goes away with a merged VM/buffer cache.
1742 * union_strategy(struct vnode *a_vp, struct bio *a_bio)
1745 union_strategy(struct vop_strategy_args *ap)
1747 struct bio *bio = ap->a_bio;
1748 struct buf *bp = bio->bio_buf;
1749 struct vnode *othervp = OTHERVP(ap->a_vp);
1752 if (othervp == NULLVP)
1753 panic("union_strategy: nil vp");
1754 if (bp->b_cmd != BUF_CMD_READ && (othervp == LOWERVP(ap->a_vp)))
1755 panic("union_strategy: writing to lowervp");
1757 return (vn_strategy(othervp, bio));
1761 * Global vfs data structures
1763 struct vop_ops union_vnode_vops = {
1764 .vop_default = vop_defaultop,
1765 .vop_access = union_access,
1766 .vop_advlock = union_advlock,
1767 .vop_bmap = union_bmap,
1768 .vop_close = union_close,
1769 .vop_old_create = union_create,
1770 .vop_fsync = union_fsync,
1771 .vop_getpages = union_getpages,
1772 .vop_putpages = union_putpages,
1773 .vop_getattr = union_getattr,
1774 .vop_inactive = union_inactive,
1775 .vop_ioctl = union_ioctl,
1776 .vop_old_link = union_link,
1777 .vop_old_lookup = union_lookup,
1778 .vop_old_mkdir = union_mkdir,
1779 .vop_old_mknod = union_mknod,
1780 .vop_mmap = union_mmap,
1781 .vop_open = union_open,
1782 .vop_pathconf = union_pathconf,
1783 .vop_poll = union_poll,
1784 .vop_print = union_print,
1785 .vop_read = union_read,
1786 .vop_readdir = union_readdir,
1787 .vop_readlink = union_readlink,
1788 .vop_reclaim = union_reclaim,
1789 .vop_old_remove = union_remove,
1790 .vop_old_rename = union_rename,
1791 .vop_revoke = union_revoke,
1792 .vop_old_rmdir = union_rmdir,
1793 .vop_setattr = union_setattr,
1794 .vop_strategy = union_strategy,
1795 .vop_old_symlink = union_symlink,
1796 .vop_old_whiteout = union_whiteout,
1797 .vop_write = union_write